Skip to content

Commit 78f1791

Browse files
fix(ci): rsr-antipattern.yml duplicate heredoc (#22)
* fix(ci): rsr-antipattern.yml duplicate heredoc **rsr-antipattern.yml**: deletes the orphan duplicate Python script (lines 274-428) that escapes the heredoc and exits 127. Mirrors hyperpolymath/rsr-template-repo#39. 🤖 Generated with [Claude Code](https://claude.com/claude-code) * fix(ci): repair corrupted rsr-antipattern.yml on this branch Repairs the corrupted `rsr-antipattern.yml` from the prior commit on this branch. See hyperpolymath/stapeln#34 for the full root-cause writeup — the original sweep built its canonical via `gh api --jq '.content'` piped through PowerShell, but `gh` line-wraps base64 in the terminal pipe, so each chunk was decoded separately and the rejoined file has mid-word line breaks (`# SPDX-License-Id\nentifier:`, `name: RSR A\nnti-Pattern`, etc.). GitHub Actions can't parse the resulting YAML — the workflow completes in 0 seconds with no jobs. This commit overwrites the file with the correct content, built via raw byte download (`Accept: application/vnd.github.raw`) and `[System.IO.File]::WriteAllBytes` so no pipe ever touches the bytes. Round-trip byte-verified against canonical.
1 parent 88837c4 commit 78f1791

1 file changed

Lines changed: 8 additions & 80 deletions

File tree

.github/workflows/rsr-antipattern.yml

Lines changed: 8 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# SPDX-License-Identifier: MPL-2.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# RSR Anti-Pattern CI Check
3+
# SPDX-License-Identifier: PMPL-1.0-or-later
34
#
45
# Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm
56
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
@@ -12,13 +13,17 @@ on:
1213
pull_request:
1314
branches: [main, master, develop]
1415

15-
permissions: read-all
16+
17+
permissions:
18+
contents: read
1619

1720
jobs:
1821
antipattern-check:
1922
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
2025
steps:
21-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2227

2328
- name: Check for TypeScript
2429
run: |
@@ -133,83 +138,6 @@ jobs:
133138
print(f"✅ No TypeScript files outside allowlist ({len(exemption_patterns)} per-repo exemption(s) parsed).")
134139
PYEOF
135140
136-
# Universal builtin allowlist — bridges that need no per-repo declaration.
137-
# Files matching any of these patterns are always allowed.
138-
BUILTIN_GLOBS = [
139-
'*.d.ts',
140-
'**/bindings/**',
141-
'**/tests/**', '**/test/**',
142-
'**/scripts/**',
143-
'**/mcp-adapter/**',
144-
'**/*vscode*/**',
145-
'**/cli/**',
146-
'**/mod.ts',
147-
'**/lsp-server.ts', '**/lsp_server.ts', '**/lsp.ts', '**/*-lsp.ts',
148-
'**/deno-*/**',
149-
'**/node_modules/**',
150-
'**/vendor/**',
151-
'**/examples/**',
152-
'**/ffi/**',
153-
]
154-
155-
# Per-repo exemptions parsed from .claude/CLAUDE.md "TypeScript Exemptions" table.
156-
# Single source of truth — adding a row here unblocks CI for that path.
157-
# Format expected:
158-
# ### TypeScript Exemptions ...
159-
# | Path | Files | Rationale | Unblock condition |
160-
# |---|---|---|---|
161-
# | `path/to/file.ts` | 1 | ... | ... |
162-
# | `dir/*.ts` | 6 | ... | ... |
163-
exemptions = []
164-
claude_md = pathlib.Path('.claude/CLAUDE.md')
165-
if claude_md.exists():
166-
in_table = False
167-
for line in claude_md.read_text(encoding='utf-8').splitlines():
168-
if re.search(r'TypeScript [Ee]xemptions', line):
169-
in_table = True
170-
continue
171-
if in_table and line.startswith(('### ', '## ', '# ')):
172-
break
173-
if in_table and line.startswith('|'):
174-
m = re.match(r'\|\s*`([^`]+)`', line)
175-
if m:
176-
exemptions.append(m.group(1))
177-
178-
# Find all .ts and .tsx files
179-
found = []
180-
for ext in ('ts', 'tsx'):
181-
found.extend(str(p) for p in pathlib.Path('.').rglob(f'*.{ext}'))
182-
183-
def allowed(path):
184-
p = path.lstrip('./')
185-
for g in BUILTIN_GLOBS + exemptions:
186-
if fnmatch.fnmatchcase(p, g):
187-
return True
188-
# also treat glob ending with / as a directory prefix
189-
base = g.rstrip('/').rstrip('*').rstrip('/')
190-
if base and (p == base or p.startswith(base + '/')):
191-
return True
192-
return False
193-
194-
bad = sorted(f for f in found if not allowed(f))
195-
if bad:
196-
print("❌ TypeScript files detected outside the allowlist.\n")
197-
for f in bad:
198-
print(f" {f}")
199-
print()
200-
print("To resolve, either:")
201-
print(" (a) migrate the file to AffineScript")
202-
print(" (see Human_Programming_Guide.adoc migration chapter), OR")
203-
print(" (b) move it to an allowlisted bridge path")
204-
print(" (bindings/, tests/, scripts/, mcp-adapter/, *vscode*/, cli/, deno-*/, etc.), OR")
205-
print(" (c) add an entry to the 'TypeScript Exemptions' table in .claude/CLAUDE.md")
206-
print(" with rationale + unblock condition.")
207-
if exemptions:
208-
print(f"\n(Currently {len(exemptions)} exemption(s) parsed from .claude/CLAUDE.md.)")
209-
sys.exit(1)
210-
print(f"✅ No TypeScript files outside allowlist ({len(exemptions)} per-repo exemption(s) parsed).")
211-
PYEOF
212-
213141
- name: Check for Go
214142
run: |
215143
if find . -name "*.go" | grep -q .; then

0 commit comments

Comments
 (0)