Skip to content

fix(ci): remove duplicate Python block dangling outside heredoc#13

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/ci-antipattern-heredoc-bug
May 11, 2026
Merged

fix(ci): remove duplicate Python block dangling outside heredoc#13
hyperpolymath merged 1 commit into
mainfrom
fix/ci-antipattern-heredoc-bug

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

The RSR Anti-Pattern Check workflow has been red on every commit to main since the check was first added (5+ runs visible in the workflow history, last green: none). Root cause: the "Check for TypeScript" step has two PYEOF tokens but only one opening python3 << 'PYEOF', so the second Python block dangles as bash commands. Bash interprets BUILTIN_GLOBS = [...] etc. as commands and exits 127.

The first Python block already does the full TypeScript exemption check (universal allowlist + parsed .claude/CLAUDE.md exemption table). The duplicated second block is redundant — removing it makes the workflow actually run to completion.

Verification

Confirmed by comparing to affinescript's equivalent workflow (which has only 2 PYEOF tokens — one opener, one closer — and consistently passes).

Why now

Discovered while merging affinescript#64-related port work. Pre-existing — unrelated to that port — but kept the merge in a BLOCKED state until force-merged with --admin. Fixing now so future port PRs don't have the same friction.

Test plan

  • CI on this PR runs the workflow to completion (whether it ultimately passes depends on whether any actual TS files violate the allowlist — but it should at least exit non-127).

🤖 Generated with Claude Code

The rsr-antipattern workflow had two PYEOF tokens in succession but
only one opening python3 heredoc, leaving the second block (lines
140-215) as bash commands. Bash saw  as a
command and exited 127, failing every CI run on main since the
check was added.

The first Python block already does the full TypeScript exemption
check (honouring the universal allowlist + .claude/CLAUDE.md table),
so the duplicated second block is just removed. No behaviour change
beyond the workflow actually running to completion.
@hyperpolymath hyperpolymath merged commit e8fa457 into main May 11, 2026
17 of 18 checks passed
hyperpolymath added a commit to hyperpolymath/standards that referenced this pull request May 11, 2026
## Summary

Two related CI fixes — both unblocking workflows that have been red on
`main` for weeks.

### 1. `.github/workflows/rsr-antipattern.yml` — heredoc syntax bug

The "Check for TypeScript" step had two `PYEOF` tokens in succession but
only one opening `python3 << 'PYEOF'`, leaving the second Python block
dangling as bash commands. Bash saw `BUILTIN_GLOBS = [...]` as a command
and exited 127. Every commit to `main` since the check was added has hit
this. Same bug was in `hyperpolymath/my-lang` (see
[hyperpolymath/my-lang#13](hyperpolymath/my-lang#13)).

The first Python block already does the full TypeScript exemption check
honouring the universal allowlist and the parsed `.claude/CLAUDE.md`
table. The duplicated second block is removed.

### 2. `.github/workflows/language-policy.yml` — duplicate TS check with
no allowlist

The "Check for TypeScript files" step did a blunt `find . -name "*.ts"`
filter with no allowlist beyond `node_modules` and `*.d.ts`.
False-positived on legitimate bridge files like
`lol/test/vitest.config.ts`, which lives under the `**/test/**`
universal-allowlist pattern that `rsr-antipattern.yml` honours.

Two checks for the same banned-language family is also a
single-source-of-truth violation. This PR removes the duplicate from
`language-policy.yml`; `rsr-antipattern.yml` remains the canonical
TypeScript-detection check. All other `language-policy.yml` steps
(ReScript, Go, Python, V-lang, ATS2, Java/Kotlin, Swift, Flutter/Dart,
Makefiles, package.json runtime deps) stay — they remain the single
source of truth for those languages.

## What this PR fixes vs. what stays red

**Fixed by this PR:**

- `antipattern-check` no longer exits 127 on the heredoc syntax bug. It
now runs to completion.
- `Check for Banned Languages / Check for TypeScript files` no longer
false-positives on `lol/test/vitest.config.ts`.

**Surfaces real pre-existing migration debt (out of scope for this
PR):**

- `antipattern-check / Check for ReScript` flags ~30 real `.res` files
under
`rhodium-standard-repositories/satellites/{consent-aware-http,cccp/.../7-tentacles}/`.
These were previously hidden behind the heredoc crash — the check never
reached this step before. The fix here unblocks the workflow's ability
to surface them; the actual migration is its own multi-PR effort.
- `Check for Banned Languages / Check for ReScript files` (in
`language-policy.yml`) also flags the same `.res` files. Same
observation.
- `Hypatia Neurosymbolic Analysis (Dogfooding)` — `hypatia-cli.sh scan
.` exits 1 with no diagnostic across multiple repos. Filed at
[hyperpolymath/hypatia#213](hyperpolymath/hypatia#213).

So this PR doesn't turn the standards CI fully green — that would need
the ReScript migration and the Hypatia scanner fix. But it does:

1. Unblock the antipattern check's *ability to run*.
2. Eliminate a false-positive that was masking real signal.
3. Halve the spurious red-X load on every PR.

## Why now

Both bugs surfaced while merging the affinescript#64 port work in #46.
Pre-existing — unrelated to that port — but kept its merge state at
`BLOCKED` until force-merged with `--admin`. Fixing now so future port
PRs have less friction.

## Test plan

- [x] CI on this PR shows `antipattern-check` running to completion (not
exit 127).
- [x] `Check for Banned Languages / Check for TypeScript files` step
passes (no spurious vitest.config.ts hit).
- [ ] Verified by sight: the only remaining failures on this PR are
pre-existing — ReScript migration debt and the Hypatia scanner bug — not
introduced or worsened here.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant