From c6d1b3391a6900221ce5b5541168ffbb622f95c7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 12:46:47 +0000 Subject: [PATCH 1/5] fix(coherence): pin the checker and the scan workflow with the stack The invoke-slice gate pins trope-checker at 0dceab6 (was 4ecba4f), with haec and hermeneia, so the three siblings build against one checker. Between the two commits trope-checker's src/, schemas/, spec/ and conformance fixtures do not differ. Run locally with Zig 0.16.0 at the new pin: zig build test passes and tests/e2e/invoke_slice.sh reports GATE PASS. The Hypatia scan pin moves to standards 58362c2, which installs OTP 27.3.4.19. Earlier revisions install OTP 28.x, which faults in the VM's garbage collector on some trees (hypatia#1061). Found by the stack coherence gate (workbench#83). Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/hypatia-scan.yml | 2 +- CHANGELOG.adoc | 8 ++++++++ tests/e2e/invoke_slice.sh | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hypatia-scan.yml b/.github/workflows/hypatia-scan.yml index 05785e9..892e94d 100644 --- a/.github/workflows/hypatia-scan.yml +++ b/.github/workflows/hypatia-scan.yml @@ -28,4 +28,4 @@ permissions: jobs: scan: - uses: metadatastician/standards/.github/workflows/hypatia-scan-reusable.yml@857ff096af11451841fb10488fed1438523973a1 + uses: metadatastician/standards/.github/workflows/hypatia-scan-reusable.yml@58362c24cf225694b388fc660b3525d8207b7c61 diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 92b1e3c..657e8e9 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,6 +10,14 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ==== Fixed +* *Stack coherence: the checker pin and the scan pin (2026-11-17).* The +invoke-slice gate pins trope-checker at `+0dceab6+` (was `+4ecba4f+`), the +commit haec and hermeneia move to in the same sweep. Between the two commits +trope-checker's `+src/+`, `+schemas/+`, `+spec/+` and conformance fixtures are +unchanged. `+zig build test+` and `+tests/e2e/invoke_slice.sh+` pass at the new +pin (Zig 0.16.0, run locally). The Hypatia scan pin moves to the revision that +installs OTP 27.3.4.19 (hypatia#1061). + * *The `+proof-check-idris2+` account was wrong (2026-11-09).* Review found it, and it was right. `+docs/status/PROOF-STATUS.adoc+` said that with a toolchain present every individual `+proof-check-*+` recipe would report green on diff --git a/tests/e2e/invoke_slice.sh b/tests/e2e/invoke_slice.sh index 27adb6c..1844292 100755 --- a/tests/e2e/invoke_slice.sh +++ b/tests/e2e/invoke_slice.sh @@ -17,7 +17,7 @@ set -euo pipefail cd "$(dirname "$0")/../.." ZIG_EXPECTED="$(awk '$1=="zig"{print $2}' .tool-versions)" -TROPECHECK_PIN="4ecba4f1862aec144ec940b1d8a93ddabd1cb591" +TROPECHECK_PIN="0dceab68459d46b2cda22137c261023223c30e9a" fail() { echo "GATE FAIL: $*" >&2; exit 1; } From b52b03f99bf1c1ffec4d564776f3b4d2214a9891 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 16:32:33 +0000 Subject: [PATCH 2/5] ci(lint): read the SPDX header block, and the lockfile for pins The lint tested line 1 of each workflow for the SPDX identifier. gh actions-lock inserts its banner at line 1 whenever it refreshes the lockfile, so the test failed on nearly every workflow, here and on main. It now reads the leading comment block, the test standards governance-reusable.yml uses. A workflow with no identifier in that block still fails (checked with two planted files). The pin step required an inline commit on every action. Workflows here use tags resolved by actions.lock, so that step could not pass (38 references). It now verifies lockfile coverage and keeps the inline-commit rule for reusable workflow calls, as the copy of this lint in haec does. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/workflow-linter.yml | 63 +++++++++++++++++++-------- CHANGELOG.adoc | 11 +++++ 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index 98c9abc..ca0edb9 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -34,16 +34,23 @@ jobs: - name: Check SPDX Headers run: | echo "=== Checking SPDX License Headers ===" + # The header comment block is read, not line 1 alone. gh actions-lock + # inserts "# This workflow is managed by gh actions-lock." at line 1 + # whenever it refreshes the lockfile, so a line-1 test fails every + # workflow the tool has touched. The test below is the one in + # standards' governance-reusable.yml: the leading run of comment + # lines must hold the identifier. failed=0 for file in .github/workflows/*.yml .github/workflows/*.yaml; do [ -f "$file" ] || continue - if ! head -1 "$file" | grep -q "^# SPDX-License-Identifier:"; then - echo "ERROR: $file missing SPDX header" + if ! awk '/^---[[:space:]]*$/ { next } /^#/ { print; next } { exit }' "$file" \ + | grep -q "^# SPDX-License-Identifier:"; then + echo "ERROR: $file has no SPDX-License-Identifier in its header comment block" failed=1 fi done if [ $failed -eq 1 ]; then - echo "Add '# SPDX-License-Identifier: MPL-2.0' as first line" + echo "Add '# SPDX-License-Identifier: ' to the header comment block" exit 1 fi echo "All workflows have SPDX headers" @@ -66,23 +73,45 @@ jobs: echo "All workflows have permissions declared" - name: Check SHA-Pinned Actions + env: + GH_TOKEN: ${{ github.token }} run: | echo "=== Checking Action Pinning ===" - # Find any uses: lines that don't have @SHA format - # Pattern: uses: owner/repo@<40-char-hex> - unpinned=$(grep -rnE "^[[:space:]]+uses:" .github/workflows/ | \ - grep -v "@[a-f0-9]\{40\}" | \ - grep -v "uses: \./\|uses: docker://\|uses: actions/github-script" || true) - - if [ -n "$unpinned" ]; then - echo "ERROR: Found unpinned actions:" - echo "$unpinned" - echo "" - echo "Replace version tags with SHA pins, e.g.:" - echo " uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6.0.1" - exit 1 + if [ -f .github/workflows/actions.lock ]; then + # Pin authority is the Actions dependency lockfile: workflows use + # readable tags, the lockfile maps each ref to an exact commit and + # the runner enforces it. Verify every action ref has a lockfile + # entry (offline coverage check). + gh extension install github/gh-actions-lock + gh actions-lock --verify-local + + # Reusable workflow calls are outside lockfile scope and must + # remain SHA-pinned inline. + unpinned=$(grep -rnE "^[[:space:]]+uses:[[:space:]]*[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+/\.github/workflows/[^@]+@" .github/workflows/ | \ + grep -v "@[a-f0-9]\{40\}" || true) + if [ -n "$unpinned" ]; then + echo "ERROR: Found reusable workflow calls not pinned to a SHA:" + echo "$unpinned" + exit 1 + fi + echo "Lockfile coverage verified; reusable workflow calls are SHA-pinned" + else + # No lockfile: every uses: must carry an inline SHA pin. + # Pattern: uses: owner/repo@<40-char-hex> + unpinned=$(grep -rnE "^[[:space:]]+uses:" .github/workflows/ | \ + grep -v "@[a-f0-9]\{40\}" | \ + grep -v "uses: \./\|uses: docker://\|uses: actions/github-script" || true) + + if [ -n "$unpinned" ]; then + echo "ERROR: Found unpinned actions:" + echo "$unpinned" + echo "" + echo "Replace version tags with SHA pins, e.g.:" + echo " uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6.0.1" + exit 1 + fi + echo "All actions are SHA-pinned" fi - echo "All actions are SHA-pinned" - name: Check for Duplicate Workflows run: | diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 657e8e9..1846493 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,6 +10,17 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ==== Fixed +* *Workflow lint reads the SPDX header block and the lockfile (2026-11-17).* +The lint tested line 1 of each workflow for the SPDX identifier, but +`+gh actions-lock+` puts its own banner on line 1 whenever it refreshes the +lockfile, so the test failed on 26 of 28 workflows here and on `+main+`. It now +reads the leading comment block, the same test as `+standards+` +`+governance-reusable.yml+`; a workflow with no identifier there still fails. +The pin step required an inline commit on every action, which the move to +`+actions.lock+` made unsatisfiable (38 tag references). It now checks lockfile +coverage and keeps the inline-commit rule for reusable workflow calls, as the +copy of this lint in haec does. + * *Stack coherence: the checker pin and the scan pin (2026-11-17).* The invoke-slice gate pins trope-checker at `+0dceab6+` (was `+4ecba4f+`), the commit haec and hermeneia move to in the same sweep. Between the two commits From caa1ee626d8e558ba927a6a16d1e673931fd930d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 16:40:30 +0000 Subject: [PATCH 3/5] ci(lint): judge the ref of a reusable workflow call, not the line The check for reusable workflow calls looked for 40 hex characters anywhere on the line and only matched an unquoted value. A branch ref with a commit named in a trailing comment passed, and so did any quoted ref. The value of each uses: is now read with its comment and quotes removed, and the text after the @ must be exactly 40 lowercase hex characters. Four planted references (comment, double quote, single quote, 41 characters) pass the previous check and fail this one; a plain commit, a quoted commit and an ordinary action on a tag are unaffected. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/workflow-linter.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index ca0edb9..27e90e4 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -87,8 +87,22 @@ jobs: # Reusable workflow calls are outside lockfile scope and must # remain SHA-pinned inline. - unpinned=$(grep -rnE "^[[:space:]]+uses:[[:space:]]*[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+/\.github/workflows/[^@]+@" .github/workflows/ | \ - grep -v "@[a-f0-9]\{40\}" || true) + # The value of each `uses:` is read as YAML would read it: a + # trailing comment is dropped and surrounding quotes are removed. + # The ref after the @ must then be exactly 40 lowercase hex + # characters; a commit named in a comment, or a quoted branch + # name, does not pass. + unpinned=$(awk ' + /^[[:space:]]*(-[[:space:]]+)?uses:/ { + v = $0 + sub(/^[[:space:]]*(-[[:space:]]+)?uses:[[:space:]]*/, "", v) + sub(/[[:space:]]+#.*$/, "", v) + sub(/[[:space:]]+$/, "", v) + gsub(/^["\047]|["\047]$/, "", v) + if (v !~ /^[^\/]+\/[^\/]+\/\.github\/workflows\/[^@]+@/) next + ref = v; sub(/^[^@]*@/, "", ref) + if (ref !~ /^[0-9a-f]+$/ || length(ref) != 40) print FILENAME ":" FNR ": " $0 + }' .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null || true) if [ -n "$unpinned" ]; then echo "ERROR: Found reusable workflow calls not pinned to a SHA:" echo "$unpinned" From c29624a4fdd73aa12f892c9b16a3bcafbef69e19 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 16:44:47 +0000 Subject: [PATCH 4/5] ci(lint): judge reusable workflow refs after YAML decoding The previous version read the raw text of each uses: line, so an escape inside a quoted value (for example \x77orkflows) kept a branch ref out of the check. With yq on the runner each workflow is now parsed and the decoded job-level uses: values are judged: a call that is not local must end in @ and exactly 40 lowercase hex characters, and a workflow that does not parse fails. Without yq the raw-text check remains, with a warning. Run against the real step: an escaped path, a flow-style mapping and a comment carrying a commit are each rejected; a quoted commit, a local call and an ordinary tagged action pass. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/workflow-linter.yml | 54 +++++++++++++++++++-------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index 27e90e4..c24c181 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -87,22 +87,44 @@ jobs: # Reusable workflow calls are outside lockfile scope and must # remain SHA-pinned inline. - # The value of each `uses:` is read as YAML would read it: a - # trailing comment is dropped and surrounding quotes are removed. - # The ref after the @ must then be exactly 40 lowercase hex - # characters; a commit named in a comment, or a quoted branch - # name, does not pass. - unpinned=$(awk ' - /^[[:space:]]*(-[[:space:]]+)?uses:/ { - v = $0 - sub(/^[[:space:]]*(-[[:space:]]+)?uses:[[:space:]]*/, "", v) - sub(/[[:space:]]+#.*$/, "", v) - sub(/[[:space:]]+$/, "", v) - gsub(/^["\047]|["\047]$/, "", v) - if (v !~ /^[^\/]+\/[^\/]+\/\.github\/workflows\/[^@]+@/) next - ref = v; sub(/^[^@]*@/, "", ref) - if (ref !~ /^[0-9a-f]+$/ || length(ref) != 40) print FILENAME ":" FNR ": " $0 - }' .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null || true) + # A reusable workflow call is a job-level `uses:`. With yq each + # workflow is parsed and the DECODED value is judged, so quoting, + # escapes, flow style and trailing comments cannot hide a ref: a + # call that is not local (./) must end in @ followed by exactly + # 40 lowercase hex characters. + unpinned="" + if command -v yq >/dev/null 2>&1; then + for file in .github/workflows/*.yml .github/workflows/*.yaml; do + [ -f "$file" ] || continue + if ! calls="$(yq -r '.jobs[] | select(has("uses")) | .uses' "$file" 2>&1)"; then + echo "ERROR: $file is not parseable as YAML: $calls" + exit 1 + fi + while IFS= read -r call; do + [ -n "$call" ] || continue + case "$call" in ./*) continue ;; esac + if ! printf '%s\n' "$call" | grep -qE '@[0-9a-f]{40}$'; then + unpinned="${unpinned}${file}: ${call}"$'\n' + fi + done < <(printf '%s\n' "$calls") + done + else + # No yq on this runner: the raw text is read instead, with the + # comment and quotes removed. Escapes inside a quoted value are + # not decoded on this path. + echo "::warning::yq not on this runner -- reusable workflow refs read from raw text" + unpinned=$(awk ' + /^[[:space:]]*(-[[:space:]]+)?uses:/ { + v = $0 + sub(/^[[:space:]]*(-[[:space:]]+)?uses:[[:space:]]*/, "", v) + sub(/[[:space:]]+#.*$/, "", v) + sub(/[[:space:]]+$/, "", v) + gsub(/^["\047]|["\047]$/, "", v) + if (v !~ /^[^\/]+\/[^\/]+\/\.github\/workflows\/[^@]+@/) next + ref = v; sub(/^[^@]*@/, "", ref) + if (ref !~ /^[0-9a-f]+$/ || length(ref) != 40) print FILENAME ":" FNR ": " $0 + }' .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null || true) + fi if [ -n "$unpinned" ]; then echo "ERROR: Found reusable workflow calls not pinned to a SHA:" echo "$unpinned" From 3d0d612b1c72a3e90954106551f2409c8e9c4f3e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 16:46:57 +0000 Subject: [PATCH 5/5] ci(lint): no YAML parser, no verdict on reusable workflow refs The raw-text fallback for runners without yq could not see a flow-style mapping or an escaped path, so on that path a branch ref still passed. The fallback is removed: when yq is missing the step fails and says why. Run against the real step: a flow-style branch ref and an escaped path are rejected, a quoted commit and a local call pass, both repositories pass, and with yq taken off PATH the step exits 1. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/workflow-linter.yml | 51 +++++++++++---------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index c24c181..6439429 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -92,39 +92,28 @@ jobs: # escapes, flow style and trailing comments cannot hide a ref: a # call that is not local (./) must end in @ followed by exactly # 40 lowercase hex characters. + # No parser, no verdict: reading the raw text instead would let a + # flow-style mapping or an escaped path through, so the step fails + # when yq is missing. + if ! command -v yq >/dev/null 2>&1; then + echo "ERROR: yq is not on this runner; reusable workflow refs cannot be checked" + exit 1 + fi unpinned="" - if command -v yq >/dev/null 2>&1; then - for file in .github/workflows/*.yml .github/workflows/*.yaml; do - [ -f "$file" ] || continue - if ! calls="$(yq -r '.jobs[] | select(has("uses")) | .uses' "$file" 2>&1)"; then - echo "ERROR: $file is not parseable as YAML: $calls" - exit 1 + for file in .github/workflows/*.yml .github/workflows/*.yaml; do + [ -f "$file" ] || continue + if ! calls="$(yq -r '.jobs[] | select(has("uses")) | .uses' "$file" 2>&1)"; then + echo "ERROR: $file is not parseable as YAML: $calls" + exit 1 + fi + while IFS= read -r call; do + [ -n "$call" ] || continue + case "$call" in ./*) continue ;; esac + if ! printf '%s\n' "$call" | grep -qE '@[0-9a-f]{40}$'; then + unpinned="${unpinned}${file}: ${call}"$'\n' fi - while IFS= read -r call; do - [ -n "$call" ] || continue - case "$call" in ./*) continue ;; esac - if ! printf '%s\n' "$call" | grep -qE '@[0-9a-f]{40}$'; then - unpinned="${unpinned}${file}: ${call}"$'\n' - fi - done < <(printf '%s\n' "$calls") - done - else - # No yq on this runner: the raw text is read instead, with the - # comment and quotes removed. Escapes inside a quoted value are - # not decoded on this path. - echo "::warning::yq not on this runner -- reusable workflow refs read from raw text" - unpinned=$(awk ' - /^[[:space:]]*(-[[:space:]]+)?uses:/ { - v = $0 - sub(/^[[:space:]]*(-[[:space:]]+)?uses:[[:space:]]*/, "", v) - sub(/[[:space:]]+#.*$/, "", v) - sub(/[[:space:]]+$/, "", v) - gsub(/^["\047]|["\047]$/, "", v) - if (v !~ /^[^\/]+\/[^\/]+\/\.github\/workflows\/[^@]+@/) next - ref = v; sub(/^[^@]*@/, "", ref) - if (ref !~ /^[0-9a-f]+$/ || length(ref) != 40) print FILENAME ":" FNR ": " $0 - }' .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null || true) - fi + done < <(printf '%s\n' "$calls") + done if [ -n "$unpinned" ]; then echo "ERROR: Found reusable workflow calls not pinned to a SHA:" echo "$unpinned"