Skip to content

Commit 95af8ab

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: v2.0.0 - 47-language support, miniKanren logic engine, xray→assail rename
Major release adding: - 47 language analyzers (BEAM, ML, Lisp, Functional, Proof, Logic, Systems, Config, Scripting, NextGen DSLs) up from 5 - 20 weak point categories (CommandInjection, UnsafeDeserialization, AtomExhaustion, UnsafeFFI, PathTraversal, HardcodedSecret, etc.) - miniKanren-inspired logic engine (kanren module) with: - Substitution-based unification and forward chaining - Taint analysis: source→sink data flow tracking - Cross-language vulnerability chain detection (FFI/NIF/Port boundaries) - Search strategy optimisation (5 strategies, auto-select) - Renamed xray→assail throughout (module, types, CLI subcommand, docs) - All 30 tests passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1c3a856 commit 95af8ab

35 files changed

+5096
-1058
lines changed

.claude/CLAUDE.md

Lines changed: 40 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
Static analysis and bug signature detection tool. Scans source code for weak points (unwrap/expect, unsafe blocks, panic sites, error handling gaps) across multiple languages.
5+
Static analysis and bug signature detection tool. Scans source code for weak points (unwrap/expect, unsafe blocks, panic sites, error handling gaps, command injection, unsafe deserialization, FFI boundaries, atom exhaustion, and more) across 47 programming languages.
66

77
**Position in AmbientOps ecosystem**: Part of the hospital model, loosely affiliated. Sits alongside the Operating Room as a diagnostic tool for software health (while hardware-crash-team handles hardware health). Independent top-level repo, but feeds findings to the hospital's Records system via verisimdb.
88

@@ -11,6 +11,8 @@ Static analysis and bug signature detection tool. Scans source code for weak poi
1111
**IMPORTANT: This tool was renamed on 2026-02-08:**
1212
- Binary: `panic-attacker``panic-attack`
1313
- Subcommand: `xray``assail`
14+
- Module: `src/xray/``src/assail/`
15+
- Type: `XRayReport``AssailReport`
1416
- Report header: `X-RAY``ASSAIL`
1517

1618
## Architecture
@@ -19,12 +21,26 @@ Static analysis and bug signature detection tool. Scans source code for weak poi
1921
src/
2022
├── main.rs # CLI entry point (clap)
2123
├── lib.rs # Library API
22-
├── types.rs # Core types (ScanResult, WeakPoint, etc.)
23-
├── xray/mod.rs # Assail analyzer (renamed from xray internally)
24-
├── attacks/ # 6-axis stress testing
25-
├── signatures/ # Logic-based bug signatures (Datalog-inspired)
26-
├── patterns/ # Language-specific pattern matching
24+
├── types.rs # Core types (AssailReport, WeakPoint, etc.)
25+
├── assail/ # Static analysis engine
26+
│ ├── mod.rs # Public API: analyze(), analyze_verbose()
27+
│ ├── analyzer.rs # 47-language analyzer with per-file detection
28+
│ └── patterns.rs # Language-specific attack patterns
29+
├── kanren/ # miniKanren-inspired logic engine (v2.0.0)
30+
│ ├── mod.rs # Module entry, re-exports
31+
│ ├── core.rs # Term, Substitution, unification, FactDB, forward chaining
32+
│ ├── taint.rs # TaintAnalyzer: source→sink tracking
33+
│ ├── crosslang.rs # CrossLangAnalyzer: FFI boundary detection
34+
│ └── strategy.rs # SearchStrategy: risk-weighted file prioritisation
35+
├── attack/ # 6-axis stress testing
36+
│ ├── executor.rs # Attack execution engine
37+
│ └── strategies.rs # Per-axis attack strategies
38+
├── signatures/ # Logic-based bug signature detection
39+
│ ├── engine.rs # SignatureEngine (use-after-free, deadlock, etc.)
40+
│ └── rules.rs # Detection rules
2741
└── report/
42+
├── mod.rs # Report generation API
43+
├── generator.rs # AssaultReport builder
2844
└── formatter.rs # Output formatting (text + JSON)
2945
```
3046

@@ -36,18 +52,31 @@ cargo test
3652

3753
# Run scan:
3854
panic-attack assail /path/to/repo
39-
panic-attack assail /path/to/repo --format json --output report.json
40-
panic-attack assail self-test # Self-scan for validation
55+
panic-attack assail /path/to/repo --output report.json
56+
panic-attack assail /path/to/repo --verbose
57+
58+
# Install:
59+
cp target/release/panic-attack ~/.asdf/installs/rust/nightly/bin/
4160
```
4261

