Commit d1b809a
fix(governance): honour .hypatia-ignore / inline pragma in banned-language checks (#120)
## Root cause
The shared `governance-reusable.yml` `Language / package anti-pattern
policy` job enforces the TypeScript ban with a full exemption mechanism,
but the **ReScript / Go / Python** checks were crude `find` one-liners
with **no escape**. They ignored the estate's declared machine-readable
exemption — `.hypatia-ignore` rule `cicd_rules/banned_language_file` and
the inline `# hypatia:ignore … cicd_rules/banned_language_file` pragma —
even though the Hypatia scanner itself honours it.
Per the **Explicit-Escape Principle** (Refs standards#72): re-emergence
of a banned default despite a declared, tool-honoured escape is a
*tooling defect*, not a policy violation.
## Symptom this fixes
`hyperpolymath/hypatia#270` (a 1-line CI pin) and transitively **#271**
are `BLOCKED` because two intentionally-exempted criterion bench scripts
(`scripts/check-bench-regression.py`,
`scripts/update-bench-baselines.py` — carrying the inline pragma, listed
in `.hypatia-ignore`, documented in `.hypatia-exemptions.md`, used by
`tests.yml`) trip this shared gate. The defect is estate-wide; fixing it
here resolves every consumer of the shared bundle.
## Change
Replaces the three crude checks with a single exemption-aware step. A
file is exempt from `cicd_rules/banned_language_file` iff it is listed
in `.hypatia-ignore` for that rule **or** carries the inline pragma in
its first 8 lines.
## Verification (dry-run, `bash -eo pipefail`)
- Only-exempt files present → **PASS** (the #270/#271 case)
- A non-exempt `.py` added → **FAIL** (enforcement preserved)
- Clean repo, zero banned files → **PASS** (no `grep -v`/pipefail
false-fail; the old behaviour was preserved via `|| true`)
Refs standards#72
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9b23627 commit d1b809a
1 file changed
Lines changed: 54 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
138 | 147 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 148 | + | |
146 | 149 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
155 | 160 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
165 | 194 | | |
166 | 195 | | |
167 | 196 | | |
| |||
0 commit comments