sober-audit 2.0.0__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.
Files changed (54) hide show
  1. sober_audit-2.0.0/LICENSE +21 -0
  2. sober_audit-2.0.0/PKG-INFO +450 -0
  3. sober_audit-2.0.0/README.md +415 -0
  4. sober_audit-2.0.0/pyproject.toml +66 -0
  5. sober_audit-2.0.0/setup.cfg +4 -0
  6. sober_audit-2.0.0/src/sober/__init__.py +7 -0
  7. sober_audit-2.0.0/src/sober/cli.py +491 -0
  8. sober_audit-2.0.0/src/sober/core/__init__.py +1 -0
  9. sober_audit-2.0.0/src/sober/core/ci.py +61 -0
  10. sober_audit-2.0.0/src/sober/core/config.py +89 -0
  11. sober_audit-2.0.0/src/sober/core/git_helper.py +174 -0
  12. sober_audit-2.0.0/src/sober/core/manifest.py +107 -0
  13. sober_audit-2.0.0/src/sober/core/registry_cache.py +82 -0
  14. sober_audit-2.0.0/src/sober/core/remediation.py +61 -0
  15. sober_audit-2.0.0/src/sober/core/sanitizer.py +78 -0
  16. sober_audit-2.0.0/src/sober/core/scanner.py +146 -0
  17. sober_audit-2.0.0/src/sober/core/scorer.py +176 -0
  18. sober_audit-2.0.0/src/sober/core/watcher.py +59 -0
  19. sober_audit-2.0.0/src/sober/detectors/__init__.py +47 -0
  20. sober_audit-2.0.0/src/sober/detectors/antipatterns.py +217 -0
  21. sober_audit-2.0.0/src/sober/detectors/chatter.py +54 -0
  22. sober_audit-2.0.0/src/sober/detectors/duplicates.py +88 -0
  23. sober_audit-2.0.0/src/sober/detectors/ghost_code.py +201 -0
  24. sober_audit-2.0.0/src/sober/detectors/hallucinations.py +550 -0
  25. sober_audit-2.0.0/src/sober/detectors/security.py +118 -0
  26. sober_audit-2.0.0/src/sober/detectors/slopsquatting.py +83 -0
  27. sober_audit-2.0.0/src/sober/ui/__init__.py +1 -0
  28. sober_audit-2.0.0/src/sober/ui/console.py +146 -0
  29. sober_audit-2.0.0/src/sober_audit.egg-info/PKG-INFO +450 -0
  30. sober_audit-2.0.0/src/sober_audit.egg-info/SOURCES.txt +52 -0
  31. sober_audit-2.0.0/src/sober_audit.egg-info/dependency_links.txt +1 -0
  32. sober_audit-2.0.0/src/sober_audit.egg-info/entry_points.txt +2 -0
  33. sober_audit-2.0.0/src/sober_audit.egg-info/requires.txt +7 -0
  34. sober_audit-2.0.0/src/sober_audit.egg-info/top_level.txt +1 -0
  35. sober_audit-2.0.0/tests/test_antipatterns.py +90 -0
  36. sober_audit-2.0.0/tests/test_chatter.py +36 -0
  37. sober_audit-2.0.0/tests/test_cli.py +51 -0
  38. sober_audit-2.0.0/tests/test_cli_advanced.py +105 -0
  39. sober_audit-2.0.0/tests/test_cli_v2.py +65 -0
  40. sober_audit-2.0.0/tests/test_config.py +64 -0
  41. sober_audit-2.0.0/tests/test_duplicates.py +77 -0
  42. sober_audit-2.0.0/tests/test_ghost_code.py +41 -0
  43. sober_audit-2.0.0/tests/test_git_helper.py +78 -0
  44. sober_audit-2.0.0/tests/test_hallucinations.py +85 -0
  45. sober_audit-2.0.0/tests/test_manifest.py +63 -0
  46. sober_audit-2.0.0/tests/test_registry_cache.py +34 -0
  47. sober_audit-2.0.0/tests/test_remediation.py +40 -0
  48. sober_audit-2.0.0/tests/test_scanner.py +113 -0
  49. sober_audit-2.0.0/tests/test_scorer.py +31 -0
  50. sober_audit-2.0.0/tests/test_security.py +29 -0
  51. sober_audit-2.0.0/tests/test_security_advanced.py +58 -0
  52. sober_audit-2.0.0/tests/test_security_v2.py +61 -0
  53. sober_audit-2.0.0/tests/test_slopsquatting.py +52 -0
  54. sober_audit-2.0.0/tests/test_watcher.py +41 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shenald-dev
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,450 @@
1
+ Metadata-Version: 2.4
2
+ Name: sober-audit
3
+ Version: 2.0.0
4
+ Summary: 🍸 The Vibe Coding Hangover Cure. Audit, sanitize, and proofread AI-generated code before pushing to production.
5
+ Author-email: Shenal Diluksha <shenald@users.noreply.github.com>
6
+ Maintainer-email: shenald-dev <shenald@users.noreply.github.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/shenald-dev/sober
9
+ Project-URL: Documentation, https://github.com/shenald-dev/sober#readme
10
+ Project-URL: Repository, https://github.com/shenald-dev/sober
11
+ Project-URL: Issues, https://github.com/shenald-dev/sober/issues
12
+ Project-URL: Changelog, https://github.com/shenald-dev/sober/blob/main/CHANGELOG.md
13
+ Keywords: ai,vibe-coding,code-quality,audit,security,cli,hangover,slop-detector
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Quality Assurance
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: rich>=13.7.0
29
+ Requires-Dist: typer>=0.12.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
33
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ <div align="center">
37
+
38
+ ```
39
+ ____ ____ ____ _____ ____
40
+ / ___/ __ \| __ )| ____| _ \
41
+ \___ \ | | | _ \| _| | |_) |
42
+ ___) | |_| | |_) | |___| _ <
43
+ |____/\____/|____/|_____|_| \_\
44
+ ```
45
+
46
+ <h3>🍸 sober</h3>
47
+ <p><b>The Vibe Coding Hangover Cure</b></p>
48
+ <i>Audit, sanitize, and proofread AI-generated code before pushing to production. Zero bloat. Maximum Flow.</i>
49
+
50
+ <br/><br/>
51
+
52
+ [![PyPI version](https://img.shields.io/pypi/v/sober-audit.svg?color=ff007f&style=for-the-badge)](https://pypi.org/project/sober-audit/)
53
+ [![Release](https://img.shields.io/github/v/release/shenald-dev/sober?color=ff007f&style=for-the-badge&logo=github)](https://github.com/shenald-dev/sober/releases)
54
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-00d4ff.svg?style=for-the-badge&logo=python&logoColor=white)](https://python.org)
55
+ [![License: MIT](https://img.shields.io/badge/License-MIT-00e676.svg?style=for-the-badge)](LICENSE)
56
+ [![CI Status](https://img.shields.io/badge/CI-Passing-00d4ff.svg?style=for-the-badge&logo=githubactions&logoColor=white)](https://github.com/shenald-dev/sober/actions)
57
+ [![Zero Bloat](https://img.shields.io/badge/Speed-%3C200ms-ff007f.svg?style=for-the-badge)](https://github.com/shenald-dev/sober)
58
+
59
+ </div>
60
+
61
+ ---
62
+
63
+ ## πŸ“‘ Table of Contents
64
+ - [⚑ The Problem: The Vibe Coding Hangover](#-the-problem-the-vibe-coding-hangover)
65
+ - [🌟 What is Sober?](#-what-is-sober)
66
+ - [πŸš€ Core Detection Pillars](#-core-detection-pillars)
67
+ - [⚑ Quick Start Guide](#-quick-start-guide)
68
+ - [πŸ’» CLI Usage & Commands](#-cli-usage--commands)
69
+ - [πŸ‘€ Real-Time Live Watcher (`sober watch`)](#-real-time-live-watcher-sober-watch)
70
+ - [πŸ€– Agent Self-Healing Remediation (`sober explain`)](#-agent-self-healing-remediation-sober-explain)
71
+ - [βš™οΈ Configuration (`sober.toml`)](#️-configuration-sobertoml)
72
+ - [πŸ›‘οΈ Native Git Hooks & CI/CD SARIF](#️-native-git-hooks--cicd-sarif)
73
+ - [πŸ—οΈ Architecture](#️-architecture)
74
+ - [🀝 Contributing](#-contributing)
75
+
76
+ ---
77
+
78
+ ## ⚑ The Problem: The Vibe Coding Hangover
79
+
80
+ You just spent 3 hours vibe-coding with **Claude Code**, **Cursor**, **Windsurf**, or **Copilot**. Your prototype spins up blindingly fast, but you have that familiar, sinking feeling:
81
+
82
+ - *Did the AI hallucinate a typosquatted package like `reqeusts` or `nummpy` that leaves you vulnerable to slopsquatting supply-chain malware?*
83
+ - *Did it invoke `requests.get()` or `fetch()` without a timeout, causing production processes to hang forever on network stalls?*
84
+ - *Did it generate authentication tokens using insecure `random.randint()` or `Math.random()`?*
85
+ - *Did it directly interpolate untrusted user strings into LLM prompt templates (`f"...{user_msg}..."`), opening prompt injection vulnerabilities?*
86
+ - *Did it leave 15 leftover `print(f"DEBUG: ...")`, `console.log("HERE")`, markdown code fences, and `debugger;` statements in production files?*
87
+ - *Did it embed conversational assistant comments like `// Certainly! Here is the updated code...` in source files?*
88
+ - *Did it silently swallow fatal database errors with `except: pass` or empty `catch {}` blocks?*
89
+ - *Did it commit a live OpenAI, Anthropic, Gemini, Groq, Supabase, Stripe, or Hugging Face API key directly into your git history?*
90
+ - *Did it disable TLS certificates (`verify=False`) or introduce unsafe deserialization vectors?*
91
+ - *Did it re-invent helper functions that already existed in your repository three folders away?*
92
+
93
+ Standard `git diff` was built for humans reviewing 5-line editsβ€”not humans auditing 500-line multi-file AI rewrites.
94
+
95
+ **Enter `sober`.**
96
+
97
+ ---
98
+
99
+ ## 🌟 What is Sober?
100
+
101
+ `sober` is an ultra-fast, zero-config CLI that audits your uncommitted git changes, branches, or entire repositories in **<200ms**. It detects AI-introduced hallucinations, slopsquatting, reliability antipatterns, conversational chatter, slop residue, silent error swallows, duplicate logic, and secret leaks, providing a crystal-clear **Sober Score (0–100%)** before you push to production.
102
+
103
+ ---
104
+
105
+ ## πŸš€ Core Detection Pillars
106
+
107
+ | Pillar | Detection Engine | Severity |
108
+ | :--- | :--- | :---: |
109
+ | πŸ§ͺ **Hallucination & Slopsquatting** | Cross-references new imports against local manifests, live PyPI/npm registries, and Damerau-Levenshtein similarity to popular libraries (e.g. `reqeusts` vs `requests`). | `CRITICAL` |
110
+ | πŸ›‘οΈ **Dangerous AI Antipatterns** | Catches omitted HTTP timeouts (`requests.get`, `fetch`), insecure pseudo-random tokens (`random.choice`), prompt injection vectors (`f"...{user_input}..."`), and client-side system prompt leakage. | `HIGH` / `CRITICAL` |
111
+ | πŸ”‘ **Secrets & Leaks** | Catches hardcoded OpenAI, Anthropic, Gemini, Groq, Supabase, Hugging Face, GitHub PATs, AWS, Stripe Live, Pinecone, Slack, Discord, SendGrid, and trivial default passwords. | `CRITICAL` |
112
+ | πŸ›‘οΈ **Vulnerability Vectors** | Detects raw SQL string formatting, `shell=True` command injection, disabled TLS/SSL (`verify=False`), unsafe pickle/YAML deserialization, and trivial JWT secrets. | `HIGH` |
113
+ | πŸ‘» **Ghost Code & Error Swallows** | Flags blank `except: pass`, empty `catch {}` blocks, empty promise catches, and dangling `debugger;` breakpoints. | `HIGH` |
114
+ | πŸ€– **AI Conversational Chatter** | Detects assistant prompt leakage and conversational text (`Certainly! Here is...`, `As an AI language model...`, `Let me know if you need adjustments`). | `LOW` *(Auto-Cureable)* |
115
+ | 🧩 **AST Duplication** | Catches AI agents re-inventing existing project helper utilities across files instead of importing them. | `MEDIUM` |
116
+ | 🧹 **Debug Debris & Fences** | Finds temporary `print(f"DEBUG...")`, `console.log("here")`, lingering breakpoints, and stray markdown code fences. | `LOW` *(Auto-Cureable)* |
117
+
118
+ ---
119
+
120
+ ## ⚑ Quick Start Guide
121
+
122
+ ### Installation
123
+
124
+ Install directly via `pip`:
125
+
126
+ ```bash
127
+ pip install sober-audit
128
+ ```
129
+
130
+ Or run directly with `pipx` or `uv`:
131
+
132
+ ```bash
133
+ pipx install sober-audit
134
+ # or
135
+ uv tool install sober-audit
136
+ ```
137
+
138
+ ---
139
+
140
+ ## πŸ’» CLI Usage & Commands
141
+
142
+ ### 1. Default Working Tree Audit
143
+ Audit your staged and uncommitted git changes instantly:
144
+
145
+ ```bash
146
+ sober scan
147
+ ```
148
+
149
+ ### 2. Air-Gapped Offline Audit (`--offline`)
150
+ Perform zero-network audits verifying dependencies strictly against local manifests and disk cache:
151
+
152
+ ```bash
153
+ sober scan --offline
154
+ ```
155
+
156
+ ### 3. Auto-Cure AI Residue & Chatter
157
+ Automatically strip leftover debug print statements, console logs, dangling debuggers, stray markdown fences, and AI chatter comments:
158
+
159
+ ```bash
160
+ sober scan --cure
161
+ # or via standalone cure command:
162
+ sober cure
163
+ ```
164
+
165
+ ### 4. Git Commit Range & PR Branch Auditing (`diff`)
166
+ Audit changes introduced across a PR branch or commit range:
167
+
168
+ ```bash
169
+ # Audit changes between main and current branch
170
+ sober diff main..HEAD
171
+
172
+ # Audit the last commit
173
+ sober diff HEAD~1
174
+ ```
175
+
176
+ ### 5. Full Repository Scan
177
+ Scan all files in the project instead of just git diff changes:
178
+
179
+ ```bash
180
+ sober scan --all
181
+ ```
182
+
183
+ ### 6. Strict Mode (Pre-Commit / CI)
184
+ Fails with exit code `1` if your **Sober Score** is below threshold (default: 95%) or if any critical issues are found:
185
+
186
+ ```bash
187
+ sober scan --strict
188
+ # Custom threshold:
189
+ sober scan --strict --min-score 90
190
+ ```
191
+
192
+ ### 7. GitHub Security SARIF & PR Markdown Export
193
+ Generate SARIF 2.1.0 for GitHub Code Scanning or Markdown summary tables for automated PR review comments:
194
+
195
+ ```bash
196
+ # Output SARIF format for GitHub Security tab
197
+ sober scan --sarif > sober-results.sarif
198
+
199
+ # Output GitHub Markdown table for PR comments
200
+ sober scan --markdown
201
+ ```
202
+
203
+ ### 8. Native Zero-Dependency Git Hook Manager
204
+ Install an automated pre-commit hook directly into `.git/hooks/pre-commit`:
205
+
206
+ ```bash
207
+ # Install hook
208
+ sober hook install
209
+
210
+ # Check hook status
211
+ sober hook status
212
+
213
+ # Remove hook
214
+ sober hook uninstall
215
+ ```
216
+
217
+ ### 9. Automated GitHub Actions CI Workflow Setup
218
+ Bootstrap `.github/workflows/sober-guard.yml` in one command:
219
+
220
+ ```bash
221
+ sober ci init
222
+ ```
223
+
224
+ ### 10. Project Configuration Initialization
225
+ Generate a starter `sober.toml` configuration file:
226
+
227
+ ```bash
228
+ sober init
229
+ ```
230
+
231
+ ---
232
+
233
+ ## πŸ‘€ Real-Time Live Watcher (`sober watch`)
234
+
235
+ Keep a live HUD open alongside your editor while vibe-coding with Cursor, Windsurf, or Claude Code:
236
+
237
+ ```bash
238
+ sober watch
239
+ # Custom polling interval:
240
+ sober watch --interval 0.5
241
+ # Auto-cure debris on save:
242
+ sober watch --cure
243
+ ```
244
+
245
+ Whenever files are saved, `sober` immediately re-audits the project and updates your sobriety score in real-time.
246
+
247
+ ---
248
+
249
+ ## πŸ€– Agent Self-Healing Remediation (`sober explain`)
250
+
251
+ Feed diagnostic audit context directly back to your AI coding agent (Claude Code, Cursor Agent, Copilot Workspace, Aider, Devin):
252
+
253
+ ```bash
254
+ sober explain
255
+ # Or pipe directly to clipboard / agent:
256
+ sober explain | your-agent-fixer
257
+ ```
258
+
259
+ Outputs a high-density, zero-hallucination directive containing exact file locations, code snippets, and unambiguous surgical instructions to fix every defect.
260
+
261
+ ---
262
+
263
+ ## βš™οΈ Configuration (`sober.toml`)
264
+
265
+ Configure `sober` on a workspace or project level using `sober.toml` or `pyproject.toml` (`[tool.sober]`):
266
+
267
+ ```toml
268
+ # sober.toml (v2.0)
269
+ [sober]
270
+ min_score = 95.0
271
+ fail_on_critical = true
272
+ max_workers = 10
273
+ offline_mode = false
274
+
275
+ # Paths to ignore during audits
276
+ ignore_paths = [
277
+ "tests/*",
278
+ "docs/*",
279
+ "migrations/*",
280
+ ]
281
+
282
+ # Allowed internal or proprietary packages that should never trigger hallucination alerts
283
+ allowed_packages = [
284
+ "@my-org/*",
285
+ "internal_company_sdk",
286
+ ]
287
+
288
+ # Disable specific detectors if needed
289
+ # disabled_detectors = ["duplicates"]
290
+
291
+ # Custom proprietary secret regex patterns
292
+ # [[sober.custom_secret_patterns]]
293
+ # name = "Company Internal API Token"
294
+ # pattern = "comp_[A-Za-z0-9]{32}"
295
+ ```
296
+
297
+ ---
298
+
299
+ ## πŸ›‘οΈ Native Git Hooks & CI/CD SARIF
300
+
301
+ ### Native Pre-Commit Hook
302
+
303
+ Install `sober` directly into your repository with zero third-party dependencies:
304
+
305
+ ```bash
306
+ sober hook install
307
+ ```
308
+
309
+ Now, every `git commit` automatically triggers `sober scan --strict`, preventing AI slop or accidental credential leaks from ever entering git history!
310
+
311
+ ### One-Command GitHub Actions CI Generator
312
+
313
+ ```bash
314
+ sober ci init
315
+ ```
316
+
317
+ Generates `.github/workflows/sober-guard.yml`:
318
+
319
+ ```yaml
320
+ name: SOBER Code Sobriety Radar
321
+
322
+ on:
323
+ pull_request:
324
+ branches: [main, master]
325
+ push:
326
+ branches: [main, master]
327
+
328
+ jobs:
329
+ sober-audit:
330
+ name: AI Hangover & Security Audit
331
+ runs-on: ubuntu-latest
332
+ steps:
333
+ - name: Checkout Code
334
+ uses: actions/checkout@v4
335
+ with:
336
+ fetch-depth: 0
337
+
338
+ - name: Set up Python
339
+ uses: actions/setup-python@v5
340
+ with:
341
+ python-version: "3.11"
342
+
343
+ - name: Install SOBER
344
+ run: pip install git+https://github.com/shenald-dev/sober.git
345
+
346
+ - name: Run SOBER Audit (SARIF & Markdown)
347
+ run: |
348
+ sober scan --all --sarif > sober.sarif
349
+ sober scan --all --markdown > sober-summary.md
350
+ cat sober-summary.md >> $GITHUB_STEP_SUMMARY
351
+ continue-on-error: true
352
+
353
+ - name: Upload SARIF to GitHub Code Scanning
354
+ uses: github/codeql-action/upload-sarif@v3
355
+ if: always()
356
+ with:
357
+ sarif_file: sober.sarif
358
+ category: sober-hangover-guard
359
+
360
+ - name: Strict Sobriety Gate
361
+ run: sober scan --all --strict --min-score 90
362
+ ```
363
+
364
+ ---
365
+
366
+ ## πŸ“Š Telemetry & The Sober Score
367
+
368
+ ```
369
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ πŸ“Š SOBRIETY HEALTH TELEMETRY ────────────────────────┐
370
+ β”‚ β”‚
371
+ β”‚ Sober Score: 100% [A+] β”‚
372
+ β”‚ State: 🧊 Crystal Sober (Production Ready) β”‚
373
+ β”‚ β”‚
374
+ β”‚ β€’ Critical Issues: 0 β€’ High: 0 β€’ Medium: 0 β€’ Low (Debris): 0 β”‚
375
+ β”‚ β€’ Auto-Fixable with --cure: 0 β”‚
376
+ β”‚ β”‚
377
+ β”‚ Scanned 18 files in 0.11s. β”‚
378
+ β”‚ β”‚
379
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
380
+ ```
381
+
382
+ - **95% – 100%** &rarr; `🧊 Crystal Sober`: Production ready, strictly typed, pristine flow.
383
+ - **80% – 94%** &rarr; `β˜• Mild Buzz`: Minor debug debris or unaddressed stubs detected.
384
+ - **60% – 79%** &rarr; `🍸 Noticeable Hangover`: Review required. High-risk patterns found.
385
+ - **< 60%** &rarr; `🚨 Complete Blackout`: Critical security vulnerabilities or hallucinated dependencies. **Do NOT deploy.**
386
+
387
+ ---
388
+
389
+ ## πŸ—οΈ Architecture
390
+
391
+ ```
392
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
393
+ β”‚ Git Workspace / Targetβ”‚
394
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
395
+ β”‚
396
+ β–Ό
397
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
398
+ β”‚ Scanner & Diff Engine β”‚ (Uncommitted changes,
399
+ β”‚ (git status & ranges) β”‚ commit diffs, or all)
400
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
401
+ β”‚
402
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
403
+ β–Ό β–Ό β–Ό
404
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
405
+ β”‚ Manifest Inspector β”‚ β”‚ Disk Registry β”‚ β”‚ Config Engine β”‚
406
+ β”‚ (package.json/pyproj)β”‚ β”‚ Cache (TTL) β”‚ β”‚ (sober.toml loader) β”‚
407
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
408
+ β”‚ β”‚ β”‚
409
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
410
+ β”‚
411
+ β–Ό
412
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
413
+ β”‚ Detection Pillar Pool β”‚
414
+ β”‚ β€’ Slopsquatting / PyPI β”‚
415
+ β”‚ β€’ Dangerous Antipatternsβ”‚
416
+ β”‚ β€’ Secrets & Webhooks β”‚
417
+ β”‚ β€’ AI Chatter & Fences β”‚
418
+ β”‚ β€’ Silent Error Swallows β”‚
419
+ β”‚ β€’ AST Duplication β”‚
420
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
421
+ β”‚
422
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
423
+ β–Ό β–Ό β–Ό
424
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
425
+ β”‚ Sobriety Radar β”‚ β”‚ Live Vibe Watch β”‚ β”‚ Agent Remediationβ”‚
426
+ β”‚ β€’ Terminal HUD β”‚ β”‚ β€’ File monitor β”‚ β”‚ β€’ sober explain β”‚
427
+ β”‚ β€’ SARIF 2.1.0 β”‚ β”‚ β€’ Real-time HUD β”‚ β”‚ β€’ Self-healing β”‚
428
+ β”‚ β€’ Markdown PR β”‚ β”‚ β€’ Auto-cure β”‚ β”‚ directive β”‚
429
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
430
+ ```
431
+
432
+ ---
433
+
434
+ ## 🀝 Contributing
435
+
436
+ Contributions are welcome! Please open an issue or PR on [GitHub](https://github.com/shenald-dev/sober).
437
+
438
+ ```bash
439
+ git clone https://github.com/shenald-dev/sober.git
440
+ cd sober
441
+ pip install -e ".[dev]"
442
+ pytest
443
+ ruff check .
444
+ ```
445
+
446
+ ---
447
+
448
+ ## πŸ“œ License
449
+
450
+ MIT License. Designed and built with ❀️ by [shenald-dev](https://github.com/shenald-dev).