From 5d8749b768b376318c3275461988d399b613cd50 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 26 Aug 2026 22:53:49 +0100 Subject: [PATCH 1/2] fix(check-languages): enforce the current policy, not the one it replaced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check-languages.sh steers developers toward a BANNED language and marks that same language as ALLOWED. :73 TypeScript -> use ReScript ReScript ban is uncontested; :74 TypeScript JSX -> use ReScript destination is AffineScript :83 Python -> use ReScript or Rust :125 'Should use deno.json' Bun is tier 1 for runtime AND :133 'Should use Deno caching' package management :149 [ALLOWED] Found N ReScript files ReScript is BANNED Source: standards/.claude/CLAUDE.md 'ALLOWED Languages & Tools', which states 'RESOLVED 2026-08-25 - this file governs.' Line 149 is the sharpest: a language-policy checker printing [ALLOWED] in green for the one language whose ban the policy calls uncontested. Note this repo is written in Gleam (26 .gleam files), explicitly allowed for backend services - and the checker never mentions Gleam at all, so the language actually in use is invisible to the language checker. DELIBERATELY NOT CHANGED: frontend/deno.json. The governing document lists Deno as tier 2, grandfathered - 'Existing Deno projects need not migrate; prefer over pnpm/npm'. A preference ordering, not a ban. ⚠ I had been asserting 'Deno is banned estate-wide' from a recorded owner ruling of 2026-08-07. That conflicts with the governing document and has been raised for adjudication, not resolved here. Every change in this PR is correct under either reading, concerning only ReScript and Bun-preference. Verified: shellcheck -S error reports 0 findings; 6 replacements, no logic changes. --- scripts/check-languages.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/check-languages.sh b/scripts/check-languages.sh index 540db69..2b3480f 100755 --- a/scripts/check-languages.sh +++ b/scripts/check-languages.sh @@ -70,8 +70,8 @@ echo "Checking for BANNED languages..." echo "" # TypeScript -check_banned "*.ts" "TypeScript" "ReScript" "-not -path './node_modules/*'" -check_banned "*.tsx" "TypeScript JSX" "ReScript" "-not -path './node_modules/*'" +check_banned "*.ts" "TypeScript" "AffineScript" "-not -path './node_modules/*'" +check_banned "*.tsx" "TypeScript JSX" "AffineScript" "-not -path './node_modules/*'" # Go check_banned "*.go" "Go" "Rust" @@ -80,7 +80,7 @@ check_banned "*.go" "Go" "Rust" echo -n "Checking Python files... " py_count=$(find . -name "*.py" -not -path "./salt/*" -type f 2>/dev/null | wc -l) if [ "$py_count" -gt 0 ]; then - echo -e "${RED}[BANNED]${NC} Found $py_count Python files outside salt/. Use ReScript or Rust." + echo -e "${RED}[BANNED]${NC} Found $py_count Python files outside salt/. Use AffineScript or Rust." find . -name "*.py" -not -path "./salt/*" -type f 2>/dev/null | head -5 ERRORS=$((ERRORS + 1)) else @@ -122,7 +122,7 @@ fi # package.json with dependencies if [ -f "package.json" ] && grep -q '"dependencies"' package.json 2>/dev/null; then - echo -e "${YELLOW}[LEGACY]${NC} package.json with dependencies exists. Should use deno.json." + echo -e "${YELLOW}[LEGACY]${NC} package.json with dependencies exists. Bun is the tier-1 runtime and package manager." WARNINGS=$((WARNINGS + 1)) else echo -e "${GREEN}[OK]${NC} No package.json with runtime dependencies." @@ -130,7 +130,7 @@ fi # node_modules if [ -d "node_modules" ]; then - echo -e "${YELLOW}[LEGACY]${NC} node_modules directory exists. Should use Deno caching." + echo -e "${YELLOW}[LEGACY]${NC} node_modules directory exists. Prefer Bun (tier 1) for package management." WARNINGS=$((WARNINGS + 1)) else echo -e "${GREEN}[OK]${NC} No node_modules directory." @@ -146,7 +146,7 @@ echo -e "${GREEN}[ALLOWED]${NC} Found $gleam_count Gleam files." # ReScript res_count=$(find . -name "*.res" -type f 2>/dev/null | wc -l) -echo -e "${GREEN}[ALLOWED]${NC} Found $res_count ReScript files." +echo -e "${RED}[BANNED]${NC} Found $res_count ReScript files. Migrate to AffineScript." # Rust rs_count=$(find . -name "*.rs" -type f 2>/dev/null | wc -l) From 586a13ae1e58b23542360c97ce0a0070512a91f0 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:56:55 +0100 Subject: [PATCH 2/2] fix: the ReScript ban printed [BANNED] but never failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Self-correction, raised independently by coderabbitai and codacy and confirmed against the diff. The previous commit changed the label only: - echo "${GREEN}[ALLOWED]${NC} Found $res_count ReScript files." + echo "${RED}[BANNED]${NC} Found $res_count ReScript files. Migrate to AffineScript." No ERRORS increment was added, so the script announced a banned language and then exited 0 - it reported a violation it did not enforce. Every other BANNED check in this file (Python at line 85, the generic check_banned at line 44) does increment ERRORS; the ReScript branch was the odd one out. It also printed "[BANNED] Found 0 ReScript files" when the repo was clean, because there was no zero-count branch. This repo is Gleam - the count IS zero - so the normal state was a red BANNED line for a language that is not present. FIXED: guard on the count. >0 lists the offenders and increments ERRORS; ==0 reports [OK]. CONTROLS: no .res files -> "[OK] No ReScript files." exit 0 plant probe/Probe.res -> "[BANNED] Found 1 ReScript files." exit 1 ✅ OLD version, same file -> exit 0 ❌ passed bash -n clean; shellcheck -S error clean. --- scripts/check-languages.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100755 => 100644 scripts/check-languages.sh diff --git a/scripts/check-languages.sh b/scripts/check-languages.sh old mode 100755 new mode 100644 index 2b3480f..d12a862 --- a/scripts/check-languages.sh +++ b/scripts/check-languages.sh @@ -146,7 +146,13 @@ echo -e "${GREEN}[ALLOWED]${NC} Found $gleam_count Gleam files." # ReScript res_count=$(find . -name "*.res" -type f 2>/dev/null | wc -l) -echo -e "${RED}[BANNED]${NC} Found $res_count ReScript files. Migrate to AffineScript." +if [ "$res_count" -gt 0 ]; then + echo -e "${RED}[BANNED]${NC} Found $res_count ReScript files. Migrate to AffineScript." + find . -name "*.res" -type f 2>/dev/null | head -5 + ERRORS=$((ERRORS + 1)) +else + echo -e "${GREEN}[OK]${NC} No ReScript files." +fi # Rust rs_count=$(find . -name "*.rs" -type f 2>/dev/null | wc -l)