WLBS Behavior Graph Scanner - static + dynamic curvature analysis for Python/JS codebases
Project description
wlbs-scan
English
A code scanner that learns from your failures. Every bug you fix makes it smarter for everyone.
What it does
wlbs-scan finds the files in your codebase most likely to fail next — before your tests do.
It builds a live risk map from your actual failure history. Every test run teaches it something. Pro users also draw from a shared pool of patterns distilled from real bug-fix sessions across the entire community.
Evidence — live server, March 2026
$ curl http://111.231.112.127:8765/health
{"status":"ok","total_crystals":1,"port":8765}
# Upload a trace → points awarded + rule distilled:
{"accepted":true,"rule_generated":true,"points_earned":0.4}
# Pro key pulls the rule back immediately:
{"crystals":[{"rule":"bug_fix (python): resolved in 3 turns.","confidence":1.0}]}
Full install-to-scan-to-rule cycle in under 60 seconds on any Python 3.8+ machine.
Install
pip install wlbs-scan
No extra dependencies. Works offline for local scan.
Sign up (free)
$ wlbs --register
wlbs-scan · sign up / sign in
==============================
Email: you@example.com
Sending verification code to you@example.com...
Code sent! Check your inbox.
Verification code: 482910
Account created! Signed in as you@example.com (tier: free)
Credentials saved to ~/.wlbs/config.json
You're all set. Run: wlbs . to start scanning.
That's it. No password. No credit card. Key is saved automatically.
Run wlbs --register again any time to sign back in on a new machine.
Quick start
# Scan your project — see the risk map
wlbs .
# Run tests + auto-record all results
wlbs . --pytest tests/
# See what the system has learned
wlbs . --history
# Get fix recommendations for hot files
wlbs . --suggest
Sample output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RISK MAP · 3 nodes · 1 singularity
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
██ rbac κ=0.847 ⚡ SINGULARITY
▓ roles κ=0.612
░ utils κ=0.201
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A singularity (κ ≥ 0.7, repeated failures) means: this file keeps breaking for structural reasons — fix it now.
All commands
| Command | What it does |
|---|---|
wlbs . |
Scan project + print risk map |
wlbs --register |
Sign up / sign in with email code |
wlbs . --pytest tests/ |
Run pytest + auto-record all results |
wlbs . --history |
Show what the system learned about your codebase |
wlbs . --suggest |
Fix recommendations for high-risk files |
wlbs . --diff |
Curvature delta since last scan |
wlbs . --blame src/foo.py |
Line-level git attribution for risky files |
wlbs . --export-html report.html |
Visual HTML risk report |
wlbs . --watch |
Re-scan on every file save |
wlbs . --lang js |
Scan JS/TS codebase |
wlbs . --ci |
Exit 1 if singularity detected (CI gate) |
wlbs . --context src/foo.py |
Resolution-decay context for a specific file |
wlbs . --dashboard |
Open heatmap web UI (Pro) |
wlbs . --status |
Show account tier and points balance |
wlbs --version |
Print version |
Free vs Pro
| Feature | Free | Pro ($9.9/mo) |
|---|---|---|
| Local risk scan | ✅ | ✅ |
| Sign up with email | ✅ | ✅ |
| Auto-record pytest results | ✅ | ✅ |
| Local world-line history | ✅ | ✅ |
| Singularity detection | ✅ | ✅ |
| Fix suggestions | Local only | Cloud-enhanced |
| Shared experience library | ✗ | ✅ |
| Auto rule downloads after each session | ✗ | ✅ |
Dashboard (--dashboard) |
✗ | ✅ |
| Points earn rate | 0.3× / upload | 0.5× / upload |
Points system: every trace you upload earns points. 100 points = 1 free Pro key (30-day). Points reset December 31.
Upgrade to Pro
Option 1 — Buy directly: Contact valhuang@kaiwucl.com or WeChat val001813. Receive your key immediately. Valid 30 days from first use.
Option 2 — Earn points: Keep using the free tier. Upload traces, accumulate points.
# Check your balance
wlbs . --status
pytest plugin (optional)
If you run pytest directly:
# conftest.py
pytest_plugins = ['wlbs_scan.wlbs_pytest_plugin']
pytest tests/ --wlbs .
CI / pre-commit
# .github/workflows/ci.yml
- name: Risk gate
run: wlbs . --ci --pytest tests/
# .git/hooks/pre-commit
wlbs . --ci
Self-validate
python -m wlbs_scan.validate
Runs 15 paper claims. All 15 pass on a clean install.
How it works
Every file gets a curvature κ ∈ [0, 1] from its failure/fix history and import-graph position. When a test fails, curvature propagates upstream (Aporia backprop: Δκ = α·λ^d). A singularity is a node where curvature stays high across multiple failure cycles — structural fragility, not random noise.
Full theory: PAPER.md | Patent: CN 2026103746505 · CN 2026103756225
License
BSL 1.1 — free for non-commercial use, research, internal evaluation. Commercial use requires a license. Auto-converts to Apache 2.0 on 2029-01-01.
Contact
Zhongchang Huang (黄中常) Email: valhuang@kaiwucl.com | WeChat: val001813 GitHub: val1813/wlbs-cli
中文
会从你的 bug 里学习的代码扫描器。你修的每一个 bug,都让它变得更聪明。
它是干什么的
wlbs-scan 找出你代码库里最可能下一个挂掉的文件 —— 在测试挂之前告诉你。
根据你真实的失败历史建立风险图,每次测试都在教它。Pro 用户还能从社区经验库里受益。
效果证明(2026年3月实测)
curl http://111.231.112.127:8765/health
→ {"status":"ok","total_crystals":1,"port":8765}
上传轨迹 → {"accepted":true,"rule_generated":true,"points_earned":0.4}
Pro 下载规则 → {"rule":"bug_fix (python): resolved in 3 turns.","confidence":1.0}
安装
pip install wlbs-scan
注册(免费)
$ wlbs --register
wlbs-scan · sign up / sign in
==============================
Email: 你的邮箱@example.com
发送验证码中...
验证码已发送!请查收邮件。
Verification code: 482910
账号已创建!已登录 你的邮箱@example.com(tier: free)
凭证已保存到 ~/.wlbs/config.json
现在可以运行: wlbs . 开始扫描
无需密码,无需信用卡。 key 自动保存,换新机器再跑一次 wlbs --register 即可。
快速开始
# 扫描项目,看风险图
wlbs .
# 跑测试,结果自动记录
wlbs . --pytest tests/
# 查看系统学到了什么
wlbs . --history
# 获取高风险文件修复建议
wlbs . --suggest
输出示例:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
风险图 · 3 个节点 · 1 个奇点
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
██ rbac κ=0.847 ⚡ 奇点
▓ roles κ=0.612
░ utils κ=0.201
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
奇点 = 反复在同一文件失败,结构性问题,不是随机 bug。
全部命令
| 命令 | 功能 |
|---|---|
wlbs . |
扫描 + 风险图 |
wlbs --register |
邮箱注册/登录 |
wlbs . --pytest tests/ |
跑测试 + 自动记录 |
wlbs . --history |
查看学习历史 |
wlbs . --suggest |
修复建议 |
wlbs . --diff |
曲率变化对比 |
wlbs . --blame src/foo.py |
行级 git 归因 |
wlbs . --export-html report.html |
HTML 可视化报告 |
wlbs . --watch |
文件变化监听 |
wlbs . --lang js |
扫描 JS/TS |
wlbs . --ci |
CI 门控(奇点时 exit 1) |
wlbs . --dashboard |
热力图 Web 界面 (Pro) |
wlbs . --status |
查看账户积分 |
免费版 vs Pro
| 功能 | 免费版 | Pro(¥70/月) |
|---|---|---|
| 本地风险扫描 | ✅ | ✅ |
| 邮箱注册登录 | ✅ | ✅ |
| pytest 自动记录 | ✅ | ✅ |
| 奇点检测 | ✅ | ✅ |
| 修复建议 | 仅本地 | 云端增强 |
| 共享经验库 | ✗ | ✅ |
| 规则自动下载 | ✗ | ✅ |
| 热力图 Dashboard | ✗ | ✅ |
| 积分获取速率 | 0.3×/次 | 0.5×/次 |
积分系统: 每次上传轨迹自动得分,100分兑换一个 Pro key(30天),每年12月清零。
升级 Pro
直接购买: 联系 valhuang@kaiwucl.com 或微信 val001813,收款后立即发 key。
积攒积分: 持续用免费版上传,攒够100分自动兑换。
wlbs . --status # 查看积分余额
CI 集成
- name: 风险门控
run: wlbs . --ci --pytest tests/
原理
每个文件有曲率 κ ∈ [0, 1],来自失败/修复历史和依赖图结构。测试失败时曲率沿 import 图传播(Aporia 反向传播:Δκ = α·λ^d),修复后衰减。奇点是多轮失败后曲率仍居高的节点——结构性脆弱。
完整理论:PAPER.md | 专利:CN 2026103746505 · CN 2026103756225
许可证
BSL 1.1:非商业免费,商业需授权,2029-01-01 转 Apache 2.0。
联系作者
黄中常 (Zhongchang Huang) 邮箱:valhuang@kaiwucl.com | 微信:val001813 GitHub:val1813/wlbs-cli
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wlbs_scan-0.6.2.tar.gz.
File metadata
- Download URL: wlbs_scan-0.6.2.tar.gz
- Upload date:
- Size: 13.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35013640a21e9f21f85ba21eeb73655717727cb2ae2c2a9469a6061506303be6
|
|
| MD5 |
71c0fed31634a786ed6a4c7b3d10a5c8
|
|
| BLAKE2b-256 |
94b178de9a0598586c07423486948cfbd8c60f0d63812ffca361b465ed41e058
|
File details
Details for the file wlbs_scan-0.6.2-py3-none-any.whl.
File metadata
- Download URL: wlbs_scan-0.6.2-py3-none-any.whl
- Upload date:
- Size: 47.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf26124fa9acd30d47022a3a247388aeb31cd4ea1c02cd43e9fd80152d1a9d5e
|
|
| MD5 |
564d15b94c2e8d561624ded460f69e5c
|
|
| BLAKE2b-256 |
cc004320829734872d922de0ef21b71741cc0db0bc87f09ca96bca988adff4b4
|