4362
## Key Design Decisions
4463

45-
- **5 language analyzers**: Rust, C/C++, Go, Python, generic fallback
46-
- **Weak point categories**: unwrap/expect, unsafe blocks, panic sites, todo/fixme, error suppression
47-
- **Per-file statistics**: Each file gets individual risk scoring
64+
- **47 language analyzers**: Rust, C/C++, Go, Python, JavaScript, Ruby, Elixir, Erlang, Gleam, ReScript, OCaml, SML, Scheme, Racket, Haskell, PureScript, Idris, Lean, Agda, Prolog, Logtalk, Datalog, Zig, Ada, Odin, Nim, Pony, D, Nickel, Nix, Shell, Julia, Lua, + 12 nextgen DSLs
65+
- **20 weak point categories**: UnsafeCode, PanicPath, CommandInjection, UnsafeDeserialization, AtomExhaustion, UnsafeFFI, PathTraversal, HardcodedSecret, etc.
66+
- **Per-file language detection**: Each file analyzed with its own language-specific patterns
67+
- **miniKanren logic engine**: Relational reasoning for taint analysis, cross-language vulnerability chains, and search strategy optimisation
4868
- **Latin-1 fallback**: Non-UTF-8 files handled gracefully
4969
- **JSON output**: Machine-readable for pipeline integration
5070

71+
## miniKanren Logic Engine (v2.0.0)
72+
73+
The kanren module provides:
74+
- **Taint analysis**: Tracks data flow from sources (user input, network, deserialization) to sinks (eval, shell commands, SQL queries)
75+
- **Cross-language reasoning**: Detects vulnerability chains across FFI/NIF/Port/subprocess boundaries
76+
- **Search strategies**: Auto-selects RiskWeighted, BoundaryFirst, LanguageFamily, BreadthFirst, or DepthFirst based on project characteristics
77+
- **Forward chaining**: Derives new vulnerability facts from rules applied to existing facts
78+
- **Backward queries**: Given a vulnerability type, finds which files could cause it
79+
5180
## Planned Features (Next Priorities)
5281

5382
1. **`sweep` subcommand**: Scan entire directory of git repos in one go
@@ -64,62 +93,9 @@ panic-attack assail self-test # Self-scan for validation
6493
- **sustainabot**: Ecological/economic code health metrics
6594
- **hardware-crash-team**: Sibling tool (hardware diagnostics vs software analysis)
6695

67-
## Sweep Subcommand (Priority - Sonnet Task)
68-
69-
Add a `sweep` subcommand that scans an entire directory of git repos in one pass.
70-
71-
### Design
72-
73-
```
74-
panic-attack sweep /path/to/repos/ [options]
75-
--format json|text|sarif Output format (default: text)
76-
--output report.json Save aggregate report
77-
--push-to-verisimdb URL Push each result to verisimdb API
78-
--push-to-data-repo PATH Write each result to verisimdb-data repo
79-
--min-risk medium Only report repos at or above this risk level
80-
--parallel N Number of concurrent scans (default: 4)
81-
```
82-
83-
### Implementation Steps
84-
85-
1. Add `Sweep` variant to the `Commands` enum in main.rs
86-
2. Walk the directory looking for `.git/` subdirectories (use walkdir, already a dependency)
87-
3. For each repo found, call the existing `assail` scan logic
88-
4. Aggregate results into a summary report
89-
5. Optionally push each result to verisimdb-data repo as JSON files
90-
6. Print aggregate summary (total repos, total weak points, top offenders)
91-
92-
### verisimdb-data Integration
93-
94-
When `--push-to-data-repo` is specified:
95-
- Write each scan result to `{data-repo}/scans/{repo-name}.json`
96-
- Update `{data-repo}/index.json` with summary entry
97-
- Git add + commit with message "scan: update {repo-name} results"
98-
99-
### GitHub Actions Reusable Workflow
100-
101-
Create `.github/workflows/scan-and-report.yml` as a reusable workflow:
102-
```yaml
103-
# Other repos call this:
104-
# uses: hyperpolymath/panic-attacker/.github/workflows/scan-and-report.yml@main
105-
# This runs panic-attack assail on the calling repo
106-
# and dispatches results to verisimdb-data
107-
```
108-
109-
## Scan Results from 2026-02-08 Session
110-
111-
21 repos scanned, 118 total weak points, zero critical, 17 high:
112-
- protocol-squisher: 39 weak points (highest)
113-
- echidna: 15 weak points
114-
- verisimdb: 12 weak points
115-
- Most high-severity findings are expected unsafe blocks in FFI/GC code
116-
117-
Results loaded into verisimdb as hexads (verified working with text search).
118-
11996
## Code Style
12097

