Skip to content

Commit 8117d76

Browse files
ci: redistribute concurrency-cancel guard to read-only check workflows (#16)
Redistributes the canonical read-only-check workflow templates that gained `concurrency{cancel-in-progress:true}` in hyperpolymath/standards#122, so this consumer stops holding account-wide concurrent-job slots on superseded runs. Files updated: codeql.yml governance.yml language-policy.yml scorecard-enforcer.yml scorecard.yml secret-scanner.yml. Read-only checks only; no publish/mutation workflow touched. Refs hyperpolymath/standards#122 Generated with Claude Code
1 parent 29c4e43 commit 8117d76

5 files changed

Lines changed: 202 additions & 63 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0
22
name: CodeQL Security Analysis
33

44
on:
@@ -30,20 +30,20 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
include:
33-
- language: java-kotlin
34-
build-mode: autobuild
33+
- language: javascript-typescript
34+
build-mode: none
3535

3636
steps:
3737
- name: Checkout
38-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3939

4040
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
41+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
4242
with:
4343
languages: ${{ matrix.language }}
4444
build-mode: ${{ matrix.build-mode }}
4545

4646
- name: Perform CodeQL Analysis
47-
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
47+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
4848
with:
4949
category: "/language:${{ matrix.language }}"
Lines changed: 172 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0
2+
name: Language Policy Enforcement
3+
4+
on:
5+
push:
6+
branches: [main, master]
7+
pull_request:
8+
branches: [main, master]
9+
210
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
311
# updates do not pile up queued runs against the shared account-wide
412
# Actions concurrency pool. Applied only to read-only check workflows
@@ -10,47 +18,172 @@ concurrency:
1018
permissions:
1119
contents: read
1220

13-
name: Language Policy Enforcement
14-
on: [push, pull_request]
1521
jobs:
16-
check:
22+
check-banned-languages:
23+
name: Check for Banned Languages
1724
runs-on: ubuntu-latest
1825
steps:
19-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
20-
- name: Enforce language policies
21-
run: |
22-
# Block new Python files (except SaltStack)
23-
NEW_PY=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.py$' | grep -v 'salt' || true)
24-
if [ -n "$NEW_PY" ]; then
25-
echo "❌ New Python files detected. Use Rust or AffineScript instead."
26-
echo "$NEW_PY"
27-
exit 1
28-
fi
29-
30-
# Block new Ruby files
31-
NEW_RB=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.rb$' || true)
32-
if [ -n "$NEW_RB" ]; then
33-
echo "❌ New Ruby files detected. Use Rust, Ada/SPARK, or Crystal instead."
34-
echo "$NEW_RB"
35-
exit 1
36-
fi
37-
38-
# Block new Perl files
39-
NEW_PL=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(pl|pm)$' || true)
40-
if [ -n "$NEW_PL" ]; then
41-
echo "❌ New Perl files detected. Use Rust instead."
42-
echo "$NEW_PL"
43-
exit 1
44-
fi
45-
46-
# Block new Java/Kotlin (except in LSP projects)
47-
if [[ ! "$GITHUB_REPOSITORY" =~ "language-server" ]]; then
48-
NEW_JAVA=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(java|kt)$' || true)
49-
if [ -n "$NEW_JAVA" ]; then
50-
echo "❌ New Java/Kotlin files detected. Use Rust instead."
51-
echo "$NEW_JAVA"
26+
- name: Checkout
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
28+
29+
# TypeScript check delegated to rsr-antipattern.yml (which honours the
30+
# universal allowlist and the .claude/CLAUDE.md exemptions table). The
31+
# blunt `find -name "*.ts"` form previously here false-positived on
32+
# legitimate bridge files (e.g. tests/*.vitest.config.ts under the
33+
# *vscode*/tests/ allowlist).
34+
35+
- name: Check for ReScript files
36+
run: |
37+
# Estate policy: RS/TS/JS -> AffineScript -> typed-wasm.
38+
# ReScript (.res) is no longer the TS replacement.
39+
if find . -name "*.res" | grep -v node_modules | head -1 | grep -q .; then
40+
echo "::error::ReScript files found. Use AffineScript instead."
41+
find . -name "*.res" | grep -v node_modules
42+
exit 1
43+
fi
44+
echo "✓ No ReScript files found"
45+
46+
- name: Check for Go files
47+
run: |
48+
if find . -name "*.go" | head -1 | grep -q .; then
49+
echo "::error::Go files found. Use Rust instead."
50+
find . -name "*.go"
51+
exit 1
52+
fi
53+
echo "✓ No Go files found"
54+
55+
- name: Check for Python files (except Ansible)
56+
run: |
57+
# Allow Python only in ansible/ directories or for Ansible-specific files
58+
PYTHON_FILES=$(find . -name "*.py" | grep -v __pycache__ | grep -v ".venv" | grep -v "ansible" | grep -v "molecule" || true)
59+
if [ -n "$PYTHON_FILES" ]; then
60+
echo "::error::Python files found outside Ansible context. Rewrite in Rust/AffineScript."
61+
echo "$PYTHON_FILES"
62+
exit 1
63+
fi
64+
echo "✓ No unauthorized Python files found"
65+
66+
- name: Check for Makefiles
67+
run: |
68+
MAKEFILES=$(find . -name "Makefile" -o -name "Makefile.*" -o -name "*.mk" | grep -v ".github" || true)
69+
if [ -n "$MAKEFILES" ]; then
70+
echo "::error::Makefiles found. Use Mustfile/justfile instead."
71+
echo "$MAKEFILES"
72+
exit 1
73+
fi
74+
echo "✓ No Makefiles found"
75+
76+
- name: Check for package.json (npm/node)
77+
run: |
78+
if [ -f "package.json" ]; then
79+
# Allow if it only contains devDependencies for tooling
80+
if grep -q '"dependencies"' package.json; then
81+
echo "::error::package.json with runtime dependencies found. Use deno.json instead."
5282
exit 1
5383
fi
5484
fi
55-
56-
echo "✅ Language policy check passed"
85+
echo "✓ No npm runtime dependencies found"
86+
87+
- name: Check for Java/Kotlin files
88+
run: |
89+
if find . -name "*.java" -o -name "*.kt" -o -name "*.kts" | head -1 | grep -q .; then
90+
echo "::error::Java/Kotlin files found. Use Rust/Tauri/Dioxus instead."
91+
find . -name "*.java" -o -name "*.kt" -o -name "*.kts"
92+
exit 1
93+
fi
94+
echo "✓ No Java/Kotlin files found"
95+
96+
- name: Check for Swift files
97+
run: |
98+
if find . -name "*.swift" | head -1 | grep -q .; then
99+
echo "::error::Swift files found. Use Tauri/Dioxus instead."
100+
find . -name "*.swift"
101+
exit 1
102+
fi
103+
echo "✓ No Swift files found"
104+
105+
- name: Check for V-lang code
106+
run: |
107+
# V-lang is banned as of 2026-04-10. Migration target: Zig.
108+
# We detect by v.mod (V-lang's module manifest) rather than *.v
109+
# extension because .v collides with Verilog hardware sources.
110+
V_MOD_FILES=$(find . -name "v.mod" -not -path "*/node_modules/*" -not -path "*/.git/*" || true)
111+
if [ -n "$V_MOD_FILES" ]; then
112+
echo "::error::V-lang code found (detected via v.mod). V-lang is banned since 2026-04-10. Migrate to Zig."
113+
echo "$V_MOD_FILES"
114+
exit 1
115+
fi
116+
# Also check for vpkg.json (alternative V package manifest)
117+
VPKG_FILES=$(find . -name "vpkg.json" -not -path "*/node_modules/*" -not -path "*/.git/*" || true)
118+
if [ -n "$VPKG_FILES" ]; then
119+
echo "::error::V-lang code found (detected via vpkg.json). V-lang is banned since 2026-04-10. Migrate to Zig."
120+
echo "$VPKG_FILES"
121+
exit 1
122+
fi
123+
echo "✓ No V-lang code found"
124+
125+
- name: Check for Flutter/Dart files
126+
run: |
127+
if find . -name "*.dart" -o -name "pubspec.yaml" | head -1 | grep -q .; then
128+
echo "::error::Flutter/Dart code found. Use Tauri/Dioxus instead (Google lock-in policy)."
129+
find . -name "*.dart" -o -name "pubspec.yaml"
130+
exit 1
131+
fi
132+
echo "✓ No Flutter/Dart code found"
133+
134+
- name: Check for ATS2 files
135+
run: |
136+
# ATS2 is rejected in favour of Idris2 (formal verification) and
137+
# Rust/SPARK (safety-critical operational code). See LANGUAGE-POLICY.adoc §Amendments v1.1.0.
138+
if find . -name "*.dats" -o -name "*.sats" -o -name "*.hats" | head -1 | grep -q .; then
139+
echo "::error::ATS2 files found. Use Idris2 (formal verification) or Rust/SPARK (safety-critical code) instead."
140+
find . -name "*.dats" -o -name "*.sats" -o -name "*.hats"
141+
exit 1
142+
fi
143+
echo "✓ No ATS2 files found"
144+
145+
check-required-files:
146+
name: Check Required Files
147+
runs-on: ubuntu-latest
148+
steps:
149+
- name: Checkout
150+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
151+
152+
- name: Check for .machine_readable directory
153+
run: |
154+
if [ ! -d ".machine_readable" ]; then
155+
echo "::warning::.machine_readable/ directory not found"
156+
else
157+
echo "✓ .machine_readable/ directory exists"
158+
# Per estate policy: .a2ml is canonical; .scm is reserved for Guix.
159+
for a2ml in STATE META ECOSYSTEM AGENTIC NEUROSYM PLAYBOOK; do
160+
if [ ! -f ".machine_readable/6a2/${a2ml}.a2ml" ] && [ ! -f ".machine_readable/${a2ml}.a2ml" ]; then
161+
echo "::warning::Missing .machine_readable/6a2/${a2ml}.a2ml (or top-level fallback)"
162+
else
163+
echo "✓ ${a2ml}.a2ml present"
164+
fi
165+
done
166+
fi
167+
168+
- name: Check for Mustfile/justfile
169+
run: |
170+
if [ ! -f "Mustfile" ] && [ ! -f "justfile" ]; then
171+
echo "::warning::Neither Mustfile nor justfile found"
172+
else
173+
echo "✓ Build system files present"
174+
fi
175+
176+
- name: Check SPDX headers
177+
run: |
178+
MISSING_SPDX=0
179+
for ext in rs affine js jsx mjs ts tsx py go java kt swift sh bash; do
180+
while IFS= read -r file; do
181+
if [ -n "$file" ] && ! head -5 "$file" | grep -q "SPDX-License-Identifier"; then
182+
echo "::warning::Missing SPDX header: $file"
183+
MISSING_SPDX=$((MISSING_SPDX + 1))
184+
fi
185+
done < <(find . -name "*.$ext" -type f 2>/dev/null | grep -v node_modules | grep -v .git | head -50)
186+
done
187+
if [ $MISSING_SPDX -gt 0 ]; then
188+
echo "::warning::$MISSING_SPDX files missing SPDX headers"
189+
fi

.github/workflows/scorecard-enforcer.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ jobs:
2727
security-events: write
2828
id-token: write # For OIDC
2929
steps:
30-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3131
with:
3232
persist-credentials: false
3333

3434
- name: Run Scorecard
35-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
35+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
3636
with:
3737
results_file: results.sarif
3838
results_format: sarif
3939
publish_results: true
4040

4141
- name: Upload SARIF
42-
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3
42+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4
4343
with:
4444
sarif_file: results.sarif
4545

@@ -62,7 +62,7 @@ jobs:
6262
check-critical:
6363
runs-on: ubuntu-latest
6464
steps:
65-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
65+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6666

6767
- name: Check SECURITY.md exists
6868
run: |

.github/workflows/scorecard.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0
22
name: OSSF Scorecard
33
on:
44
push:
55
branches: [main, master]
66
schedule:
7-
- cron: '0 4 * * 0'
7+
- cron: '0 4 * * *'
8+
workflow_dispatch:
89

910
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1011
# updates do not pile up queued runs against the shared account-wide
@@ -24,17 +25,17 @@ jobs:
2425
security-events: write
2526
id-token: write
2627
steps:
27-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2829
with:
2930
persist-credentials: false
30-
31+
3132
- name: Run Scorecard
32-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
33+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.3.1
3334
with:
3435
results_file: results.sarif
3536
results_format: sarif
36-
37+
3738
- name: Upload results
38-
uses: github/codeql-action/upload-sarif@b2f9ef845756500b97acbdaf5c1dd4e9c1d15734 # v3
39+
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3.31.8
3940
with:
4041
sarif_file: results.sarif

.github/workflows/secret-scanner.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: PMPL-1.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0
22
# Prevention workflow - scans for hardcoded secrets before they reach main
33
name: Secret Scanner
44

@@ -22,19 +22,21 @@ jobs:
2222
trufflehog:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
2626
with:
2727
fetch-depth: 0 # Full history for scanning
2828

2929
- name: TruffleHog Secret Scan
30-
uses: trufflesecurity/trufflehog@8a8ef8526528d8a4ff3e2c90be08e25ef8efbd9b # v3
30+
uses: trufflesecurity/trufflehog@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
3131
with:
32-
extra_args: --only-verified --fail
32+
# The v3 action injects --fail automatically on pull_request events.
33+
# Passing --fail here triggers "flag 'fail' cannot be repeated".
34+
extra_args: --only-verified
3335

3436
gitleaks:
3537
runs-on: ubuntu-latest
3638
steps:
37-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
3840
with:
3941
fetch-depth: 0
4042

@@ -46,12 +48,15 @@ jobs:
4648
# Rust-specific: Check for hardcoded crypto values
4749
rust-secrets:
4850
runs-on: ubuntu-latest
49-
if: hashFiles('**/Cargo.toml') != ''
5051
steps:
51-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
5253

5354
- name: Check for hardcoded secrets in Rust
5455
run: |
56+
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
57+
echo 'No Cargo.toml found — skipping Rust secrets check'
58+
exit 0
59+
fi
5560
# Patterns that suggest hardcoded secrets
5661
PATTERNS=(
5762
'const.*SECRET.*=.*"'

0 commit comments

Comments
 (0)