Skip to content

Commit da929da

Browse files
proof(SafeGit): DISCHARGE refNameExtracts via Refl (proven#90, #107) (#111)
Per [proven#107](#107) "overly cautious OWED" pattern. \`\`\`idris public export refNameExtracts : (s : String) -> {auto v : isValidRefName s = True} -> refName (MkGitRef s) = s refNameExtracts _ = Refl \`\`\` \`refName\` is a direct pattern match \`refName (MkGitRef name) = name\` (SafeGit.idr L62-63), so the body reduces by \`Refl\` regardless of \`s\`. The auto-implicit \`v : isValidRefName s = True\` is irrelevant to the proof — it's an API precondition on \`s\` that doesn't enter the reduction. The OWED's "auto-implicit elaboration" blocker doesn't apply here because the auto-implicit is just discarded. Refs #90 #107 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 22519e5 commit da929da

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/Proven/SafeGit/Proofs.idr

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ forbiddenRefCharsAnchor = Refl
3131
public export
3232
0 emptyRefNameInvalid : isValidRefName "" = False
3333

34-
||| OWED: `refName (MkGitRef "main") = "main"` (record extraction
35-
||| pass-through). Blocked on auto-implicit elaboration.
34+
||| DISCHARGED: `refName (MkGitRef s) = s` (record extraction
35+
||| pass-through). `refName` is a direct pattern match
36+
||| `refName (MkGitRef name) = name` (SafeGit.idr L62-63), so the
37+
||| body reduces by Refl regardless of `s`. The auto-implicit
38+
||| `v : isValidRefName s = True` is irrelevant to the proof — it's
39+
||| an API precondition on `s` that doesn't enter the reduction.
3640
public export
37-
0 refNameExtracts : (s : String) -> {auto v : isValidRefName s = True}
38-
-> refName (MkGitRef s) = s
41+
refNameExtracts : (s : String) -> {auto v : isValidRefName s = True}
42+
-> refName (MkGitRef s) = s
43+
refNameExtracts _ = Refl

0 commit comments

Comments
 (0)