12198
- SPDX headers on all files: `PMPL-1.0-or-later`
12299
- Author: Jonathan D.A. Jewell <jonathan.jewell@open.ac.uk>
123100
- Use anyhow::Result for error handling
124-
- Zero compiler warnings policy
125101
- Serde derive on public types for JSON serialization

.machine_readable/ECOSYSTEM.scm

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,95 @@
11
;; SPDX-License-Identifier: PMPL-1.0-or-later
2-
;; Ecosystem position for panic-attacker
2+
;; Ecosystem position for panic-attack (formerly panic-attacker)
33
;; Media Type: application/vnd.ecosystem+scm
44

55
(ecosystem
66
(version "1.0")
7-
(name "panic-attacker")
7+
(name "panic-attack")
88
(type "tool")
9-
(purpose "Universal stress testing and logic-based bug signature detection")
9+
(purpose "Universal static analysis and logic-based bug signature detection for 47 languages")
1010

1111
(position-in-ecosystem
1212
(layer "development-tools")
1313
(category "testing-quality")
14-
(subcategory "stress-testing-analysis")
15-
(maturity "beta")
14+
(subcategory "static-analysis-stress-testing")
15+
(maturity "stable")
1616
(adoption "internal"))
1717

1818
(related-projects
19+
(project
20+
(name "verisimdb")
21+
(relationship "data-store")
22+
(integration "panic-attack scan results stored as hexads in verisimdb")
23+
(url "https://github.com/hyperpolymath/verisimdb")
24+
(description "Verification-similarity database for code quality metrics"))
25+
26+
(project
27+
(name "verisimdb-data")
28+
(relationship "data-pipeline")
29+
(integration "scan JSON ingested via ingest-scan.sh into verisimdb-data repo")
30+
(url "https://github.com/hyperpolymath/verisimdb-data")
31+
(description "Git-based data store for verisimdb scan results"))
32+
1933
(project
2034
(name "hypatia")
2135
(relationship "consumer")
22-
(integration "uses panic-attacker for repository health assessment")
36+
(integration "uses panic-attack for repository health assessment, VeriSimDB connector")
2337
(url "https://github.com/hyperpolymath/hypatia")
2438
(description "Neurosymbolic CI/CD intelligence"))
2539

2640
(project
2741
(name "gitbot-fleet")
2842
(relationship "consumer")
29-
(integration "bots can trigger panic-attacker scans")
43+
(integration "bots can trigger panic-attack scans via repository_dispatch")
3044
(url "https://github.com/hyperpolymath/gitbot-fleet")
3145
(description "Repository automation bots (rhodibot, echidnabot, etc.)"))
3246

3347
(project
34-
(name "git-seo")
48+
(name "ambientops")
3549
(relationship "sibling-tool")
36-
(integration "complementary repository analysis")
37-
(url "https://github.com/hyperpolymath/git-seo")
38-
(description "Git repository analysis and optimization"))
50+
(integration "hospital model: panic-attack is diagnostic tool, ambientops is operating room")
51+
(url "https://github.com/hyperpolymath/ambientops")
52+
(description "AmbientOps hospital model for software health"))
53+
54+
(project
55+
(name "hardware-crash-team")
56+
(relationship "sibling-tool")
57+
(integration "panic-attack handles software diagnostics, hardware-crash-team handles hardware")
58+
(url "https://github.com/hyperpolymath/hardware-crash-team")
59+
(description "Hardware health diagnostics"))
3960

4061
(project
4162
(name "echidna")
4263
(relationship "test-subject")
43-
(integration "used as benchmark for panic-attacker testing")
64+
(integration "used as benchmark for panic-attack testing (15 weak points)")
4465
(url "https://github.com/hyperpolymath/echidna")
4566
(description "Automated theorem proving orchestrator"))
4667

4768
(project
4869
(name "eclexia")
4970
(relationship "test-subject")
50-
(integration "used as benchmark for panic-attacker testing")
71+
(integration "used as benchmark for panic-attack testing")
5172
(url "https://github.com/hyperpolymath/eclexia")
5273
(description "Resource-aware adaptive programming language"))
5374

5475
(project
5576
(name "rsr-template-repo")
5677
(relationship "template-provider")
57-
(integration "panic-attacker follows RSR standards")
78+
(integration "panic-attack follows RSR standards")
5879
(url "https://github.com/hyperpolymath/rsr-template-repo")
5980
(description "RSR-compliant repository template"))
6081

6182
(project
6283
(name "0-ai-gatekeeper-protocol")
6384
(relationship "standard-provider")
64-
(integration "panic-attacker implements AI manifest protocol")
85+
(integration "panic-attack implements AI manifest protocol")
6586
(url "https://github.com/hyperpolymath/0-ai-gatekeeper-protocol")
6687
(description "Universal AI manifest system"))
6788

6889
(project
6990
(name "robot-repo-automaton")
7091
(relationship "potential-consumer")
71-
(integration "could use panic-attacker for automated quality checks")
92+
(integration "could use panic-attack for automated quality checks")
7293
(url "https://github.com/hyperpolymath/robot-repo-automaton")
7394
(description "Automated repository fixes with confidence thresholds")))
7495

