fix(proofs): align Idris Lang enum with Rust (Chapel not C) — closes #41#46
Merged
Conversation
Closes #41. Both enumerations claim "49 variants + Unknown" but disagreed on which 49: Rust has `Chapel` (no `C`), Idris had `C` (no `Chapel`). The completeness theorem was therefore technically vacuous for `C` (no Rust dispatch to verify) and silently missing coverage for `Chapel`. Option 1 from the issue (preferred): drop `C` from Idris, add `Chapel`. Cpp already represents the C/C++ unified analyzer (analyze_c_cpp dispatches on .c/.cpp/.h/.hpp/.cc/.hh), so there was never a separate `C` constructor in the Rust source of truth. Changes: - `Lang`: remove `C`, add `Chapel` (under new "HPC / parallel" group) - `analyzerFor`: drop `C` arm, add `Chapel` arm - `detectorsFor`: replace `C, Cpp` with `Cpp` in all 8 affected lists (UncheckedAllocation, UnboundedLoop, UnsafeCode, RaceCondition, DeadlockPotential, ResourceLeak, InsecureProtocol, HardcodedSecret, UncheckedError) - Updated header comment to clarify Cpp = analyze_c_cpp Verification: - `idris2 --check src/abi/PatternCompleteness.idr` — totality OK - Bijection check: 50 = 49 named + Unknown on both sides, zero diff - `cargo build --release` clean - `cargo clippy --all-targets --features signing,http -D warnings` clean Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 48 issues detected
View findings[
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
"type": "ncl_missing_spdx",
"file": "/home/runner/work/panic-attack/panic-attack/reports/panic-attack-20260211180017.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/chain.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/evidence.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/ambush/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/kanren/strategy.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/axial/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "expect() in hot path (4 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/assail/analyzer.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap() without prior check -- DoS via panic (4 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
🔍 Hypatia Security ScanFindings: 49 issues detected
View findings[
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
"type": "ncl_missing_spdx",
"file": "/home/runner/work/panic-attack/panic-attack/reports/panic-attack-20260211180017.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/chain.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/evidence.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/ambush/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/kanren/strategy.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/axial/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "expect() in hot path (4 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/assail/analyzer.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap() without prior check -- DoS via panic (4 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"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.
Summary
Closes #41 — the Rust
Languageenum and the IdrisLangenum both claimed "49 variants + Unknown" but disagreed on which 49:src/types.rssrc/abi/PatternCompleteness.idrChapelCResult: the totality theorem
completeScanForAllwas technically vacuous forC(no Rust dispatch existed to verify) and silently missing coverage forChapel.Fix — Option 1 from the issue
Drop
Cfrom Idris, addChapel. Rationale:Cppalready represents the unified C/C++ analyzer (analyze_c_cppdispatches on.c/.cpp/.h/.hpp/.cc/.hh), so there was never a separateCconstructor in the Rust source of truth — the original Idris enum had a phantom constructor.Changes
Langdata declarationC, addChapel(in new-- HPC / parallelgroup, mirroring its position intypes.rs)Cppis the C/C++ unified analyzeranalyzerForanalyzerFor C = SpecificAnalyzer; addanalyzerFor Chapel = SpecificAnalyzerdetectorsFor[C, Cpp]→[Cpp](UncheckedAllocation, UnboundedLoop, UnsafeCode, RaceCondition, DeadlockPotential, ResourceLeak, InsecureProtocol, HardcodedSecret, UncheckedError)Net diff: -11 / +16 lines, single file.
Acceptance criteria (from #41)
cargo build --releasecleanidris2 --check src/abi/PatternCompleteness.idr— totality OKWhy this is the right fix
analyze_inner()actually dispatches against).Cppanalyzer subsumes.cfiles via the unifiedanalyze_c_cpppath, so there is no behavioural regression.Chapelanalyzer is now provably covered bycompleteScanForAll.Verification
cargo build --release✅cargo clippy --all-targets --features signing,http -- -D warnings✅idris2 --check(totality) ✅🤖 Generated with Claude Code