Skip to content

Commit f18bd4c

Browse files
fix(ci): rsr-antipattern.yml duplicate heredoc (#15)
* 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 311f42b commit f18bd4c

1 file changed

Lines changed: 3 additions & 79 deletions

File tree

.github/workflows/rsr-antipattern.yml

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# RSR Anti-Pattern CI Check
3-
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
# SPDX-License-Identifier: PMPL-1.0-or-later
44
#
55
# Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm
66
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
@@ -14,7 +14,8 @@ on:
1414
branches: [main, master, develop]
1515

1616

17-
permissions: read-all
17+
permissions:
18+
contents: read
1819

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

0 commit comments

Comments
 (0)