@@ -111,45 +132,50 @@
111132

112133
(future-integrations
113134
(integration
114-
(name "Datalog engine")
115-
(status "planned-v0.5")
116-
(description "Real logic programming engine (Crepe/Datafrog)"))
135+
(name "sweep subcommand")
136+
(status "planned-v2.1")
137+
(description "Bulk scanning of directory-of-repos with aggregated results"))
138+
139+
(integration
140+
(name "verisimdb API push")
141+
(status "planned-v2.1")
142+
(description "Push scan results as hexads directly to verisimdb API"))
117143

118144
(integration
119-
(name "Constraint sets")
120-
(status "planned-v0.4")
121-
(description "YAML-based stress profiles"))
145+
(name "hypatia pipeline")
146+
(status "planned-v2.1")
147+
(description "Feed kanren facts as Logtalk predicates to hypatia rule engine"))
122148

123149
(integration
124-
(name "CI/CD platforms")
125-
(status "planned-v1.0")
126-
(description "GitHub Actions, GitLab CI, Jenkins integration"))
150+
(name "SARIF output")
151+
(status "planned-v2.2")
152+
(description "SARIF output for GitHub Security tab and CodeQL integration"))
127153

128154
(integration
129155
(name "crates.io")
130-
(status "planned-v1.0")
156+
(status "planned-v3.0")
131157
(description "Publish as cargo-installable tool")))
132158

133159
(ecosystem-contributions
134160
(contribution
135161
(type "tool")
136-
(value "Novel stress testing approach combining X-Ray + multi-axis + logic-based detection"))
162+
(value "Universal static analysis combining assail scan + miniKanren logic engine + multi-axis stress testing"))
137163

138164
(contribution
139165
(type "pattern")
140-
(value "Demonstrates Datalog-inspired bug detection in Rust"))
166+
(value "miniKanren-inspired relational reasoning for taint analysis and cross-language vulnerability detection in Rust"))
141167

142168
(contribution
143169
(type "benchmark")
144-
(value "Provides quality metrics for hyperpolymath projects"))
170+
(value "Provides quality metrics for hyperpolymath projects across 47 languages"))
145171

146172
(contribution
147173
(type "standard")
148174
(value "Follows and validates RSR compliance patterns")))
149175

150176
(metadata
151177
(created "2026-02-07")
152-
(updated "2026-02-07")
178+
(updated "2026-02-08")
153179
(maintainer "Jonathan D.A. Jewell <jonathan.jewell@open.ac.uk>")
154180
(license "PMPL-1.0-or-later")
155181
(repository "https://github.com/hyperpolymath/panic-attacker")))

0 commit comments

Comments
 (0)