Commit e2abf3a
proof(SafePassword): DISCHARGE withMinLengthCorrect via nested constructor case-split (proven#90 #107)
The OWED comment for `withMinLengthCorrect` correctly diagnosed the
blocker (record-update through `MkPolicyBuilder` wrapper doesn't
reduce for abstract builder) and suggested case-split. Empirically
verified that a DOUBLE case-split is needed — both the outer
`MkPolicyBuilder` and the inner `MkPolicy` constructor must be
exposed for the projection `({ minLength := n } p).minLength` to
reduce to `n`.
DISCHARGE (one line):
```idris
withMinLengthCorrect n (MkPolicyBuilder (MkPolicy _ _ _ _ _ _ _ _ _ _)) = Refl
```
The 10 underscores correspond to PasswordPolicy's 10 fields
(`minLength`, `maxLength`, `requireUppercase`, `requireLowercase`,
`requireDigit`, `requireSymbol`, `minUniqueChars`,
`maxRepeatedChars`, `forbiddenPatterns`, `forbiddenWords`).
Test harness verified at `/tmp/charrefl/src/TestPolicyBuilder.idr` —
single case-split on `MkPolicyBuilder _` alone is NOT sufficient
because `{minLength := n} p` doesn't reduce through abstract `p`.
Both layers needed.
The sister OWED `chainedBuildersCompose` (line 430) is NOT
discharged in this PR — it requires reducing `Policy.policyBuilder`
(a top-level constant) which still trips the record-projection-
through-top-level-constant blocker we hit in SafeCSV PR #137.
Discharge of that one waits for either an Idris2 0.8.0 fix or a
named-constant-bridge lemma technique.
Zero `believe_me`/`postulate`/`idris_crash`.
Refs proven#90 (Phase 3 OWED triage), proven#107 (overly-cautious
OWED meta).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 40b127f commit e2abf3a
1 file changed
Lines changed: 12 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
414 | 414 | | |
415 | | - | |
416 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| |||
0 commit comments