Commit 4e8a2ec
committed
fix(gate-manifest): prove the forwarded rule is only ever read, not enumerate binders
Addresses both P2s from the re-review at e5331aa, and replaces the approach
that produced them.
The binder list was the wrong shape of proof. It failed open one construct at a
time — a `const` in a nested block, then a catch parameter, then a destructured
binding, and now `class entry {}` — because there is always another declaration
form to miss. Proving provenance only at callback ingress had the same defect
from the other side: `entry = config` keeps the binding and replaces the value.
onlyReadsAsProperty replaces both. Every occurrence of the parameter name inside
the callback must be the object of a member access that is not an assignment
target; the parameter itself is the only other permitted occurrence. That is
total rather than enumerated: a re-declaration of ANY kind, a reassignment, a
mutation of the entry, and passing the binding elsewhere all appear as an
occurrence that is not a read, and each refuses the exemption. It over-refuses
in principle and fails closed, which is the direction a conservative proof
should err in.
shadowsParameter, declaresName and patternNames are deleted — the enumeration
they encoded is what kept springing leaks.
Tests 50 → 54: class-declaration shadow, parameter reassignment, entry mutation
(`entry.rule = computed`), and aliasing (`mutate(entry)`). The live
`BUILD_OWNERSHIP.filter((entry) => entry.owns(file)).map((entry) => …)` still
resolves — `entry.owns` is a read like the rest. Planted red against the live
selector: wrapping its map body in `entry = { ...entry }` now fails with its
line number.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SkS4S8XXrfkJ8TD1VBKkvJ1 parent e5331aa commit 4e8a2ec
2 files changed
Lines changed: 87 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 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 | + | |
180 | 230 | | |
181 | 231 | | |
182 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 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 | 166 | | |
191 | | - | |
| 167 | + | |
| 168 | + | |
192 | 169 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
202 | 177 | | |
203 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
204 | 184 | | |
205 | | - | |
206 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
207 | 201 | | |
208 | | - | |
209 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
210 | 205 | | |
211 | | - | |
| 206 | + | |
212 | 207 | | |
213 | 208 | | |
214 | 209 | | |
| |||
237 | 232 | | |
238 | 233 | | |
239 | 234 | | |
240 | | - | |
241 | | - | |
| 235 | + | |
| 236 | + | |
242 | 237 | | |
243 | 238 | | |
244 | 239 | | |
| |||
0 commit comments