proof(SafeYAML): DISCHARGE isScalarCorrect via 9-arm case-split (proven#90, #107) - #112
Merged
Merged
Conversation
`isScalar = True` on 7 scalar constructors (YNull, YBool, YInt, YFloat, YString, YBinary, YTimestamp). For those, the goal `not (isCollection val) = True` reduces (via `isCollection = not . isScalar`) to `not (not True) = True` = `Refl`. For the 2 collection constructors (YArray, YObject), `isScalar = False` so the premise `isScalar val = True` is uninhabited (`False = True`), discharged with `impossible`. The OWED comment correctly hinted at the 9-arm case-split discharge — just hadn't been executed. (This is a slightly different shape from the prior "overly cautious OWED" pattern PRs — here the OWED was accurate, the work was just owed.) Refs #90 #107 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
enabled auto-merge (squash)
May 30, 2026 16:44
|
hyperpolymath
added a commit
that referenced
this pull request
May 30, 2026
…ven#90, #107) (#113) Mirror of [#112 SafeYAML](#112) — same case-split shape for TOMLValue's 10 constructors. \`\`\`idris public export isScalarCorrect : (val : TOMLValue) -> isScalar val = True -> not (isTable val || isArray val) = True isScalarCorrect (TString _) _ = Refl isScalarCorrect (TInt _) _ = Refl isScalarCorrect (TFloat _) _ = Refl isScalarCorrect (TBool _) _ = Refl isScalarCorrect (TDateTime _) _ = Refl isScalarCorrect (TDate _) _ = Refl isScalarCorrect (TTime _) _ = Refl isScalarCorrect (TArray _) Refl impossible isScalarCorrect (TInlineTable _) Refl impossible isScalarCorrect (TTable _) Refl impossible \`\`\` 7 scalar arms close by Refl (`not (False || False) = True`). 3 container arms have premise `False = True` (uninhabited). Refs #90 #107 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 331 issues detected
View findings[
{
"reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in architecture-enforcement.yml",
"type": "missing_timeout_minutes",
"file": "architecture-enforcement.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in architecture-enforcement.yml",
"type": "missing_timeout_minutes",
"file": "architecture-enforcement.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in boj-build.yml",
"type": "missing_timeout_minutes",
"file": "boj-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_batch.yml",
"type": "missing_timeout_minutes",
"file": "cflite_batch.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_pr.yml",
"type": "missing_timeout_minutes",
"file": "cflite_pr.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



```idris
public export
isScalarCorrect : (val : YAMLValue) -> isScalar val = True -> not (isCollection val) = True
isScalarCorrect YNull _ = Refl
isScalarCorrect (YBool _) _ = Refl
isScalarCorrect (YInt _) _ = Refl
isScalarCorrect (YFloat _) _ = Refl
isScalarCorrect (YString _) _ = Refl
isScalarCorrect (YArray _) Refl impossible
isScalarCorrect (YObject _) Refl impossible
isScalarCorrect (YBinary _) _ = Refl
isScalarCorrect (YTimestamp _) _ = Refl
```
7 scalar constructors → `Refl` (each reduces `not (not True) = True`).
2 collection constructors (YArray, YObject) → `Refl impossible` (premise `isScalar val = True` reduces to `False = True` which is uninhabited).
This is a slightly different shape from the prior proven#107 PRs — here the OWED comment correctly identified the 9-arm case-split discharge, the work was just OWED to be done.
Refs #90 #107