From e99efb1dee94d72bc0cb334d46d07b28d4adc60d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 11:46:14 +0000 Subject: [PATCH 1/6] ci: add the required CI/gate aggregator main's ruleset requires a status check named CI/gate that no workflow produced, so auto-merge could never fire. Add ci.yml, which calls the agda-proofs, rust-ci and dashboard-check workflows (now workflow_call only, so nothing runs twice) and a gate job that fails unless every called workflow succeeded. Add scripts/ci-gate.sh and a test that fails when a job is left out of the gate. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX --- .github/workflows/actions.lock | 2 ++ .github/workflows/agda-proofs.yml | 5 ++- .github/workflows/ci.yml | 49 +++++++++++++++++++++++++++ .github/workflows/dashboard-check.yml | 6 ++-- .github/workflows/rust-ci.yml | 5 ++- scripts/ci-gate.sh | 35 +++++++++++++++++++ tests/workflows/ci_gate_test.sh | 49 +++++++++++++++++++++++++++ 7 files changed, 141 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100755 scripts/ci-gate.sh create mode 100755 tests/workflows/ci_gate_test.sh diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index b1661d7..5cd18bc 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -14,6 +14,8 @@ workflows: - 'actions/deploy-pages@v5.0.1' - 'actions/upload-pages-artifact@v5.0.0' - 'haskell-actions/setup@v2.12.1' + '.github/workflows/ci.yml': + - 'actions/checkout@v7.0.1' '.github/workflows/codeql.yml': - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' '.github/workflows/dashboard-check.yml': diff --git a/.github/workflows/agda-proofs.yml b/.github/workflows/agda-proofs.yml index 43af4d8..0c022af 100644 --- a/.github/workflows/agda-proofs.yml +++ b/.github/workflows/agda-proofs.yml @@ -6,9 +6,8 @@ name: Agda proofs # Checks verification/proofs/agda/Reversibility.agda under the kernel flags # and refuses the fixtures under tests/reject-agda. Local run: just test-agda. on: - push: - branches: [main] - pull_request: + # Called from ci.yml, whose `CI/gate` aggregates it; no triggers of its own. + workflow_call: permissions: contents: read jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..598b066 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +name: CI +# One entry point for the checks the `main` ruleset requires. `needs:` only +# works inside a single workflow, so the gated workflows (agda-proofs.yml, +# rust-ci.yml, dashboard-check.yml) are reusable (`on: workflow_call`) and are +# called from here. They have no push/pull_request triggers of their own, so +# nothing runs twice. `gate` is the required status check `CI/gate`: it passes +# only if every called workflow ended `success` (scripts/ci-gate.sh). A new +# gated workflow must be called here AND listed in the gate's `needs:`; +# tests/workflows/ci_gate_test.sh fails if it is not. +on: + push: + branches: [main, master] + pull_request: +permissions: + contents: read +jobs: + agda-proofs: + uses: ./.github/workflows/agda-proofs.yml + permissions: + contents: read + rust-ci: + uses: ./.github/workflows/rust-ci.yml + permissions: + actions: read + contents: read + security-events: write + dashboard-check: + uses: ./.github/workflows/dashboard-check.yml + permissions: + actions: read + contents: read + gate: + name: CI/gate + needs: [agda-proofs, rust-ci, dashboard-check] + if: ${{ always() }} + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + steps: + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - name: All required jobs succeeded + env: + NEEDS_JSON: ${{ toJSON(needs) }} + run: bash scripts/ci-gate.sh diff --git a/.github/workflows/dashboard-check.yml b/.github/workflows/dashboard-check.yml index 9f605de..f7f57bb 100644 --- a/.github/workflows/dashboard-check.yml +++ b/.github/workflows/dashboard-check.yml @@ -9,10 +9,8 @@ name: Dashboard Check on: - pull_request: - branches: ['**'] - push: - branches: [main, master] + # Called from ci.yml, whose `CI/gate` aggregates it; no triggers of its own. + workflow_call: permissions: actions: read diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 96f6934..87672b5 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -7,9 +7,8 @@ name: Rust CI on: - push: - branches: [main, master] - pull_request: + # push and pull_request runs come from ci.yml (`CI/gate` aggregates them). + workflow_call: # Weekly, so a new RustSec advisory against an unchanged Cargo.lock is still # caught (the scheduled cargo-audit.yml was folded into this workflow). schedule: diff --git a/scripts/ci-gate.sh b/scripts/ci-gate.sh new file mode 100755 index 0000000..2fd26cb --- /dev/null +++ b/scripts/ci-gate.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +# +# ci-gate.sh — the verdict behind the required status check `CI/gate`. +# +# Reads the `needs` context of a GitHub Actions job (toJSON(needs)) from +# $NEEDS_JSON and succeeds only if at least one job was aggregated and EVERY +# one ended `success`. `failure`, `cancelled` and `skipped` all fail: a skipped +# prover leg is a leg that proved nothing, and a gate that counts it as green is +# a rubber stamp (doctrine 3, fail loudly). An empty or unparseable context +# fails too, so a gate pointed at zero jobs cannot pass. +# +# Exit: 0 all aggregated jobs succeeded; 1 a job did not, or none were given; +# 2 setup error (no jq, no NEEDS_JSON). +set -euo pipefail + +command -v jq >/dev/null 2>&1 || { echo "ci-gate: jq is required" >&2; exit 2; } +[ -n "${NEEDS_JSON:-}" ] || { echo "ci-gate: NEEDS_JSON is not set" >&2; exit 2; } + +total="$(jq -e 'length' <<<"$NEEDS_JSON")" || { echo "::error::ci-gate: NEEDS_JSON is not a JSON object"; exit 1; } +if [ "$total" -eq 0 ]; then + echo "::error::CI/gate aggregates no jobs (denominator = 0); refusing to pass." + exit 1 +fi + +echo "CI/gate: ${total} aggregated job(s)" +jq -r 'to_entries[] | " \(.key): \(.value.result)"' <<<"$NEEDS_JSON" + +bad="$(jq -r 'to_entries[] | select(.value.result != "success") | "\(.key)=\(.value.result)"' <<<"$NEEDS_JSON")" +if [ -n "$bad" ]; then + while IFS= read -r line; do echo "::error::CI/gate: required job did not succeed: ${line}"; done <<<"$bad" + exit 1 +fi +echo "CI/gate: all ${total} required job(s) succeeded" diff --git a/tests/workflows/ci_gate_test.sh b/tests/workflows/ci_gate_test.sh new file mode 100755 index 0000000..8185deb --- /dev/null +++ b/tests/workflows/ci_gate_test.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +# CI/gate must be a verdict, not a rubber stamp. Positive control: all green +# passes. Negative cases: failure, cancelled, skipped, empty and malformed +# input each fail. Drift: the gate's `needs:` must list every other job of +# ci.yml; every workflow ci.yml calls must be reusable and must have no +# push/pull_request trigger of its own (else it would run twice). +# shellcheck disable=SC2015,SC2016 +set -uo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." || exit 2 +fail=0 +chk() { # chk NAME WANT-RC JSON + NEEDS_JSON="$3" bash scripts/ci-gate.sh >/dev/null 2>&1; rc=$? + if [ "$rc" -eq "$2" ]; then echo "ok $1"; else echo "FAIL $1: rc=$rc want $2"; fail=1; fi +} +chk "all success passes" 0 '{"a":{"result":"success"},"b":{"result":"success"}}' +chk "one failure fails" 1 '{"a":{"result":"success"},"b":{"result":"failure"}}' +chk "one cancelled fails" 1 '{"a":{"result":"success"},"b":{"result":"cancelled"}}' +chk "one skipped fails" 1 '{"a":{"result":"success"},"b":{"result":"skipped"}}' +chk "empty needs fails" 1 '{}' +chk "malformed fails" 1 'not json' + +wf=.github/workflows/ci.yml +jobs="$(sed -n '/^jobs:/,$ s/^ \([a-z0-9-]*\):$/\1/p' "$wf" | grep -vx 'gate' | sort | tr '\n' ' ')" +needs="$(sed -n 's/^ needs: \[\(.*\)\]$/\1/p' "$wf" | tr -d ',' | tr ' ' '\n' | sort | tr '\n' ' ')" +if [ -n "$jobs" ] && [ "$jobs" = "$needs" ]; then echo "ok gate needs every other job ($needs)"; else echo "FAIL needs drift: jobs=[$jobs] needs=[$needs]"; fail=1; fi +grep -q '^ name: CI/gate$' "$wf" && echo "ok job name is exactly CI/gate" || { echo "FAIL job name"; fail=1; } +grep -q '^ if: \${{ always() }}$' "$wf" && echo "ok gate runs always()" || { echo "FAIL gate lacks always()"; fail=1; } + +# Every workflow ci.yml calls: reusable, and no direct push/pull_request trigger. +called="$(sed -n 's/^ uses: \(\.\/\.github\/workflows\/[^ ]*\)$/\1/p' "$wf")" +[ -n "$called" ] || { echo "FAIL ci.yml calls no local workflow"; fail=1; } +for f in $called; do + f="${f#./}" + # the top-level `on:` block: from `on:` to the next unindented key + on_block="$(sed -n '/^on:/,/^[a-z]/p' "$f" | sed '$d')" + grep -q '^ workflow_call:' <<<"$on_block" && echo "ok $f is reusable" || { echo "FAIL $f lacks workflow_call"; fail=1; } + if grep -qE '^ (push|pull_request|pull_request_target):' <<<"$on_block"; then + echo "FAIL $f has its own push/pull_request trigger: it would run twice"; fail=1 + else echo "ok $f has no push/pull_request trigger of its own"; fi +done +# The gated jobs the owner named must still be reachable from the called workflows. +for j in proofs recheck receipt; do + grep -q "^ $j:" .github/workflows/agda-proofs.yml && echo "ok agda-proofs.yml still has job $j" || { echo "FAIL agda-proofs.yml lost job $j"; fail=1; } +done +grep -q '^ dashboard-check:' .github/workflows/dashboard-check.yml && echo "ok dashboard-check job present" || { echo "FAIL dashboard-check job lost"; fail=1; } +grep -q '^ rust-ci:' .github/workflows/rust-ci.yml && echo "ok rust-ci job present" || { echo "FAIL rust-ci job lost"; fail=1; } +exit $fail From e3eee400b4a777fb22ac5457492bbf7427ad4a2c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 13:15:12 +0000 Subject: [PATCH 2/6] ci: call the cicd-suite Rust gate directly from CI The metadatastician/standards reusable cannot be called from this repository (startup_failure, zero jobs), so CI never started. Call hyperpolymath/proven-cicd-and-workflows rust-ci.yml at its full SHA from ci.yml; the suite reads the pin from the top-level workflow file, so a nested call through rust-ci.yml would not verify. rust-ci.yml keeps only the weekly schedule and the same pin. Drop the workflow from actions.lock (de-onboarded, as the suite requires). cargo audit is replaced by the suite's cargo-deny job. Fix a private intra-doc link that the new cargo doc -D warnings check rejects. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX --- .github/workflows/actions.lock | 2 -- .github/workflows/ci.yml | 8 ++++-- .github/workflows/rust-ci.yml | 37 ++++++++++++++----------- crates/januskey-cli/src/obliteration.rs | 2 +- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 5cd18bc..81f3a21 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -41,8 +41,6 @@ workflows: '.github/workflows/labels.yml': [] '.github/workflows/mirror.yml': - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' - '.github/workflows/rust-ci.yml': - - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' '.github/workflows/scorecard.yml': - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' '.github/workflows/secret-scanner.yml': diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 598b066..40a1193 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,11 +21,13 @@ jobs: permissions: contents: read rust-ci: - uses: ./.github/workflows/rust-ci.yml + # Called directly, not through rust-ci.yml: the suite reads the pin back + # from the top-level workflow file (this one). See rust-ci.yml's header. + # Keep this SHA identical to the one in rust-ci.yml. Its jobs ask for + # contents: read only; granting less is a startup_failure. permissions: - actions: read contents: read - security-events: write + uses: hyperpolymath/proven-cicd-and-workflows/.github/workflows/rust-ci.yml@9eb0bbf9bd80b7964ce5b9957e75821b3cd4a55b # cicd-suite main dashboard-check: uses: ./.github/workflows/dashboard-check.yml permissions: diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 87672b5..8a25410 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -1,31 +1,36 @@ # This workflow is managed by gh actions-lock. # SPDX-License-Identifier: MPL-2.0 -# This workflow is managed by gh actions-lock. -# Rust CI — thin wrapper calling the shared estate reusable in -# hyperpolymath/standards. Configure once, propagate everywhere. -# See: docs/CI-REUSABLE-WORKFLOWS.adoc in standards. +# Rust CI — thin caller of the estate's strict Rust gate in +# hyperpolymath/proven-cicd-and-workflows (rust-ci.yml, a reusable workflow). +# This repository cannot call reusables owned by metadatastician (every such +# run ended startup_failure), so the previous call to +# metadatastician/standards rust-ci-reusable.yml is replaced. +# +# Weekly only: pull_request and push runs come from ci.yml, whose `rust-ci` +# job holds the same pin. The suite's gate scripts are selected by reading the +# TOP-LEVEL workflow file's `uses:` line back (GITHUB_WORKFLOW_REF), which is +# ci.yml under a ci.yml call, so a nested call through this file could not be +# verified and ci.yml calls the suite directly. Keep the two pins identical. +# +# The weekly run still catches a new RustSec advisory against an unchanged +# Cargo.lock. The old `enable_audit: true` (cargo audit) is replaced by the +# suite's `deny` job (cargo-deny: advisories, bans, sources); the suite's +# `enable_audit` input is a documented no-op. +# +# De-onboarded from actions.lock on purpose, as the suite's caller template +# requires: an onboarded cross-repository reusable startup-fails with zero +# jobs under sha_pinning_required. No `secrets:`: the reusable consumes none. name: Rust CI on: - # push and pull_request runs come from ci.yml (`CI/gate` aggregates them). - workflow_call: - # Weekly, so a new RustSec advisory against an unchanged Cargo.lock is still - # caught (the scheduled cargo-audit.yml was folded into this workflow). schedule: - cron: '0 6 * * 1' permissions: - actions: read contents: read jobs: rust-ci: - uses: metadatastician/standards/.github/workflows/rust-ci-reusable.yml@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12 permissions: - actions: read contents: read - security-events: write - with: - # Replaces the retired cargo-audit.yml (standards CI regularisation spec: - # fold the audit into rust-ci through enable_audit). - enable_audit: true + uses: hyperpolymath/proven-cicd-and-workflows/.github/workflows/rust-ci.yml@9eb0bbf9bd80b7964ce5b9957e75821b3cd4a55b # cicd-suite main diff --git a/crates/januskey-cli/src/obliteration.rs b/crates/januskey-cli/src/obliteration.rs index 73996e0..ab17ece 100644 --- a/crates/januskey-cli/src/obliteration.rs +++ b/crates/januskey-cli/src/obliteration.rs @@ -368,7 +368,7 @@ fn secure_overwrite(path: &Path) -> Result { /// Obliterate an arbitrary file on disk (not necessarily in the content /// store): hash its current content, securely overwrite it with -/// [`OVERWRITE_PASSES`] passes, remove it, and return a proof of erasure. +/// `OVERWRITE_PASSES` (three) passes, remove it, and return a proof of erasure. /// /// This touches only the working file. It is the fallback used by /// `jk obliterate ` when no `.januskey/` store exists; when one does, From 252571f37c9bf99df4f4dfbc979cb13e1d33cf1b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 13:15:12 +0000 Subject: [PATCH 3/6] ci-gate: reject non-object NEEDS_JSON; match every job-id form in drift check An array such as [{"result":"success"}] passed the gate because jq length and to_entries accept arrays. Require a JSON object. The drift check matched only [a-z0-9-] job ids; use GitHub's [A-Za-z_][A-Za-z0-9_-]*, with a mutation case for an underscore job missing from needs. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX --- scripts/ci-gate.sh | 1 + tests/workflows/ci_gate_test.sh | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/ci-gate.sh b/scripts/ci-gate.sh index 2fd26cb..ee7fc23 100755 --- a/scripts/ci-gate.sh +++ b/scripts/ci-gate.sh @@ -18,6 +18,7 @@ set -euo pipefail command -v jq >/dev/null 2>&1 || { echo "ci-gate: jq is required" >&2; exit 2; } [ -n "${NEEDS_JSON:-}" ] || { echo "ci-gate: NEEDS_JSON is not set" >&2; exit 2; } +jq -e 'type == "object"' <<<"$NEEDS_JSON" >/dev/null 2>&1 || { echo "::error::ci-gate: NEEDS_JSON is not a JSON object"; exit 1; } total="$(jq -e 'length' <<<"$NEEDS_JSON")" || { echo "::error::ci-gate: NEEDS_JSON is not a JSON object"; exit 1; } if [ "$total" -eq 0 ]; then echo "::error::CI/gate aggregates no jobs (denominator = 0); refusing to pass." diff --git a/tests/workflows/ci_gate_test.sh b/tests/workflows/ci_gate_test.sh index 8185deb..9e7672f 100755 --- a/tests/workflows/ci_gate_test.sh +++ b/tests/workflows/ci_gate_test.sh @@ -20,11 +20,27 @@ chk "one cancelled fails" 1 '{"a":{"result":"success"},"b":{"result":"cancel chk "one skipped fails" 1 '{"a":{"result":"success"},"b":{"result":"skipped"}}' chk "empty needs fails" 1 '{}' chk "malformed fails" 1 'not json' +chk "array input fails" 1 '[{"result":"success"}]' +chk "string input fails" 1 '"x"' +chk "number input fails" 1 '3' +chk "null input fails" 1 'null' +chk "underscore job passes" 0 '{"integration_tests":{"result":"success"}}' wf=.github/workflows/ci.yml -jobs="$(sed -n '/^jobs:/,$ s/^ \([a-z0-9-]*\):$/\1/p' "$wf" | grep -vx 'gate' | sort | tr '\n' ' ')" -needs="$(sed -n 's/^ needs: \[\(.*\)\]$/\1/p' "$wf" | tr -d ',' | tr ' ' '\n' | sort | tr '\n' ' ')" +# drift WORKFLOW: prints "jobs|needs"; equal and non-empty means no drift. +drift() { + local j n + j="$(sed -n '/^jobs:/,$ s/^ \([A-Za-z_][A-Za-z0-9_-]*\):$/\1/p' "$1" | grep -vx 'gate' | sort | tr '\n' ' ')" + n="$(sed -n 's/^ needs: \[\(.*\)\]$/\1/p' "$1" | tr -d ',' | tr ' ' '\n' | sort | tr '\n' ' ')" + echo "$j|$n" +} +d="$(drift "$wf")"; jobs="${d%%|*}"; needs="${d#*|}" if [ -n "$jobs" ] && [ "$jobs" = "$needs" ]; then echo "ok gate needs every other job ($needs)"; else echo "FAIL needs drift: jobs=[$jobs] needs=[$needs]"; fail=1; fi +# Mutation: an underscore-named job absent from gate.needs must be detected. +mut="$(mktemp)" +sed 's/^ gate:$/ integration_tests:\n runs-on: ubuntu-latest\n gate:/' "$wf" > "$mut" +d="$(drift "$mut")"; rm -f "$mut" +if [ "${d%%|*}" != "${d#*|}" ]; then echo "ok drift check catches an underscore job missing from needs"; else echo "FAIL drift check missed integration_tests"; fail=1; fi grep -q '^ name: CI/gate$' "$wf" && echo "ok job name is exactly CI/gate" || { echo "FAIL job name"; fail=1; } grep -q '^ if: \${{ always() }}$' "$wf" && echo "ok gate runs always()" || { echo "FAIL gate lacks always()"; fail=1; } From 48b3c9a3111dacc433eb53e5cd421674d9b45d7b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 13:53:26 +0000 Subject: [PATCH 4/6] ci: de-onboard the cross-repository reusable callers from actions.lock governance.yml, codeql.yml, hypatia-scan.yml, mirror.yml and scorecard.yml each call a metadatastician/standards reusable workflow at a full SHA. Every run of them has ended startup_failure with zero jobs since #167 re-pinned and onboarded them (2026-11-05). proven-cicd-and-workflows records the cause and its witnessed matrix (main-estate-audit.yml header, README): a thin caller of a cross-repository reusable startup-fails when it is onboarded in actions.lock under sha_pinning_required, and works de-onboarded at a full SHA. Removed with that repository's scripts/deonboard-workflow.sh, the estate's one implementation: pure removals of the five workflows: entries; no dependency record was orphaned. The callers themselves are unchanged. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX --- .github/workflows/actions.lock | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 81f3a21..b085776 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -16,8 +16,6 @@ workflows: - 'haskell-actions/setup@v2.12.1' '.github/workflows/ci.yml': - 'actions/checkout@v7.0.1' - '.github/workflows/codeql.yml': - - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' '.github/workflows/dashboard-check.yml': - 'actions/checkout@v7.0.1' - 'dtolnay/rust-toolchain@v1' @@ -31,18 +29,10 @@ workflows: - 'actions/checkout@v7.0.1' - 'dtolnay/rust-toolchain@v1' - 'swatinem/rust-cache@v2.9.3' - '.github/workflows/governance.yml': - - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' - '.github/workflows/hypatia-scan.yml': - - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' '.github/workflows/idris-abi.yml': - 'actions/checkout@v7.0.1' '.github/workflows/label-triage.yml': [] '.github/workflows/labels.yml': [] - '.github/workflows/mirror.yml': - - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' - '.github/workflows/scorecard.yml': - - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' '.github/workflows/secret-scanner.yml': - 'metadatastician/standards@a797d308c0517d4e2d21cc7f1cb08d41f82b1a12' '.github/workflows/squabble.yml': From 9514441f07efb46641834e6b27d7f6829d11f6d7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 13:58:51 +0000 Subject: [PATCH 5/6] ci: run the gate's regression test in the CI/gate job tests/workflows/ci_gate_test.sh was run by nothing, so a job added to ci.yml without being added to the gate's needs, or a called workflow that regained its own trigger, would have left CI green. The gate job now runs it before it evaluates the needed jobs. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40a1193..c2c574c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,10 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false + # The gate's own regression test: a job missing from `needs:`, or a + # called workflow that regains its own trigger, fails the gate here. + - name: Gate regression test + run: bash tests/workflows/ci_gate_test.sh - name: All required jobs succeeded env: NEEDS_JSON: ${{ toJSON(needs) }} From 995beccfa5c22fe237e048b8700137fe5d230095 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 14:16:34 +0000 Subject: [PATCH 6/6] ci-gate test: detect a job header that carries an inline comment The drift check required a job key's colon to end the line, so a job added as `name: # comment` and left out of the gate's needs was not seen. The pattern now allows trailing whitespace and a comment, with a mutation case for it. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX --- tests/workflows/ci_gate_test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/workflows/ci_gate_test.sh b/tests/workflows/ci_gate_test.sh index 9e7672f..86c025a 100755 --- a/tests/workflows/ci_gate_test.sh +++ b/tests/workflows/ci_gate_test.sh @@ -30,7 +30,7 @@ wf=.github/workflows/ci.yml # drift WORKFLOW: prints "jobs|needs"; equal and non-empty means no drift. drift() { local j n - j="$(sed -n '/^jobs:/,$ s/^ \([A-Za-z_][A-Za-z0-9_-]*\):$/\1/p' "$1" | grep -vx 'gate' | sort | tr '\n' ' ')" + j="$(sed -n '/^jobs:/,$ s/^ \([A-Za-z_][A-Za-z0-9_-]*\):[[:space:]]*\(#.*\)\{0,1\}$/\1/p' "$1" | grep -vx 'gate' | sort | tr '\n' ' ')" n="$(sed -n 's/^ needs: \[\(.*\)\]$/\1/p' "$1" | tr -d ',' | tr ' ' '\n' | sort | tr '\n' ' ')" echo "$j|$n" } @@ -41,6 +41,11 @@ mut="$(mktemp)" sed 's/^ gate:$/ integration_tests:\n runs-on: ubuntu-latest\n gate:/' "$wf" > "$mut" d="$(drift "$mut")"; rm -f "$mut" if [ "${d%%|*}" != "${d#*|}" ]; then echo "ok drift check catches an underscore job missing from needs"; else echo "FAIL drift check missed integration_tests"; fail=1; fi +# Mutation: a job header with an inline comment (valid YAML) must be detected too. +mut="$(mktemp)" +sed 's/^ gate:$/ smoke: # quick suite\n runs-on: ubuntu-latest\n gate:/' "$wf" > "$mut" +d="$(drift "$mut")"; rm -f "$mut" +if [ "${d%%|*}" != "${d#*|}" ]; then echo "ok drift check catches a commented job header missing from needs"; else echo "FAIL drift check missed a commented job header"; fail=1; fi grep -q '^ name: CI/gate$' "$wf" && echo "ok job name is exactly CI/gate" || { echo "FAIL job name"; fail=1; } grep -q '^ if: \${{ always() }}$' "$wf" && echo "ok gate runs always()" || { echo "FAIL gate lacks always()"; fail=1; }