sidik-ml 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sidik_ml-0.5.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SIDIK Research Team - Universitas Sultan Ageng Tirtayasa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,275 @@
1
+ Metadata-Version: 2.4
2
+ Name: sidik-ml
3
+ Version: 0.5.2
4
+ Summary: SIDIK-ML: Explainable Non-Neural Machine Learning Extension for SIDIK Static Security Analysis
5
+ Author: Radityo Budi Waskito, Fauzi Nur Ibrahim, Raditya Ahmad Pratama, Zayyan Fadhlur Rahman, Muhammad Fahri Indra Saputra, Mohamad Hilman
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/radityobw/SIDIK-ML
8
+ Project-URL: Repository, https://github.com/radityobw/SIDIK-ML
9
+ Project-URL: Upstream, https://github.com/radityobw/SIDIK
10
+ Keywords: security,sast,secret-detection,machine-learning,explainable-ai,non-neural
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: sidik-security<2.0.0,>=1.3.2
15
+ Requires-Dist: scikit-learn>=1.4.0
16
+ Requires-Dist: scipy>=1.11.0
17
+ Requires-Dist: skops>=0.9.0
18
+ Provides-Extra: train
19
+ Requires-Dist: numpy>=1.26.0; extra == "train"
20
+ Requires-Dist: pandas>=2.1.0; extra == "train"
21
+ Provides-Extra: explain
22
+ Requires-Dist: shap>=0.45.0; extra == "explain"
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
25
+ Requires-Dist: build>=1.0.0; extra == "dev"
26
+ Requires-Dist: twine>=5.0.0; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ <div align="center">
30
+
31
+ <img src="https://raw.githubusercontent.com/radityobw/SIDIK/main/logo/SIDIK-nobg-dark.png" alt="SIDIK-ML Logo" width="300"/>
32
+
33
+ # SIDIK-ML: *Explainable Non-Neural ML Extension*
34
+
35
+ **Ekstensi *Machine Learning* Klasik *Non-Neural* Terjelaskan untuk Reduksi *False Positive* Deteksi *Hardcoded Secret* SIDIK**
36
+ *Explainable Classical Non-ANN Machine Learning Extension for False Positive Reduction in SIDIK Static Secret Detection*
37
+
38
+ [![Python 3.9+](https://img.shields.io/badge/Python-3.9%2B-3b82f6.svg)](#)
39
+ [![Version v0.5.2](https://img.shields.io/badge/Version-v0.5.2-f59e0b.svg)](#)
40
+ [![Paradigm Non-ANN Only](https://img.shields.io/badge/Paradigm-Non--ANN%20Only-ea580c.svg)](#)
41
+ [![Random Forest MCC 0.7692](https://img.shields.io/badge/RF%20F1-0.9636%20%7C%20MCC%200.7692-10b981.svg)](#)
42
+ [![Unit Tests](https://img.shields.io/badge/Unit%20Tests-18%2F18%20Passing-22c55e.svg)](#)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-a855f7.svg)](#)
44
+
45
+ </div>
46
+
47
+ ---
48
+
49
+ # 🇮🇩 Bahasa Indonesia
50
+
51
+ ## 📌 Ikhtisar Proyek & Filosofi Desain
52
+
53
+ **SIDIK-ML** (`v0.5.2`) adalah paket perangkat lunak Python independen yang memperluas kemampuan pemindai deterministik [`SIDIK`](https://github.com/radityobw/SIDIK) (`>=v1.3.2`) dengan lapisan penyaringan *false positive* berbasis **klasifikasi klasik *Non-Artificial Neural Network* (*Non-ANN*) yang terjelaskan**.
54
+
55
+ Alih-alih mengganti mesin aturan deterministik `SIDIK` atau menyisipkan model *deep neural network* berbobot ratusan megabita, `SIDIK-ML` bekerja sebagai *plugin* opsional melalui kontrak data aman `SecretCandidate` (`schema_version = "1.0.0"`) dan *entry point* standar `sidik.plugins`. Ketika dijalankan melalui `sidik-ml gui`, `sidik-ml interactive`, maupun `--enable-ml`, antarmuka menampilkan tema khusus **Amber Orange (`#f59e0b` / `#ea580c`)** lengkap dengan lencana `NON-ANN ML`, *prompt* `sidik-ml>`, serta dasbor HTML bernuansa kuning-oranye agar langsung terbedakan dari mode deterministik standar **Ocean Blue (`#3b82f6`)** milik `SIDIK`.
56
+
57
+ ---
58
+
59
+ ## ✨ Fitur dan Kapabilitas Utama
60
+
61
+ 1. **Lima Model Klasik *Non-ANN* dengan Penjaga Penolak Arsitektur Neural:**
62
+ - Mendukung eksklusif *Logistic Regression*, *Decision Tree*, *Random Forest*, *Extra Trees*, dan *Gradient Boosting* via `create_non_ann_model()`.
63
+ - Fungsi `validate_non_ann_model_name()` secara eksplisit menolak model neural (`ann`, `mlp`, `cnn`, `rnn`, `lstm`, `transformer`, `codebert`) demi menjamin transparansi keputusan dan bobot ringan.
64
+ 2. **Rekayasa `30` Fitur Statis Bebas *Target Leakage* (`FEATURE_SCHEMA_VERSION = "1.0.0"`):**
65
+ - Mengekstrak tujuh dimensi fitur murni dari konteks pemindaian (`string_stats`, `entropy`, `pattern_evidence`, `lexical_context`, `code_context`, `file_context`, serta `deterministic_signal`) tanpa pernah menyimpan nilai kredensial mentah (hanya `masked_value` dan `value_sha256`).
66
+ 3. **Validasi Silang Anti-Kebocoran Data (*Zero Data Leakage*):**
67
+ - Menyediakan `deduplicate_records()`, `resolve_cross_repo_value_duplicates()` berbasis *SHA-256*, `stratified_repository_split()` (`StratifiedGroupKFold`), serta `assert_no_leakage()` yang memastikan nol tumpang-tindih `repo_id` maupun `value_sha256` antara himpunan latih dan uji.
68
+ 4. **Kebijakan *Triage* Hibrida *Fail-Safe* (`TriagePolicy`):**
69
+ - Secara *default* beroperasi pada mode konsultatif (`suppress_false_positives=False`) sehingga seluruh temuan deterministik `SIDIK` tetap ditampilkan bersama probabilitas rahasia dan kontribusi fitur pendorongnya (`explain_single_candidate()`).
70
+ - Saat supresi diaktifkan, `never_suppress_severities=("CRITICAL",)` melindungi temuan kritis agar tidak pernah dibungkam diam-diam oleh model ML.
71
+ 5. **Integrasi Penuh *Plugin* (`sidik.plugins`) & *Thin Launcher* TUI/GUI/SCA:**
72
+ - Terdaftar ke grup `sidik.plugins` melalui [plugin.py](sidik_ml/plugin.py), sehingga perintah `sidik-ml interactive`, `sidik-ml gui`, dan `sidik-ml-gui` membuka antarmuka TUI serta *Desktop GUI* `SIDIK` dengan kontrol *ML Triage* aktif.
73
+ - `sidik-ml scan` mendukung `--include-deps` (OSV SCA) serta 7 format laporan (`console`, `sarif`, `github`, `html`, `markdown`, `json`, `csv`).
74
+ 6. **Serialisasi Luring Terverifikasi *SHA-256* (`skops`):**
75
+ - Artefak `.skops` selalu diverifikasi *checksum SHA-256*-nya (`verify_artifact_sha256` atau otomatis dari `<model>.manifest.json`) dan diperiksa terhadap daftar putih tipe aman (`SAFE_SKOPS_TYPE_PREFIXES`) tanpa `pickle`/`joblib` mentah.
76
+
77
+ ---
78
+
79
+ ## 🏗️ Arsitektur Integrasi Hibrida
80
+
81
+ ```text
82
+ Kode Sumber & Manifes Target
83
+ │
84
+ ▼
85
+ SIDIK v1.3.2 Core (SAST 12 Aturan Regex + Entropi + Konteks + Offline OSV SCA)
86
+ │
87
+ ├──[Kontrak SecretCandidate v1.0.0 (masked_value + value_sha256)]──┐
88
+ │ ▼
89
+ │ SIDIK-ML v0.5.2 Plugin
90
+ │ (30 Fitur Statis -> skops + SHA-256
91
+ │ -> Probabilitas + Explainability)
92
+ │ │
93
+ ◄──[sisipan metadata ml_triage & TriagePolicy Fail-Safe CRITICAL]───┘
94
+ │
95
+ ▼
96
+ CLI Interaktif (TUI) │ Desktop GUI │ 7 Format Laporan (HTML, SARIF v2.1.0, MD, JSON, CSV)
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 📊 Ringkasan Hasil Empiris Terverifikasi
102
+
103
+ Seluruh angka di bawah tercatat pada eksperimen reproduksibel *SIDIK-ML* dengan `seed = 42`, *5-fold StratifiedGroupKFold*, `1.000` *bootstrap resamples*, dan uji *McNemar* pada dataset terbuka *Samsung/CredData* (`258` latih di `86 repo`, `64` *held-out test* di `23 unseen repo`), `25` repositori Python eksternal, serta `1.094` sampel *zero-shot CredDetX*:
104
+
105
+ ### 1. *Baseline* `SIDIK v1.1.0` vs Lima Model *Non-ANN* (*CredData Held-Out*, `N = 64`)
106
+
107
+ | Model / Kondisi | *5-Fold CV F1* | *Precision* Uji | *Recall* Uji | *F1-Score* Uji | MCC Uji | FPR Uji | *McNemar p* vs SIDIK |
108
+ | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
109
+ | **Kondisi A: `SIDIK v1.1.0`** | - | `0,8103` | `0,8868` | `0,8468` | `-0,1465` | `1,0000` | - |
110
+ | *Logistic Regression* | `0,8550 +- 0,0444` | **`1,0000`** | `0,8302` | `0,9072` | `0,6757` | **`0,0000`** | `0,15159` |
111
+ | *Decision Tree* | `0,8146 +- 0,1020` | `0,9000` | `0,8491` | `0,8738` | `0,3600` | `0,4545` | `0,45450` |
112
+ | *Random Forest* | `0,8949 +- 0,0236` | `0,9298` | **`1,0000`** | **`0,9636`** | **`0,7692`** | `0,3636` | **`0,000244`** |
113
+ | *Extra Trees* | `0,8957 +- 0,0408` | `0,9400` | `0,8868` | `0,9126` | `0,5604` | `0,2727` | `0,11532` |
114
+ | **`Gradient Boosting` (Pilihan CV)** | **`0,9028 +- 0,0249`** | `0,9038` | `0,8868` | `0,8952` | `+0,4178` | `0,4545` | `0,21011` |
115
+
116
+ * **Integrasi Hibrida & Pengaman *Fail-Safe* `CRITICAL`:** Pada Kondisi C1 (*Post-SIDIK Triage*), *Gradient Boosting* menekan FP sebesar `36,36%` dan memulihkan MCC ke `+0,1597` sembari melindungi `3` temuan `CRITICAL`; pada Kondisi C2 (*Candidate-Wide*), *Recall* mencapai `0,9057`, *F1* `0,8889`, dan MCC `+0,2923`.
117
+ * **Generalisasi Eksternal (`E1` & `E2`):** Pada 25 *repository* Python publik (`1.193` berkas `.py`), model menandai **`7 / 20` (`35,0%`) temuan deterministik sebagai *false positive*** dengan tambahan latensi hanya **`+3,6 ms` (`+0,15%`)** dan melindungi `4` temuan `CRITICAL` (`REVIEW_PRIORITY`). Pada uji *zero-shot CredDetX* (`1.094` kandidat) yang mengalami *domain shift*, konfigurasi hibrida `C1` menjaga stabilitas **`F1 = 0,7969` dan `MCC = +0,2075`**, mengungguli `SIDIK v1.1.0` murni (`MCC = +0,1999`) maupun model tunggal (`MCC = -0,2052`).
118
+ * ***Overhead* Inferensi Luring:** Inferensi *batch* `Gradient Boosting` hanya `1,00 ms` (`0,0156 ms/kandidat`), puncak memori `12,76 KB`, dan ukuran artefak `2.533,63 KB` (`.skops`).
119
+
120
+ ---
121
+
122
+ ## 📁 Struktur Paket
123
+
124
+ ```text
125
+ SIDIK-ML/
126
+ ├── .github/workflows/sidik-ml-ci.yml # CI otomatis pytest, plugin discovery, & CLI
127
+ ├── action.yml # Composite GitHub Action (SARIF & PR annotations)
128
+ ├── sidik_ml/
129
+ │ ├── __init__.py # Ekspor publik paket SIDIK-ML (v0.5.2)
130
+ │ ├── __main__.py # Titik masuk modul (python -m sidik_ml)
131
+ │ ├── cli.py # CLI scan, train, ekstrak fitur, TUI & GUI launchers
132
+ │ ├── plugin.py # Adapter entry point sidik.plugins (SidikMLPlugin)
133
+ │ ├── schemas.py # MLPrediction, HybridFinding, TriagePolicy
134
+ │ ├── features.py # 30 fitur statis bebas target leakage
135
+ │ ├── models.py # 5 model Non-ANN & neural exclusion guard
136
+ │ ├── dataset.py # JSONL I/O, deduplikasi SHA-256, StratifiedGroupKFold
137
+ │ ├── evaluation.py # F1, MCC, bootstrap CI, McNemar test, ablasi fitur
138
+ │ ├── explainability.py # Bobot model, permutation importance, penjelasan kandidat
139
+ │ ├── serialization.py # Save/load .skops aman terverifikasi SHA-256
140
+ │ ├── training.py # Pipeline pelatihan reproduksibel & provenans JSON
141
+ │ └── integration.py # HybridTriagePipeline (SIDIK + opsional ML classifier)
142
+ ├── tests/ # 18 unit & integration tests (pytest)
143
+ ├── pyproject.toml # Konfigurasi paket, dependencies, & entry points
144
+ ├── CHANGELOG.md
145
+ ├── LICENSE
146
+ └── README.md
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 🚀 Panduan Instalasi & Pemakaian Cepat
152
+
153
+ ### 1. Instalasi & Aktivasi Lingkungan (*Virtual Environment*)
154
+
155
+ `SIDIK-ML` menggunakan mesin inti, SCA OSV, CLI interaktif, serta GUI milik `SIDIK` (`sidik-security>=1.3.2`), sehingga keduanya harus dipasang di **lingkungan Python (`.venv`) yang sama**:
156
+
157
+ ```bash
158
+ # Dari direktori SIDIK-ML/ dengan venv SIDIK aktif
159
+ ..\SIDIK\.venv\Scripts\Activate.ps1 # Windows PowerShell
160
+ # source ../SIDIK/.venv/bin/activate # Linux / macOS
161
+
162
+ # Pasang SIDIK (bersama GUI) dan SIDIK-ML secara editable
163
+ pip install -e "..\SIDIK[gui]"
164
+ pip install -e .
165
+ ```
166
+
167
+ > **Catatan Windows PowerShell:** Apabila Anda membuka langsung folder `SIDIK\.venv\Scripts` tanpa menjalankan `Activate.ps1`, PowerShell tidak memuat perintah dari folder aktif secara otomatis. Gunakan awalan `.\` (misalnya `.\sidik-ml -i`, `.\sidik-ml --gui`, `.\sidik -i`, atau `.\sidik --gui`), atau aktifkan *virtual environment* terlebih dahulu dengan `.\Activate.ps1`. Jika skrip aktivasi terblokir kebijakan eksekusi PowerShell, jalankan lewat `python -m sidik_ml ...` atau gunakan peluncur `run_sidik_ml.bat` / `run_sidik_ml_cli.bat`.
168
+
169
+ ### 2. Perintah Harian (Selaras `sidik` dan `sidik-ml`)
170
+
171
+ Melalui *entry point* `sidik.plugins`, perintah `sidik-ml` dan `sidik` kini mendukung pola argumen yang simetris untuk TUI, *Desktop GUI*, pemindaian *one-shot*, modul `python -m`, serta 7 format laporan:
172
+
173
+ ```bash
174
+ # 1. Periksa versi atau luncurkan TUI / Desktop GUI (simetris dengan sidik -i / sidik --gui)
175
+ sidik-ml --version
176
+ sidik-ml -i # atau: sidik-ml interactive / python -m sidik_ml -i / run_sidik_ml_cli.bat
177
+ sidik-ml --gui # atau: sidik-ml gui / sidik-ml-gui / python -m sidik_ml --gui / run_sidik_ml.bat
178
+
179
+ # 2. Pindai langsung (argumen posisional / --target / scan) dengan ekspor HTML / SARIF / Markdown
180
+ sidik-ml .
181
+ sidik-ml --target path/to/project --include-deps --model model.skops --format html -o hasil_ml.html
182
+ sidik-ml scan path/to/project --include-deps --model model.skops --format html -o hasil_ml.html
183
+
184
+ # 3. Pindai dengan output ringkas konsol / JSON (tanpa supresi default)
185
+ sidik-ml scan path/to/project --json
186
+
187
+ # 4. Atau gunakan langsung dari perintah standar SIDIK
188
+ sidik --list-plugins
189
+ sidik --target path/to/project --enable-ml --ml-model model.skops
190
+
191
+ # 5. Ekspor fitur bebas leakage dari kandidat untuk anotasi / eksperimen
192
+ sidik-ml extract-features path/to/project --output candidates.jsonl --repo-id my_repo
193
+
194
+ # 6. Verifikasi integritas checksum SHA-256 artefak model .skops
195
+ sidik-ml verify-model model.skops --sha256 <hex_digest>
196
+
197
+ # 7. Latih & bandingkan 5 model Non-ANN menggunakan StratifiedGroupKFold
198
+ sidik-ml train dataset.jsonl --output-dir artifacts/ --stratified
199
+
200
+ # 8. Jalankan seluruh 18 unit & integration tests
201
+ pytest tests -v
202
+
203
+ # 9. Atau jalankan lewat GitHub Container Registry (ghcr.io) tanpa setup Python
204
+ docker run --rm -v "${PWD}:/workspace" ghcr.io/radityobw/sidik-ml:latest /workspace --include-deps
205
+ ```
206
+
207
+ ---
208
+
209
+ ## 🗺️ Ekosistem Perangkat Lunak Publik (*Public Software Ecosystem*)
210
+
211
+ | Repositori | Peran Utama | Versi Terkini | Tautan |
212
+ | :--- | :--- | :---: | :--- |
213
+ | **SIDIK** | Mesin pemindai deterministik SAST & OSV SCA + host *plugin* UI | `v1.3.2` | [`github.com/radityobw/SIDIK`](https://github.com/radityobw/SIDIK) |
214
+ | **SIDIK-ML** | Perangkat lunak ekstensi *Explainable Non-ANN ML* & *plugin* | `v0.5.2` | [`github.com/radityobw/SIDIK-ML`](https://github.com/radityobw/SIDIK-ML) |
215
+
216
+ ---
217
+
218
+ # 🇬🇧 English
219
+
220
+ ## 📌 Project Overview
221
+
222
+ **SIDIK-ML** (`v0.5.2`) is an independent Python package extending the deterministic [`SIDIK`](https://github.com/radityobw/SIDIK) (`>=v1.3.2`) security analyzer with **explainable classical Non-Artificial Neural Network (Non-ANN) machine learning** for false-positive reduction in hardcoded secret detection.
223
+
224
+ Instead of forking SIDIK's UI or introducing heavy deep learning weights, `SIDIK-ML` integrates through the leak-safe `SecretCandidate` (`schema_version = "1.0.0"`) contract and the standard `sidik.plugins` entry-point group. When launched via `sidik-ml gui`, `sidik-ml interactive`, or `--enable-ml`, the shared UI switches cleanly into an **Amber Orange (`#f59e0b` / `#ea580c`)** identity with `NON-ANN ML` badges, amber-yellow `sidik-ml>` console prompts, and warm orange-themed HTML/Markdown triage dashboards, clearly distinguishing hybrid ML analysis from Core SIDIK's **Ocean Blue (`#3b82f6`)** deterministic edition.
225
+
226
+ ## ✨ Key Capabilities
227
+
228
+ * **Strict Non-ANN Model Suite:** Evaluates *Logistic Regression*, *Decision Tree*, *Random Forest*, *Extra Trees*, and *Gradient Boosting*, backed by `validate_non_ann_model_name()` to reject neural network architectures.
229
+ * **30 Leakage-Free Static Features (`FEATURE_SCHEMA_VERSION = "1.0.0"`):** Extracts string statistics, Shannon entropy metrics, rule indicators, lexical cues, code structure, and file context without persisting raw credentials.
230
+ * **Zero Data Leakage Splitting & Verification:** Enforces cross-repo `value_sha256` collision resolution, `StratifiedGroupKFold` grouped by `repo_id`, and explicit `assert_no_leakage()` checks.
231
+ * **Fail-Safe Hybrid `TriagePolicy`:** Runs in advisory mode by default (`suppress_false_positives=False`) and shields `CRITICAL` findings (`never_suppress_severities=("CRITICAL",)`).
232
+ * **Hardened Offline `skops` Loading:** Validates `.skops` model digests against explicit SHA-256 checksums or companion `.manifest.json` files and restricts deserialization to `SAFE_SKOPS_TYPE_PREFIXES`.
233
+
234
+ ## 📊 Verified Empirical Highlights (`CredData` Held-Out `N = 64`, 25 Repos, & `CredDetX`)
235
+
236
+ | Model / Configuration | *5-Fold CV F1* | Test Precision | Test Recall | Test F1 | Test MCC | Test FPR |
237
+ | :--- | :---: | :---: | :---: | :---: | :---: | :---: |
238
+ | **Condition A: `SIDIK v1.1.0`** | - | `0.8103` | `0.8868` | `0.8468` | `-0.1465` | `1.0000` |
239
+ | *Logistic Regression* | `0.8550` | **`1.0000`** | `0.8302` | `0.9072` | `0.6757` | **`0.0000`** |
240
+ | *Random Forest* | `0.8949` | `0.9298` | **`1.0000`** | **`0.9636`** | **`0.7692`** | `0.3636` |
241
+ | **`Gradient Boosting` (CV Winner)** | **`0.9028`** | `0.9038` | `0.8868` | `0.8952` | `+0.4178` | `0.4545` |
242
+
243
+ On 25 external Python repositories (`1,193` `.py` files), the CV-selected model flags **`35.0%` (`7/20`) of deterministic alerts as false positives** with only **`+3.6 ms` (`+0.15%`) runtime overhead**. Under zero-shot domain shift on `CredDetX` (`1,094` candidates), fail-safe Hybrid Condition `C1` preserves **`F1 = 0.7969` and `MCC = +0.2075`**, outperforming both standalone deterministic SIDIK and unguarded ML classifiers.
244
+
245
+ ## 🚀 Quick Start
246
+
247
+ ```bash
248
+ # Install SIDIK and SIDIK-ML into the same virtual environment
249
+ ..\SIDIK\.venv\Scripts\Activate.ps1 # Windows PowerShell
250
+ # source ../SIDIK/.venv/bin/activate # Linux / macOS
251
+ pip install -e "..\SIDIK[gui]"
252
+ pip install -e .
253
+
254
+ # Check version and launch Amber-Orange SIDIK-ML Interactive CLI (TUI) or Desktop GUI (symmetric with sidik)
255
+ sidik-ml --version
256
+ sidik-ml -i --lang en # or: sidik-ml interactive / python -m sidik_ml -i / run_sidik_ml_cli.bat
257
+ sidik-ml --gui # or: sidik-ml gui / sidik-ml-gui / python -m sidik_ml --gui / run_sidik_ml.bat
258
+
259
+ # Run unified Secret + SCA scan (positional path, --target/-t, or `scan`)
260
+ sidik-ml .
261
+ sidik-ml --target path/to/project --include-deps --model model.skops --format html -o ml_report.html --lang en
262
+ sidik-ml scan path/to/project --include-deps --model model.skops --format html -o ml_report.html --lang en
263
+
264
+ # Run tests
265
+ pytest tests -v
266
+
267
+ # Run via GitHub Container Registry (ghcr.io) or install .whl from GitHub Releases
268
+ docker run --rm -v "${PWD}:/workspace" ghcr.io/radityobw/sidik-ml:latest /workspace --include-deps
269
+ ```
270
+
271
+ > **Windows PowerShell Note:** When running executables directly inside `SIDIK\.venv\Scripts` without activating `.venv` first, prefix commands with `.\` (e.g., `.\sidik-ml -i`, `.\sidik-ml --gui`) or invoke via `python -m sidik_ml ...` (or `run_sidik_ml.bat` / `run_sidik_ml_cli.bat`).
272
+
273
+ ## 📄 License
274
+
275
+ Distributed under the **MIT License**. See [LICENSE](LICENSE).
@@ -0,0 +1,247 @@
1
+ <div align="center">
2
+
3
+ <img src="https://raw.githubusercontent.com/radityobw/SIDIK/main/logo/SIDIK-nobg-dark.png" alt="SIDIK-ML Logo" width="300"/>
4
+
5
+ # SIDIK-ML: *Explainable Non-Neural ML Extension*
6
+
7
+ **Ekstensi *Machine Learning* Klasik *Non-Neural* Terjelaskan untuk Reduksi *False Positive* Deteksi *Hardcoded Secret* SIDIK**
8
+ *Explainable Classical Non-ANN Machine Learning Extension for False Positive Reduction in SIDIK Static Secret Detection*
9
+
10
+ [![Python 3.9+](https://img.shields.io/badge/Python-3.9%2B-3b82f6.svg)](#)
11
+ [![Version v0.5.2](https://img.shields.io/badge/Version-v0.5.2-f59e0b.svg)](#)
12
+ [![Paradigm Non-ANN Only](https://img.shields.io/badge/Paradigm-Non--ANN%20Only-ea580c.svg)](#)
13
+ [![Random Forest MCC 0.7692](https://img.shields.io/badge/RF%20F1-0.9636%20%7C%20MCC%200.7692-10b981.svg)](#)
14
+ [![Unit Tests](https://img.shields.io/badge/Unit%20Tests-18%2F18%20Passing-22c55e.svg)](#)
15
+ [![License: MIT](https://img.shields.io/badge/License-MIT-a855f7.svg)](#)
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ # 🇮🇩 Bahasa Indonesia
22
+
23
+ ## 📌 Ikhtisar Proyek & Filosofi Desain
24
+
25
+ **SIDIK-ML** (`v0.5.2`) adalah paket perangkat lunak Python independen yang memperluas kemampuan pemindai deterministik [`SIDIK`](https://github.com/radityobw/SIDIK) (`>=v1.3.2`) dengan lapisan penyaringan *false positive* berbasis **klasifikasi klasik *Non-Artificial Neural Network* (*Non-ANN*) yang terjelaskan**.
26
+
27
+ Alih-alih mengganti mesin aturan deterministik `SIDIK` atau menyisipkan model *deep neural network* berbobot ratusan megabita, `SIDIK-ML` bekerja sebagai *plugin* opsional melalui kontrak data aman `SecretCandidate` (`schema_version = "1.0.0"`) dan *entry point* standar `sidik.plugins`. Ketika dijalankan melalui `sidik-ml gui`, `sidik-ml interactive`, maupun `--enable-ml`, antarmuka menampilkan tema khusus **Amber Orange (`#f59e0b` / `#ea580c`)** lengkap dengan lencana `NON-ANN ML`, *prompt* `sidik-ml>`, serta dasbor HTML bernuansa kuning-oranye agar langsung terbedakan dari mode deterministik standar **Ocean Blue (`#3b82f6`)** milik `SIDIK`.
28
+
29
+ ---
30
+
31
+ ## ✨ Fitur dan Kapabilitas Utama
32
+
33
+ 1. **Lima Model Klasik *Non-ANN* dengan Penjaga Penolak Arsitektur Neural:**
34
+ - Mendukung eksklusif *Logistic Regression*, *Decision Tree*, *Random Forest*, *Extra Trees*, dan *Gradient Boosting* via `create_non_ann_model()`.
35
+ - Fungsi `validate_non_ann_model_name()` secara eksplisit menolak model neural (`ann`, `mlp`, `cnn`, `rnn`, `lstm`, `transformer`, `codebert`) demi menjamin transparansi keputusan dan bobot ringan.
36
+ 2. **Rekayasa `30` Fitur Statis Bebas *Target Leakage* (`FEATURE_SCHEMA_VERSION = "1.0.0"`):**
37
+ - Mengekstrak tujuh dimensi fitur murni dari konteks pemindaian (`string_stats`, `entropy`, `pattern_evidence`, `lexical_context`, `code_context`, `file_context`, serta `deterministic_signal`) tanpa pernah menyimpan nilai kredensial mentah (hanya `masked_value` dan `value_sha256`).
38
+ 3. **Validasi Silang Anti-Kebocoran Data (*Zero Data Leakage*):**
39
+ - Menyediakan `deduplicate_records()`, `resolve_cross_repo_value_duplicates()` berbasis *SHA-256*, `stratified_repository_split()` (`StratifiedGroupKFold`), serta `assert_no_leakage()` yang memastikan nol tumpang-tindih `repo_id` maupun `value_sha256` antara himpunan latih dan uji.
40
+ 4. **Kebijakan *Triage* Hibrida *Fail-Safe* (`TriagePolicy`):**
41
+ - Secara *default* beroperasi pada mode konsultatif (`suppress_false_positives=False`) sehingga seluruh temuan deterministik `SIDIK` tetap ditampilkan bersama probabilitas rahasia dan kontribusi fitur pendorongnya (`explain_single_candidate()`).
42
+ - Saat supresi diaktifkan, `never_suppress_severities=("CRITICAL",)` melindungi temuan kritis agar tidak pernah dibungkam diam-diam oleh model ML.
43
+ 5. **Integrasi Penuh *Plugin* (`sidik.plugins`) & *Thin Launcher* TUI/GUI/SCA:**
44
+ - Terdaftar ke grup `sidik.plugins` melalui [plugin.py](sidik_ml/plugin.py), sehingga perintah `sidik-ml interactive`, `sidik-ml gui`, dan `sidik-ml-gui` membuka antarmuka TUI serta *Desktop GUI* `SIDIK` dengan kontrol *ML Triage* aktif.
45
+ - `sidik-ml scan` mendukung `--include-deps` (OSV SCA) serta 7 format laporan (`console`, `sarif`, `github`, `html`, `markdown`, `json`, `csv`).
46
+ 6. **Serialisasi Luring Terverifikasi *SHA-256* (`skops`):**
47
+ - Artefak `.skops` selalu diverifikasi *checksum SHA-256*-nya (`verify_artifact_sha256` atau otomatis dari `<model>.manifest.json`) dan diperiksa terhadap daftar putih tipe aman (`SAFE_SKOPS_TYPE_PREFIXES`) tanpa `pickle`/`joblib` mentah.
48
+
49
+ ---
50
+
51
+ ## 🏗️ Arsitektur Integrasi Hibrida
52
+
53
+ ```text
54
+ Kode Sumber & Manifes Target
55
+ │
56
+ ▼
57
+ SIDIK v1.3.2 Core (SAST 12 Aturan Regex + Entropi + Konteks + Offline OSV SCA)
58
+ │
59
+ ├──[Kontrak SecretCandidate v1.0.0 (masked_value + value_sha256)]──┐
60
+ │ ▼
61
+ │ SIDIK-ML v0.5.2 Plugin
62
+ │ (30 Fitur Statis -> skops + SHA-256
63
+ │ -> Probabilitas + Explainability)
64
+ │ │
65
+ ◄──[sisipan metadata ml_triage & TriagePolicy Fail-Safe CRITICAL]───┘
66
+ │
67
+ ▼
68
+ CLI Interaktif (TUI) │ Desktop GUI │ 7 Format Laporan (HTML, SARIF v2.1.0, MD, JSON, CSV)
69
+ ```
70
+
71
+ ---
72
+
73
+ ## 📊 Ringkasan Hasil Empiris Terverifikasi
74
+
75
+ Seluruh angka di bawah tercatat pada eksperimen reproduksibel *SIDIK-ML* dengan `seed = 42`, *5-fold StratifiedGroupKFold*, `1.000` *bootstrap resamples*, dan uji *McNemar* pada dataset terbuka *Samsung/CredData* (`258` latih di `86 repo`, `64` *held-out test* di `23 unseen repo`), `25` repositori Python eksternal, serta `1.094` sampel *zero-shot CredDetX*:
76
+
77
+ ### 1. *Baseline* `SIDIK v1.1.0` vs Lima Model *Non-ANN* (*CredData Held-Out*, `N = 64`)
78
+
79
+ | Model / Kondisi | *5-Fold CV F1* | *Precision* Uji | *Recall* Uji | *F1-Score* Uji | MCC Uji | FPR Uji | *McNemar p* vs SIDIK |
80
+ | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
81
+ | **Kondisi A: `SIDIK v1.1.0`** | - | `0,8103` | `0,8868` | `0,8468` | `-0,1465` | `1,0000` | - |
82
+ | *Logistic Regression* | `0,8550 +- 0,0444` | **`1,0000`** | `0,8302` | `0,9072` | `0,6757` | **`0,0000`** | `0,15159` |
83
+ | *Decision Tree* | `0,8146 +- 0,1020` | `0,9000` | `0,8491` | `0,8738` | `0,3600` | `0,4545` | `0,45450` |
84
+ | *Random Forest* | `0,8949 +- 0,0236` | `0,9298` | **`1,0000`** | **`0,9636`** | **`0,7692`** | `0,3636` | **`0,000244`** |
85
+ | *Extra Trees* | `0,8957 +- 0,0408` | `0,9400` | `0,8868` | `0,9126` | `0,5604` | `0,2727` | `0,11532` |
86
+ | **`Gradient Boosting` (Pilihan CV)** | **`0,9028 +- 0,0249`** | `0,9038` | `0,8868` | `0,8952` | `+0,4178` | `0,4545` | `0,21011` |
87
+
88
+ * **Integrasi Hibrida & Pengaman *Fail-Safe* `CRITICAL`:** Pada Kondisi C1 (*Post-SIDIK Triage*), *Gradient Boosting* menekan FP sebesar `36,36%` dan memulihkan MCC ke `+0,1597` sembari melindungi `3` temuan `CRITICAL`; pada Kondisi C2 (*Candidate-Wide*), *Recall* mencapai `0,9057`, *F1* `0,8889`, dan MCC `+0,2923`.
89
+ * **Generalisasi Eksternal (`E1` & `E2`):** Pada 25 *repository* Python publik (`1.193` berkas `.py`), model menandai **`7 / 20` (`35,0%`) temuan deterministik sebagai *false positive*** dengan tambahan latensi hanya **`+3,6 ms` (`+0,15%`)** dan melindungi `4` temuan `CRITICAL` (`REVIEW_PRIORITY`). Pada uji *zero-shot CredDetX* (`1.094` kandidat) yang mengalami *domain shift*, konfigurasi hibrida `C1` menjaga stabilitas **`F1 = 0,7969` dan `MCC = +0,2075`**, mengungguli `SIDIK v1.1.0` murni (`MCC = +0,1999`) maupun model tunggal (`MCC = -0,2052`).
90
+ * ***Overhead* Inferensi Luring:** Inferensi *batch* `Gradient Boosting` hanya `1,00 ms` (`0,0156 ms/kandidat`), puncak memori `12,76 KB`, dan ukuran artefak `2.533,63 KB` (`.skops`).
91
+
92
+ ---
93
+
94
+ ## 📁 Struktur Paket
95
+
96
+ ```text
97
+ SIDIK-ML/
98
+ ├── .github/workflows/sidik-ml-ci.yml # CI otomatis pytest, plugin discovery, & CLI
99
+ ├── action.yml # Composite GitHub Action (SARIF & PR annotations)
100
+ ├── sidik_ml/
101
+ │ ├── __init__.py # Ekspor publik paket SIDIK-ML (v0.5.2)
102
+ │ ├── __main__.py # Titik masuk modul (python -m sidik_ml)
103
+ │ ├── cli.py # CLI scan, train, ekstrak fitur, TUI & GUI launchers
104
+ │ ├── plugin.py # Adapter entry point sidik.plugins (SidikMLPlugin)
105
+ │ ├── schemas.py # MLPrediction, HybridFinding, TriagePolicy
106
+ │ ├── features.py # 30 fitur statis bebas target leakage
107
+ │ ├── models.py # 5 model Non-ANN & neural exclusion guard
108
+ │ ├── dataset.py # JSONL I/O, deduplikasi SHA-256, StratifiedGroupKFold
109
+ │ ├── evaluation.py # F1, MCC, bootstrap CI, McNemar test, ablasi fitur
110
+ │ ├── explainability.py # Bobot model, permutation importance, penjelasan kandidat
111
+ │ ├── serialization.py # Save/load .skops aman terverifikasi SHA-256
112
+ │ ├── training.py # Pipeline pelatihan reproduksibel & provenans JSON
113
+ │ └── integration.py # HybridTriagePipeline (SIDIK + opsional ML classifier)
114
+ ├── tests/ # 18 unit & integration tests (pytest)
115
+ ├── pyproject.toml # Konfigurasi paket, dependencies, & entry points
116
+ ├── CHANGELOG.md
117
+ ├── LICENSE
118
+ └── README.md
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 🚀 Panduan Instalasi & Pemakaian Cepat
124
+
125
+ ### 1. Instalasi & Aktivasi Lingkungan (*Virtual Environment*)
126
+
127
+ `SIDIK-ML` menggunakan mesin inti, SCA OSV, CLI interaktif, serta GUI milik `SIDIK` (`sidik-security>=1.3.2`), sehingga keduanya harus dipasang di **lingkungan Python (`.venv`) yang sama**:
128
+
129
+ ```bash
130
+ # Dari direktori SIDIK-ML/ dengan venv SIDIK aktif
131
+ ..\SIDIK\.venv\Scripts\Activate.ps1 # Windows PowerShell
132
+ # source ../SIDIK/.venv/bin/activate # Linux / macOS
133
+
134
+ # Pasang SIDIK (bersama GUI) dan SIDIK-ML secara editable
135
+ pip install -e "..\SIDIK[gui]"
136
+ pip install -e .
137
+ ```
138
+
139
+ > **Catatan Windows PowerShell:** Apabila Anda membuka langsung folder `SIDIK\.venv\Scripts` tanpa menjalankan `Activate.ps1`, PowerShell tidak memuat perintah dari folder aktif secara otomatis. Gunakan awalan `.\` (misalnya `.\sidik-ml -i`, `.\sidik-ml --gui`, `.\sidik -i`, atau `.\sidik --gui`), atau aktifkan *virtual environment* terlebih dahulu dengan `.\Activate.ps1`. Jika skrip aktivasi terblokir kebijakan eksekusi PowerShell, jalankan lewat `python -m sidik_ml ...` atau gunakan peluncur `run_sidik_ml.bat` / `run_sidik_ml_cli.bat`.
140
+
141
+ ### 2. Perintah Harian (Selaras `sidik` dan `sidik-ml`)
142
+
143
+ Melalui *entry point* `sidik.plugins`, perintah `sidik-ml` dan `sidik` kini mendukung pola argumen yang simetris untuk TUI, *Desktop GUI*, pemindaian *one-shot*, modul `python -m`, serta 7 format laporan:
144
+
145
+ ```bash
146
+ # 1. Periksa versi atau luncurkan TUI / Desktop GUI (simetris dengan sidik -i / sidik --gui)
147
+ sidik-ml --version
148
+ sidik-ml -i # atau: sidik-ml interactive / python -m sidik_ml -i / run_sidik_ml_cli.bat
149
+ sidik-ml --gui # atau: sidik-ml gui / sidik-ml-gui / python -m sidik_ml --gui / run_sidik_ml.bat
150
+
151
+ # 2. Pindai langsung (argumen posisional / --target / scan) dengan ekspor HTML / SARIF / Markdown
152
+ sidik-ml .
153
+ sidik-ml --target path/to/project --include-deps --model model.skops --format html -o hasil_ml.html
154
+ sidik-ml scan path/to/project --include-deps --model model.skops --format html -o hasil_ml.html
155
+
156
+ # 3. Pindai dengan output ringkas konsol / JSON (tanpa supresi default)
157
+ sidik-ml scan path/to/project --json
158
+
159
+ # 4. Atau gunakan langsung dari perintah standar SIDIK
160
+ sidik --list-plugins
161
+ sidik --target path/to/project --enable-ml --ml-model model.skops
162
+
163
+ # 5. Ekspor fitur bebas leakage dari kandidat untuk anotasi / eksperimen
164
+ sidik-ml extract-features path/to/project --output candidates.jsonl --repo-id my_repo
165
+
166
+ # 6. Verifikasi integritas checksum SHA-256 artefak model .skops
167
+ sidik-ml verify-model model.skops --sha256 <hex_digest>
168
+
169
+ # 7. Latih & bandingkan 5 model Non-ANN menggunakan StratifiedGroupKFold
170
+ sidik-ml train dataset.jsonl --output-dir artifacts/ --stratified
171
+
172
+ # 8. Jalankan seluruh 18 unit & integration tests
173
+ pytest tests -v
174
+
175
+ # 9. Atau jalankan lewat GitHub Container Registry (ghcr.io) tanpa setup Python
176
+ docker run --rm -v "${PWD}:/workspace" ghcr.io/radityobw/sidik-ml:latest /workspace --include-deps
177
+ ```
178
+
179
+ ---
180
+
181
+ ## 🗺️ Ekosistem Perangkat Lunak Publik (*Public Software Ecosystem*)
182
+
183
+ | Repositori | Peran Utama | Versi Terkini | Tautan |
184
+ | :--- | :--- | :---: | :--- |
185
+ | **SIDIK** | Mesin pemindai deterministik SAST & OSV SCA + host *plugin* UI | `v1.3.2` | [`github.com/radityobw/SIDIK`](https://github.com/radityobw/SIDIK) |
186
+ | **SIDIK-ML** | Perangkat lunak ekstensi *Explainable Non-ANN ML* & *plugin* | `v0.5.2` | [`github.com/radityobw/SIDIK-ML`](https://github.com/radityobw/SIDIK-ML) |
187
+
188
+ ---
189
+
190
+ # 🇬🇧 English
191
+
192
+ ## 📌 Project Overview
193
+
194
+ **SIDIK-ML** (`v0.5.2`) is an independent Python package extending the deterministic [`SIDIK`](https://github.com/radityobw/SIDIK) (`>=v1.3.2`) security analyzer with **explainable classical Non-Artificial Neural Network (Non-ANN) machine learning** for false-positive reduction in hardcoded secret detection.
195
+
196
+ Instead of forking SIDIK's UI or introducing heavy deep learning weights, `SIDIK-ML` integrates through the leak-safe `SecretCandidate` (`schema_version = "1.0.0"`) contract and the standard `sidik.plugins` entry-point group. When launched via `sidik-ml gui`, `sidik-ml interactive`, or `--enable-ml`, the shared UI switches cleanly into an **Amber Orange (`#f59e0b` / `#ea580c`)** identity with `NON-ANN ML` badges, amber-yellow `sidik-ml>` console prompts, and warm orange-themed HTML/Markdown triage dashboards, clearly distinguishing hybrid ML analysis from Core SIDIK's **Ocean Blue (`#3b82f6`)** deterministic edition.
197
+
198
+ ## ✨ Key Capabilities
199
+
200
+ * **Strict Non-ANN Model Suite:** Evaluates *Logistic Regression*, *Decision Tree*, *Random Forest*, *Extra Trees*, and *Gradient Boosting*, backed by `validate_non_ann_model_name()` to reject neural network architectures.
201
+ * **30 Leakage-Free Static Features (`FEATURE_SCHEMA_VERSION = "1.0.0"`):** Extracts string statistics, Shannon entropy metrics, rule indicators, lexical cues, code structure, and file context without persisting raw credentials.
202
+ * **Zero Data Leakage Splitting & Verification:** Enforces cross-repo `value_sha256` collision resolution, `StratifiedGroupKFold` grouped by `repo_id`, and explicit `assert_no_leakage()` checks.
203
+ * **Fail-Safe Hybrid `TriagePolicy`:** Runs in advisory mode by default (`suppress_false_positives=False`) and shields `CRITICAL` findings (`never_suppress_severities=("CRITICAL",)`).
204
+ * **Hardened Offline `skops` Loading:** Validates `.skops` model digests against explicit SHA-256 checksums or companion `.manifest.json` files and restricts deserialization to `SAFE_SKOPS_TYPE_PREFIXES`.
205
+
206
+ ## 📊 Verified Empirical Highlights (`CredData` Held-Out `N = 64`, 25 Repos, & `CredDetX`)
207
+
208
+ | Model / Configuration | *5-Fold CV F1* | Test Precision | Test Recall | Test F1 | Test MCC | Test FPR |
209
+ | :--- | :---: | :---: | :---: | :---: | :---: | :---: |
210
+ | **Condition A: `SIDIK v1.1.0`** | - | `0.8103` | `0.8868` | `0.8468` | `-0.1465` | `1.0000` |
211
+ | *Logistic Regression* | `0.8550` | **`1.0000`** | `0.8302` | `0.9072` | `0.6757` | **`0.0000`** |
212
+ | *Random Forest* | `0.8949` | `0.9298` | **`1.0000`** | **`0.9636`** | **`0.7692`** | `0.3636` |
213
+ | **`Gradient Boosting` (CV Winner)** | **`0.9028`** | `0.9038` | `0.8868` | `0.8952` | `+0.4178` | `0.4545` |
214
+
215
+ On 25 external Python repositories (`1,193` `.py` files), the CV-selected model flags **`35.0%` (`7/20`) of deterministic alerts as false positives** with only **`+3.6 ms` (`+0.15%`) runtime overhead**. Under zero-shot domain shift on `CredDetX` (`1,094` candidates), fail-safe Hybrid Condition `C1` preserves **`F1 = 0.7969` and `MCC = +0.2075`**, outperforming both standalone deterministic SIDIK and unguarded ML classifiers.
216
+
217
+ ## 🚀 Quick Start
218
+
219
+ ```bash
220
+ # Install SIDIK and SIDIK-ML into the same virtual environment
221
+ ..\SIDIK\.venv\Scripts\Activate.ps1 # Windows PowerShell
222
+ # source ../SIDIK/.venv/bin/activate # Linux / macOS
223
+ pip install -e "..\SIDIK[gui]"
224
+ pip install -e .
225
+
226
+ # Check version and launch Amber-Orange SIDIK-ML Interactive CLI (TUI) or Desktop GUI (symmetric with sidik)
227
+ sidik-ml --version
228
+ sidik-ml -i --lang en # or: sidik-ml interactive / python -m sidik_ml -i / run_sidik_ml_cli.bat
229
+ sidik-ml --gui # or: sidik-ml gui / sidik-ml-gui / python -m sidik_ml --gui / run_sidik_ml.bat
230
+
231
+ # Run unified Secret + SCA scan (positional path, --target/-t, or `scan`)
232
+ sidik-ml .
233
+ sidik-ml --target path/to/project --include-deps --model model.skops --format html -o ml_report.html --lang en
234
+ sidik-ml scan path/to/project --include-deps --model model.skops --format html -o ml_report.html --lang en
235
+
236
+ # Run tests
237
+ pytest tests -v
238
+
239
+ # Run via GitHub Container Registry (ghcr.io) or install .whl from GitHub Releases
240
+ docker run --rm -v "${PWD}:/workspace" ghcr.io/radityobw/sidik-ml:latest /workspace --include-deps
241
+ ```
242
+
243
+ > **Windows PowerShell Note:** When running executables directly inside `SIDIK\.venv\Scripts` without activating `.venv` first, prefix commands with `.\` (e.g., `.\sidik-ml -i`, `.\sidik-ml --gui`) or invoke via `python -m sidik_ml ...` (or `run_sidik_ml.bat` / `run_sidik_ml_cli.bat`).
244
+
245
+ ## 📄 License
246
+
247
+ Distributed under the **MIT License**. See [LICENSE](LICENSE).
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sidik-ml"
7
+ version = "0.5.2"
8
+ description = "SIDIK-ML: Explainable Non-Neural Machine Learning Extension for SIDIK Static Security Analysis"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ {name = "Radityo Budi Waskito"},
15
+ {name = "Fauzi Nur Ibrahim"},
16
+ {name = "Raditya Ahmad Pratama"},
17
+ {name = "Zayyan Fadhlur Rahman"},
18
+ {name = "Muhammad Fahri Indra Saputra"},
19
+ {name = "Mohamad Hilman"}
20
+ ]
21
+ keywords = ["security", "sast", "secret-detection", "machine-learning", "explainable-ai", "non-neural"]
22
+ dependencies = [
23
+ "sidik-security>=1.3.2,<2.0.0",
24
+ "scikit-learn>=1.4.0",
25
+ "scipy>=1.11.0",
26
+ "skops>=0.9.0",
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ train = [
31
+ "numpy>=1.26.0",
32
+ "pandas>=2.1.0",
33
+ ]
34
+ explain = [
35
+ "shap>=0.45.0",
36
+ ]
37
+ dev = [
38
+ "pytest>=8.0.0",
39
+ "build>=1.0.0",
40
+ "twine>=5.0.0",
41
+ ]
42
+
43
+ [project.scripts]
44
+ sidik-ml = "sidik_ml.cli:main"
45
+ sidik-ml-gui = "sidik_ml.cli:launch_gui"
46
+
47
+ [project.entry-points."sidik.plugins"]
48
+ sidik-ml = "sidik_ml.plugin:create_plugin"
49
+
50
+ [project.urls]
51
+ Homepage = "https://github.com/radityobw/SIDIK-ML"
52
+ Repository = "https://github.com/radityobw/SIDIK-ML"
53
+ Upstream = "https://github.com/radityobw/SIDIK"
54
+
55
+ [tool.setuptools.packages.find]
56
+ where = ["."]
57
+ include = ["sidik_ml*"]
58
+
59
+ [tool.pyrefly]
60
+ search-path = [".", "../SIDIK"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+