Skip to content

proof: make Phronesis.agda compile; integrate echo-types (verdict provenance) - #39

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/gifted-fermat-EmVcv
Jun 12, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/gifted-fermat-EmVcv

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Phronesis's flagship intrinsically-typed safety formalisation Phronesis.agda now type-checks (exit 0) for the first time, and echo-types is wired into its semantics.

Root fixes to Phronesis.agda (it never compiled before)

  • Context-cons _,_ → _,,_ — resolves a mixfix parse ambiguity against Data.Product._,_.
  • Drop two illegal using (…) renaming (…) repeats (stdlib v2.3 / Agda 2.6.3 reject names listed in both).
  • Complete the unsound, incomplete _≟ᵗ_ into a sound total decidable type-equality (mutual _≟ᵗ_/_≟ᶠ_, structural; the old catch-all no (λ ()) claimed every pair unequal incl. TInt ≟ᵗ TInt).
  • Fix _<ᵛ_ operator precedence + implicit inference (Bool !=< ℤ).

echo-types integration

PhronesisEcho.agda — an ethical verdict's provenance IS Echo verdict v: eval is non-injective, so the fiber retains which expressions justify a verdict the bare Bool forgets. Headline verdict-forgets-provenance; proj₁ is the section recovering the source. Adds phronesis-formal.agda-lib (depend: echo-types).

Verification

Phronesis.agda + PhronesisEcho.agda: 2/2 pass (Agda 2.6.3 + stdlib v2.3 + echo-types), machine-checked against the real echo-types library.

🤖 Draft opened by Claude Code.

https://claude.ai/code/session_01DQACj3RFmAPZaBPgR9SAaS


Generated by Claude Code

…venance)

Phronesis.agda now type-checks (exit 0) for the first time. Root fixes:
ctx-cons _,_ -> _,,_ (mixfix ambiguity vs Data.Product._,_); drop two illegal
using+renaming repeats; complete the unsound/incomplete _≟ᵗ_ into a sound total
decidable type-equality (mutual _≟ᵗ_/_≟ᶠ_); fix _<ᵛ_ precedence+inference (Bool!=<ℤ).
PhronesisEcho.agda: an ethical verdict's provenance IS `Echo verdict v` —
verdict-forgets-provenance is the auditable-ethics headline. Machine-checked
vs real echo-types; adds phronesis-formal.agda-lib (depend: echo-types).

https://claude.ai/code/session_01DQACj3RFmAPZaBPgR9SAaS
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 38 issues detected

Severity Count
🔴 Critical 0
🟠 High 10
🟡 Medium 28
View findings
[
  {
    "reason": "Backup file in root",
    "type": "stale",
    "file": "ECOSYSTEM.scm.bak",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "medium"
  },
  {
    "reason": "Backup file in root",
    "type": "stale",
    "file": "META.scm.bak",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "medium"
  },
  {
    "reason": "Merge artifact in root",
    "type": "stale",
    "file": "SPEC.core.scm.orig",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "medium"
  },
  {
    "reason": "Action trufflesecurity/trufflehog@main needs attention",
    "type": "unpinned_action",
    "file": "secret-scanner.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "codeql.yml lists `language: javascript-typescript` but the repo has no source files in any CodeQL-scannable language. The analyze job will exit 'no source files' on every run. Switch the matrix to `actions` (which scans workflow files — every repo has those).",
    "type": "codeql_language_matrix_mismatch",
    "file": "codeql.yml",
    "action": "switch_codeql_matrix_to_actions",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in secret-scanner.yml",
    "type": "missing_timeout_minutes",
    "file": "secret-scanner.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "codeql_missing_actions_language",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "binary_to_term without :safe option -- deserialization attack (1 occurrences, CWE-502)",
    "type": "elixir_send_unsanitised",
    "file": "/home/runner/work/phronesis/phronesis/lib/phronesis/compiler.ex",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Nominal-only SAST in phronesis: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
    "type": "StaticAnalysis",
    "file": "/home/runner/work/phronesis/phronesis",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Add CodeQL or equivalent SAST workflow.",
    "scorecard_check": "SAST"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

…stale rot

CodeQL analyze hard-failed 'no source files': phronesis is Elixir/Erlang (BEAM),
not a CodeQL-supported language. Switch the matrix to `actions` (scans workflow
YAML — always present), restoring real SAST coverage (Hypatia SAST finding).
Also delete stale root artifacts flagged by Hypatia root_hygiene:
ECOSYSTEM.scm.bak, META.scm.bak, SPEC.core.scm.orig.

https://claude.ai/code/session_01DQACj3RFmAPZaBPgR9SAaS
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 33 issues detected

Severity Count
🔴 Critical 0
🟠 High 9
🟡 Medium 24
View findings
[
  {
    "reason": "Action trufflesecurity/trufflehog@main needs attention",
    "type": "unpinned_action",
    "file": "secret-scanner.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in secret-scanner.yml",
    "type": "missing_timeout_minutes",
    "file": "secret-scanner.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "binary_to_term without :safe option -- deserialization attack (1 occurrences, CWE-502)",
    "type": "elixir_send_unsanitised",
    "file": "/home/runner/work/phronesis/phronesis/lib/phronesis/compiler.ex",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Nominal-only SAST in phronesis: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
    "type": "StaticAnalysis",
    "file": "/home/runner/work/phronesis/phronesis",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Add CodeQL or equivalent SAST workflow.",
    "scorecard_check": "SAST"
  },
  {
    "reason": "Repository has 3 non-main remote branch(es). Policy: single main branch only.",
    "type": "GS007",
    "file": ".",
    "action": "delete_remote_branches",
    "rule_module": "git_state",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 0 day(s) old",
    "type": "CSA001",
    "file": ".claude/CLAUDE.md",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 0 day(s) old",
    "type": "CSA001",
    "file": ".claude/CLAUDE.md",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 0 day(s) old",
    "type": "CSA001",
    "file": ".claude/CLAUDE.md",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 0 day(s) old",
    "type": "CSA001",
    "file": ".claude/CLAUDE.md",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath marked this pull request as ready for review June 12, 2026 16:31
@hyperpolymath
hyperpolymath merged commit e9d102c into main Jun 12, 2026
7 checks passed
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.

3 participants