Commit 4285741
## Summary
Owner picked #185's two-layer approach 2026-05-27. Both #183 and #185
were already closed since they targeted the eradicated Python heredoc.
This is the canonical port into the live Deno detector
(`scripts/check-ts-allowlist.ts`).
## Two changes
**1. Heading-regex relaxation in `loadExemptionsFromClaudeMd`**
Was: `/TypeScript [Ee]xemptions/` (literal).
Now:
`^#{1,4}\s+.*(?:TypeScript|JavaScript|TS|JS|\.tsx?)\b[^#\n]*[Ee]xemption`
Anchored to markdown heading prefix; matches every variant the estate
uses (`### TypeScript Exemptions`, `### TypeScript / JavaScript
Exemptions (Approved)`, `### TypeScript Exemption`, `### .ts Exemptions
...`). Multi-section: every heading scanned, supports multiple exemption
tables in one CLAUDE.md.
**2. New Layer 4c: `.governance-allowlist`**
Optional plain-text allowlist at the repo root. One glob per line,
`#`-comments supported. Decoupled from CLAUDE.md heading text →
gate-pass survives doc reformatting. Both sources merge additively.
## Files
- `scripts/check-ts-allowlist.ts` — `loadExemptionsFromClaudeMd`
(relaxed regex + multi-table) + new `loadExemptionsFromAllowlistFile` +
merged `loadExemptions`. Error message lists both options.
- `docs/EXEMPTION-MECHANISMS.adoc` — new "Layer 4: Governance
language-policy TS-allowlist" section with 4a/4b/4c breakdown,
pick-between guide, and historical context.
## Closes
Closes #183 (heading regex fix — chosen
approach).
Closes #185 (Layer 2.5 allowlist file — chosen
approach).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 372df41 commit 4285741
2 files changed
Lines changed: 167 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 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 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
131 | 234 | | |
132 | 235 | | |
133 | 236 | | |
134 | 237 | | |
| 238 | + | |
135 | 239 | | |
136 | 240 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
76 | 91 | | |
77 | 92 | | |
78 | 93 | | |
79 | 94 | | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
83 | 101 | | |
84 | | - | |
85 | 102 | | |
86 | | - | |
87 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
88 | 113 | | |
89 | 114 | | |
90 | 115 | | |
| |||
95 | 120 | | |
96 | 121 | | |
97 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
98 | 151 | | |
99 | 152 | | |
100 | 153 | | |
| |||
138 | 191 | | |
139 | 192 | | |
140 | 193 | | |
141 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
142 | 198 | | |
143 | | - | |
| 199 | + | |
144 | 200 | | |
145 | 201 | | |
146 | 202 | | |
147 | | - | |
| 203 | + | |
148 | 204 | | |
149 | 205 | | |
150 | 206 | | |
| |||
0 commit comments