Commit 7766c18
## Summary
Closes #41 — the Rust `Language` enum and the Idris `Lang` enum both
claimed "49 variants + Unknown" but disagreed on which 49:
| Variant | Rust `src/types.rs` | Idris
`src/abi/PatternCompleteness.idr` |
|---|---|---|
| `Chapel` | ✅ | ❌ (now ✅) |
| `C` | ❌ | ✅ (now ❌) |
Result: the totality theorem `completeScanForAll` was technically
vacuous for `C` (no Rust dispatch existed to verify) and silently
missing coverage for `Chapel`.
## Fix — Option 1 from the issue
Drop `C` from Idris, add `Chapel`. Rationale: `Cpp` already represents
the unified C/C++ 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 — the original Idris enum had a
phantom constructor.
## Changes
| Location | Change |
|---|---|
| `Lang` data declaration | Remove `C`, add `Chapel` (in new `-- HPC /
parallel` group, mirroring its position in `types.rs`) |
| Header comment | Note that `Cpp` is the C/C++ unified analyzer |
| `analyzerFor` | Drop `analyzerFor C = SpecificAnalyzer`; add
`analyzerFor Chapel = SpecificAnalyzer` |
| `detectorsFor` | 8 lists updated: `[C, Cpp]` → `[Cpp]`
(UncheckedAllocation, UnboundedLoop, UnsafeCode, RaceCondition,
DeadlockPotential, ResourceLeak, InsecureProtocol, HardcodedSecret,
UncheckedError) |
Net diff: -11 / +16 lines, single file.
## Acceptance criteria (from #41)
- [x] `cargo build --release` clean
- [x] `idris2 --check src/abi/PatternCompleteness.idr` — totality OK
- [x] Bijection between the two enumerations:
```
$ comm -23 /tmp/rust-langs /tmp/idris-langs # in Rust, not Idris
(empty)
$ comm -13 /tmp/rust-langs /tmp/idris-langs # in Idris, not Rust
(empty)
50 = 50 — match (49 named + Unknown on both sides)
```
## Why this is the right fix
- The Rust enum is the operational source of truth (it's what
`analyze_inner()` actually dispatches against).
- The Idris file is the **mirror** that has to follow.
- `Cpp` analyzer subsumes `.c` files via the unified `analyze_c_cpp`
path, so there is no behavioural regression.
- `Chapel` analyzer is now provably covered by `completeScanForAll`.
## Verification
- [x] `cargo build --release` ✅
- [x] `cargo clippy --all-targets --features signing,http -- -D
warnings` ✅
- [x] `idris2 --check` (totality) ✅
- [x] Signed commit (GPG)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent edf8d6e commit 7766c18
1 file changed
Lines changed: 16 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | | - | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
206 | 211 | | |
207 | 212 | | |
208 | 213 | | |
209 | | - | |
210 | | - | |
| 214 | + | |
| 215 | + | |
211 | 216 | | |
212 | | - | |
| 217 | + | |
213 | 218 | | |
214 | | - | |
215 | | - | |
216 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
221 | 226 | | |
222 | | - | |
| 227 | + | |
223 | 228 | | |
224 | 229 | | |
225 | | - | |
226 | | - | |
| 230 | + | |
| 231 | + | |
227 | 232 | | |
228 | 233 | | |
229 | 234 | | |
| |||
0 commit comments