Commit 30bb43f
committed
proof(SafeJson): fix appendLengthInc lengthSnoc arg order so the module compiles
Makes this branch type-check under a clean Idris2 0.8.0 + contrib
toolchain. `idris2 --check src/Proven/SafeJson/Proofs.idr` now builds all
five SafeJson modules (Core, Parser, Access, SafeJson, Proofs) with 0
errors (one pre-existing unreachable-clause warning in Access remains).
The two discharges this branch adds (anyMatchesTAny via 6-arm split,
singleKeyPath via with-pattern) are correct, but the module did not
compile because of a pre-existing bug carried in from #127:
appendLengthInc used `lengthSnoc arr v`, but
Data.List.Equalities.lengthSnoc is element-first (`lengthSnoc x xs`).
Under Idris2 0.8.0 contrib this fails to type-check
(Mismatch: JsonValue vs List ?a) and blocks the ENTIRE
SafeJson.Proofs module, so none of its proofs were checkable.
Corrected to `lengthSnoc v arr`.
This is the failure the PR description attributed to "a local contrib
quirk [that] does NOT reproduce in CI". It is not local: it reproduces
on a clean v0.8.0 install, which also means main's own
`idris2 --build proven.ipkg` currently fails at this module.
Also corrects two proof comments to match what the compiler actually
accepts and removes stale /tmp/ scratch-path references:
- singleKeyPath: getPath/getSegment are `covering` (via the
`%default covering` in SafeJson.Access), not total. That annotation
does not block the clause-level reduction the proof relies on, so
they are left covering and the proof still goes through (verified).
- anyMatchesTAny: the six-arm split needs no totality change.
No believe_me / postulate / idris_crash / assert_total introduced.
Refs #127, proven#90 #107 #119.
https://claude.ai/code/session_01MN5vzRR4MK2dkDNaHqqRDy1 parent 007f44c commit 30bb43f
1 file changed
Lines changed: 22 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
208 | | - | |
| 212 | + | |
209 | 213 | | |
210 | 214 | | |
211 | 215 | | |
| |||
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| |||
327 | 330 | | |
328 | 331 | | |
329 | 332 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
| |||
0 commit comments