Skip to content

proof(SafeYAML): DISCHARGE isScalarCorrect via 9-arm case-split (proven#90, #107) - #112

Merged
hyperpolymath merged 1 commit into
mainfrom
proof/safeyaml-isscalar-correct
May 30, 2026
Merged

proof(SafeYAML): DISCHARGE isScalarCorrect via 9-arm case-split (proven#90, #107)#112
hyperpolymath merged 1 commit into
mainfrom
proof/safeyaml-isscalar-correct

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

```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

`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
hyperpolymath enabled auto-merge (squash) May 30, 2026 16:44
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 031bcbb into main May 30, 2026
11 of 24 checks passed
@hyperpolymath
hyperpolymath deleted the proof/safeyaml-isscalar-correct branch May 30, 2026 16:47
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>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 331 issues detected

Severity Count
🔴 Critical 130
🟠 High 31
🟡 Medium 170

⚠️ Action Required: Critical security issues found!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant