@@ -137,83 +137,6 @@ jobs:
137137 print(f"✅ No TypeScript files outside allowlist ({len(exemption_patterns)} per-repo exemption(s) parsed).")
138138 PYEOF
139139
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-
217140 - name : Check for Go
218141 run : |
219142 if find . -name "*.go" | grep -q .; then
0 commit comments