Commit 0809b8e
authored
[codex] fix TS allowlist path normalization (#395)
## Root cause
The current compiled checker walks files as `./repo-relative/path`,
while exemptions parsed from `.claude/CLAUDE.md` are stored as
`repo-relative/path`. That meant exact-path exemptions such as
`rescript-ecosystem/packages/core/runtime-tools/bin/rrt.ts` did not
match the generated `.deno.js` runtime artifact even though the table
row was parsed.
The prime backtick hypothesis was not the full issue in the current
source: the row parser already extracted code-span contents. The fix
still normalizes parsed exemption cells by trimming and storing
repo-relative paths, and it normalizes candidate paths before exact/glob
matching.
## Fix
- Normalize exemption paths and matched file paths before comparison so
`./path` and `path` compare as the same repo-relative file.
- Keep exact entries exact and glob entries regex-backed; no substring
fallback was added.
- Keep header/separator rows out of the parsed exemption set.
- Treat `.ts.bak` / `.tsx.bak` as blocked TS artifacts so near-miss
exemption paths do not slip through.
- Expand the regression harness to run both
`scripts/check-ts-allowlist.ts` and the compiled
`scripts/check-ts-allowlist.deno.js` artifact.
## Validation
- `scripts/tests/check-ts-allowlist-test.sh` passes: 36 assertions
across both checker targets.
- Focused repro with
`rescript-ecosystem/packages/core/runtime-tools/bin/rrt.ts` and the
approved CLAUDE.md table is clean after the fix.
- `just check-ts-allowlist-drift` is not clean locally because the
current AffineScript compiler also fails to parse the unmodified HEAD
source, and the recipe mishandles its temp variables after that failure.
The committed `.deno.js` artifact was therefore patched and validated
directly.
## Consumer follow-up
New standards commit SHA to pin for this change:
`681373b30b3615460ac3c802d6ba8db893b48d45`.
Consumers that pin
`hyperpolymath/standards/.github/workflows/governance-reusable.yml@<sha>`
need a follow-up pin bump after this lands, including
`developer-ecosystem` and the k9 repos. Note that current `main` has
drifted from `861b5e911d9e5dcfb3c0ab3dd2a9a3c8fd0a1613`; verify the
reusable workflow shape when bumping consumers.1 parent d72fe5a commit 0809b8e
4 files changed
Lines changed: 174 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
119 | | - | |
120 | | - | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | | - | |
| 131 | + | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
| |||
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
147 | | - | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| |||
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
| 171 | + | |
163 | 172 | | |
164 | 173 | | |
165 | 174 | | |
166 | 175 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
174 | 180 | | |
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
179 | 193 | | |
180 | 194 | | |
181 | 195 | | |
| |||
189 | 203 | | |
190 | 204 | | |
191 | 205 | | |
192 | | - | |
| 206 | + | |
193 | 207 | | |
194 | 208 | | |
195 | 209 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
75 | 97 | | |
76 | 98 | | |
77 | 99 | | |
| |||
110 | 132 | | |
111 | 133 | | |
112 | 134 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
117 | 143 | | |
118 | 144 | | |
119 | 145 | | |
| |||
135 | 161 | | |
136 | 162 | | |
137 | 163 | | |
138 | | - | |
| 164 | + | |
139 | 165 | | |
140 | 166 | | |
141 | 167 | | |
| |||
149 | 175 | | |
150 | 176 | | |
151 | 177 | | |
| 178 | + | |
152 | 179 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
158 | 184 | | |
159 | 185 | | |
160 | 186 | | |
161 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
162 | 193 | | |
163 | 194 | | |
164 | 195 | | |
| |||
168 | 199 | | |
169 | 200 | | |
170 | 201 | | |
171 | | - | |
| 202 | + | |
172 | 203 | | |
173 | 204 | | |
174 | 205 | | |
| |||
0 commit comments