Skip to content

Commit 4e7ecaf

Browse files
fix(ci): Bun-first runtime policy; retire two gates that enforced the opposite (#298)
Authority: `standards/LANGUAGE-POLICY.adoc` §1 — **Bun > Deno > pnpm > npm**. **Replaced `npm-bun-blocker.yml` → `runtime-policy.yml`.** The old gate failed any build carrying `bun.lockb` with *"Use Deno instead"* — blocking the new first choice and mandating the second. It was in **55 repos**, and **zero repos had adopted Bun**, because doing so would have turned them red. The replacement fails on something real — **mixed toolchains** (two package managers' lockfiles, i.e. two dependency graphs that can disagree) — and reports the tier in use otherwise. npm is tier 4 but permitted, so it warns rather than blocks. **Red-teamed both ways:** none/bun/deno/npm alone → exit 0; bun+npm and deno+pnpm → exit 1. **Deleted `ts-blocker.yml`.** It enforced *"use ReScript instead"* — ReScript is itself retired — and it **could not fail**: `git diff HEAD~1` on a depth-1 checkout, error to `/dev/null`, `|| true`. **20/20 runs green, never once fired.** Neither is a required status check anywhere, so this creates no phantom context. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent b5c8701 commit 4e7ecaf

3 files changed

Lines changed: 71 additions & 67 deletions

File tree

.github/workflows/npm-bun-blocker.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Runtime and package-manager policy check.
3+
#
4+
# Authority: hyperpolymath/standards LANGUAGE-POLICY.adoc §1.
5+
# Ordering: Bun (1st) > Deno (2nd) > pnpm (3rd) > npm (last resort).
6+
#
7+
# REPLACES npm-bun-blocker.yml, which failed any build carrying `bun.lockb` with
8+
# the message "npm/bun artifacts detected. Use Deno instead." That gate blocked
9+
# what is now the FIRST-choice runtime and mandated the second. It was present in
10+
# 55 repositories.
11+
#
12+
# What this fails on, deliberately:
13+
# MIXED TOOLCHAINS -- two different package managers' lockfiles in one repo.
14+
# That is real, actionable drift: two dependency graphs that can disagree.
15+
# What it does NOT fail on:
16+
# Using bun, deno, pnpm or npm. npm is LAST but PERMITTED; the check reports
17+
# the tier in use so drift is visible without blocking legitimate work.
18+
name: Runtime Policy
19+
on:
20+
push:
21+
branches: [main, master]
22+
pull_request:
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
runtime-policy:
33+
name: Runtime Policy
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 10
36+
permissions:
37+
contents: read
38+
steps:
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40+
41+
- name: Report runtime tier and reject mixed toolchains
42+
run: |
43+
set -euo pipefail
44+
45+
bun=0; deno=0; pnpm=0; npm=0
46+
[ -f bun.lockb ] || [ -f bun.lock ] && bun=1 || true
47+
[ -f deno.lock ] || [ -f deno.json ] || [ -f deno.jsonc ] && deno=1 || true
48+
[ -f pnpm-lock.yaml ] && pnpm=1 || true
49+
[ -f package-lock.json ] && npm=1 || true
50+
51+
total=$((bun + deno + pnpm + npm))
52+
53+
if [ "$total" -eq 0 ]; then
54+
echo "::notice::No JS/TS package manager in use — nothing to check."
55+
exit 0
56+
fi
57+
58+
# Report the tier actually in use (LANGUAGE-POLICY.adoc §1).
59+
[ "$bun" -eq 1 ] && echo "Bun — tier 1 (preferred)"
60+
[ "$deno" -eq 1 ] && echo "Deno — tier 2 (accepted; existing projects are grandfathered)"
61+
[ "$pnpm" -eq 1 ] && echo "pnpm — tier 3"
62+
[ "$npm" -eq 1 ] && echo "::warning::npm lockfile present. npm is tier 4, the last resort — permitted, never preferred. See LANGUAGE-POLICY.adoc §1."
63+
64+
if [ "$total" -gt 1 ]; then
65+
echo "::error::Mixed toolchains: $total package managers have lockfiles in this repository."
66+
echo "Two dependency graphs that can disagree is real drift. Pick one — preferring the"
67+
echo "highest tier present — and delete the others' lockfiles."
68+
exit 1
69+
fi
70+
71+
echo "✅ Single package manager in use."

.github/workflows/ts-blocker.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)