bugx-cli 0.1.5 → 0.1.6

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 (86) hide show
  1. package/README.md +89 -210
  2. package/core/README.md +1 -1
  3. package/core/agent/agent_targets.py +5 -1
  4. package/core/agent/agent_workspace.py +10 -2
  5. package/core/autonomous_cve/run_fault_matrix.py +692 -0
  6. package/core/autonomous_cve/run_oss_cve_exploit_verify.py +608 -0
  7. package/core/autonomous_cve/run_six_worker_penetration.py +382 -0
  8. package/core/autonomous_cve/verifier.py +5 -7
  9. package/core/bugx.md +1 -1
  10. package/core/bugx_paths.py +2 -2
  11. package/core/bundled_docs/OVERVIEW.md +69 -236
  12. package/core/bundled_docs/README.md +2 -2
  13. package/core/bundled_docs/README_EN.md +67 -211
  14. package/core/bundled_docs/ai/01_AI_REFERENCE.md +3 -3
  15. package/core/bundled_docs/ai/02_AI_USAGE.md +1 -1
  16. package/core/bundled_docs/ai/03_AI_COMMANDS.md +1 -1
  17. package/core/bundled_docs/hosts/bugx_SKILL.md +2 -2
  18. package/core/bundled_docs/hosts/platform_bugx_SKILL.md +2 -2
  19. package/core/bundled_docs/manifest.json +10 -10
  20. package/core/bundled_docs/reference/04_REPOSITORY_TOPOLOGY.md +1 -1
  21. package/core/cloud_sync/flywheel_client.py +89 -0
  22. package/core/contracts/README.md +1 -1
  23. package/core/contracts/bugx-runtime-contract.md +1 -1
  24. package/core/contracts/bugx-worker.md +1 -1
  25. package/core/coverage/coverage_gate.py +12 -2
  26. package/core/coverage/coverage_manifest.py +1 -1
  27. package/core/coverage/coverage_validate.py +5 -3
  28. package/core/engine-integrity.json +104 -92
  29. package/core/host_runtime/adapters.py +45 -6
  30. package/core/host_runtime/autonomous_runner.py +3 -2
  31. package/core/host_runtime/host_registry.py +6 -1
  32. package/core/hosts/__init__.py +1 -0
  33. package/core/hosts/agnescode.py +1 -1
  34. package/core/hosts/base.py +1 -0
  35. package/core/hosts/claude.py +6 -0
  36. package/core/hosts/cline.py +6 -0
  37. package/core/hosts/codex.py +10 -1
  38. package/core/hosts/kimi.py +6 -4
  39. package/core/hosts/opencode.py +1 -1
  40. package/core/hosts/zcode.py +6 -0
  41. package/core/infra/README.md +1 -1
  42. package/core/infra/build_info.py +2 -2
  43. package/core/launch_phases/README.md +2 -2
  44. package/core/launch_phases/startup_gates.py +10 -1
  45. package/core/launch_phases/startup_version_gate.py +2 -2
  46. package/core/ledger/README.md +1 -1
  47. package/core/locales/en-US.json +2 -0
  48. package/core/locales/zh-CN.json +2 -0
  49. package/core/mcp_handlers/supervisor_handlers.py +33 -1
  50. package/core/mcp_handlers/telemetry_handlers.py +32 -0
  51. package/core/mcp_handlers/tool_table.py +34 -0
  52. package/core/metadata.txt +1 -1
  53. package/core/planning/README.md +1 -1
  54. package/core/retrieval/README.md +1 -1
  55. package/core/retrieval/symbol_index.py +2 -1
  56. package/core/retrieval/universal_code_matcher.py +1 -0
  57. package/core/runtime/README.md +1 -1
  58. package/core/runtime/mining_quality_framework.py +2 -1
  59. package/core/runtime/scenario_eval.py +5 -2
  60. package/core/supervisor/README.md +1 -1
  61. package/core/supervisor/worker_execution.py +5 -0
  62. package/docs/07_distribution/01_README_NPM.md +89 -210
  63. package/ecosystem/integrations/dsh/mcp/package.json +2 -2
  64. package/ecosystem/integrations/dsh/ui/package.json +1 -1
  65. package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +1 -1
  66. package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
  67. package/ecosystem/integrations/qoder/connector-meta.json +1 -1
  68. package/ecosystem/integrations/workbuddy/connector-meta.json +1 -1
  69. package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +1 -1
  70. package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +1 -1
  71. package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +1 -1
  72. package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +1 -1
  73. package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +2 -2
  74. package/interfaces/cli/bugx_cli/__init__.py +1 -1
  75. package/interfaces/cli/bugx_cli/commands/agent.py +18 -0
  76. package/interfaces/cli/bugx_cli/commands/audit.py +3 -5
  77. package/interfaces/cli/bugx_cli/commands/doctor.py +1 -1
  78. package/interfaces/cli/bugx_cli/commands/plugin.py +20 -0
  79. package/interfaces/cli/bugx_cli/commands/plugin_claude.py +2 -2
  80. package/interfaces/cli/bugx_cli/host_adapters.py +161 -1
  81. package/interfaces/cli/bugx_cli/hosts/registry.py +32 -0
  82. package/interfaces/cli/bugx_cli/infra/engine_installer.py +4 -4
  83. package/interfaces/cli/bugx_cli/infra/host_sync.py +1 -1
  84. package/package.json +1 -1
  85. package/scripts/sync-version.mjs +1 -1
  86. package/skills/platform/bugx/SKILL.md +2 -2
@@ -1,21 +1,16 @@
1
1
  <p align="center">
2
- <a href="README.md">中文</a> · English
2
+ <img src="core/assets/bugx-hero-en.svg" alt="BugX — Effortless audits of AI-written code" width="800">
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
- <img src="core/assets/bugx-hero-en.svg" alt="BugX — effortless audits of AI-written code" width="800">
6
+ <a href="README.md">中文</a> · English
7
7
  </p>
8
8
 
9
9
  # BugX — Autonomous Code Review & Automated Testing Agent
10
10
 
11
- BugX is an autonomous code review and automated testing agent that lives inside your AI coding assistant or runs standalone on the command line.
11
+ BugX is an **autonomous code review and automated testing agent** designed for AI coding assistants and CLI workflows.
12
12
 
13
- **It safeguards software delivery at every step:**
14
- - **For Developers**: Catches subtle, high-impact bugs immediately after code is written, eliminating painful debugging loops and rework.
15
- - **For QA & Test Engineers**: Automates black-box, functional, and performance testing across complex edge cases that manual reviews often miss.
16
- - **For Engineering Teams**: Guarantees code strictly meets functional contracts with rock-solid stability and resilience, ensuring dependable, crash-free releases.
17
-
18
- By replacing subjective self-reporting with automated, evidence-backed audits, BugX accelerates release velocity, elevates software quality, and reduces long-term maintenance costs. Supported environments include **Claude Code, OpenAI Codex, Cursor, Trae, Windsurf, Kimi Code, MiniMax Code, OpenCode, ZCode, Cline, DeepSeek Harness (DSH), WorkBuddy, and Qoder**.
13
+ It partitions codebases into deterministic audit units, orchestrates concurrent Workers to explore complex logic branches and edge cases, and deploys isolated verifiers to **execute sandboxed PoCs for real bug confirmation**. It eliminates AI hallucinations, premature "all good" claims, and false alarms, ensuring robust, crash-free software releases.
19
14
 
20
15
  <p align="center">
21
16
  <a href="https://pypi.org/project/bugx-cli/"><img src="https://img.shields.io/pypi/v/bugx-cli.svg?style=flat&color=0284c7&label=PyPI" alt="PyPI"></a>
@@ -27,252 +22,113 @@ By replacing subjective self-reporting with automated, evidence-backed audits, B
27
22
 
28
23
  🌐 Website: **https://bugx.dev**
29
24
 
30
- ## Contents
31
-
32
- - [The problem it solves](#the-problem-it-solves)
33
- - [Quick start](#quick-start)
34
- - [What a full audit looks like](#what-a-full-audit-looks-like)
35
- - [Supported AI coding tools](#supported-ai-coding-tools)
36
- - [Data and security](#data-and-security)
37
- - [Documentation](#documentation)
38
- - [Development](#development)
39
- - [License](#license)
25
+ ---
40
26
 
41
- ## The problem it solves
27
+ ### ✨ Key Features
42
28
 
43
- AI writes code faster than any human can review it. And the model carries a quirk that makes this worse: it cuts corners. That isn't malice — it's how the model was trained. Three mechanisms stack together:
29
+ - 🛡️ **Real Execution Verification (Zero False Alarms)**: Suspected flaws are verified in an isolated sandbox with dual positive tests and a clean negative control. Every finding carries executable PoC commands, exit codes, and output hashes.
30
+ - 📋 **Ledger-Tracked State Machine Coverage**: Codebases are decomposed into atomic units (covered / blocked / pending). Audits resume seamlessly across sessions, and completion is determined by ledger state—not conversational claims.
31
+ - 🔌 **Universal Host Integration via MCP / ACP**: Seamlessly plugs into Google Antigravity, Claude Code, Cursor, Trae, OpenAI Codex, OpenCode, Cline, Qoder, Kimi Code, MiniMax Code, and ZCode. Fully supports Gemini 4, Claude 5.5, and GPT-4o models.
32
+ - 📊 **Built-in Web Studio Dashboard**: Live interactive web interface (`bugx report serve`) visualizing coverage status, call chains, PoC proof artifacts, and mutation test efficacy.
44
33
 
45
- 1. **The grader rewards confidence.** The last stage of training is human raters scoring responses. One answer says "I checked it carefully, nothing found." Another says "I haven't finished reading the files." The first scores better — it sounds reliable and useful. So the model learns that reporting good news earns the reward.
46
- 2. **Checking is expensive; claiming is cheap.** Reading a few hundred files takes real work. Replying "no issues found" takes a few words. When both options sit on the table, the cheap one always wins.
47
- 3. **It doesn't know what it hasn't checked.** The model can't see its own coverage gaps, and nothing in training taught it to say "half done." So it says "done" — every time.
34
+ ---
48
35
 
49
- BugX replaces that with a ledger and four hard rules:
36
+ ### 🚀 Quick Start
50
37
 
51
- 1. **A coverage list.** Your project is split into audit units, each with a real status: checked, blocked, or not yet checked. Coverage is tracked, not assumed.
52
- 2. **Independent blind review & reproduction.** Suspicious findings are blind-reviewed by an isolated verification agent. The attack input must reproduce the bug twice, and a clean input must trigger zero times, backed by AST syntax anti-empty assertions. Refuted findings are logged to the FP Ledger to prevent repeat false alarms.
53
- 3. **It picks up where it left off.** Close your AI tool and reopen it later — the audit resumes from the last recorded step instead of starting over.
54
- 4. **Every verdict stays reviewable.** Who checked what, when, and on what evidence goes into the ledger line by line, with hash chaining between pages. Nothing gets edited quietly.
55
-
56
- ## Quick start
57
-
58
- Python `>=3.11`; the npm wrapper needs Node.js `>=18`.
59
-
60
- Install from PyPI:
38
+ #### 1. Install CLI (choose either)
61
39
 
62
40
  ```bash
63
- python -m pip install bugx-cli
64
- ```
41
+ # Python (>= 3.11)
42
+ pip install bugx-cli
65
43
 
66
- Or install from npm:
67
-
68
- ```bash
44
+ # or Node.js (>= 18)
69
45
  npm install -g bugx-cli
70
46
  ```
71
47
 
72
- Check and update using the server release matching your current install source:
48
+ #### 2. Configure Your AI Host
73
49
 
74
- ```bash
75
- bugx update --check # check only: 0=up-to-date, 1=update available, 2=check failed
76
- bugx update # update pip or npm wrapper installation
77
- bugx update --channel alpha # explicitly choose pre-release channel
78
- ```
79
-
80
- Then run this once from any directory:
50
+ Run this command once in your user home directory or target project root. BugX automatically detects installed AI coding assistants and configures MCP / plugins:
81
51
 
82
52
  ```bash
83
53
  bugx install
84
54
  ```
85
55
 
86
- > ⚠️ **Important (Restart Required)**: After configuring or updating project MCP settings, **completely restart your host IDE or AI coding assistant** (e.g., Cursor, Trae, VS Code, Kimi Code, MiniMax Code, ZCode) so the host process reloads the project-level MCP server configuration.
87
-
88
- CLI boolean flags are switches: pass `--force` to enable, omit it to disable. Do not pass `--force=True` or `force=True`.
89
- It lists every AI host it detects on your machine and walks you through picking one. To install everywhere at once, use `bugx install --agent all`.
90
-
91
- ### Connect the project to BugX Cloud
56
+ > 💡 **Tip**: After installation, **completely restart your host IDE / AI assistant**. For custom configurations, refer to the [Host Matrix and Dispatch Guide](guides/05_HOST_MATRIX_AND_DISPATCH.md).
92
57
 
93
- From the repository root, confirm the account, sync scope, and sensitive-data policy. Run `bugx auth login --root .` and check that `bugx auth status --root . --verify --json` reports the expected account and `auth_verified=true`.
58
+ ---
94
59
 
95
- When both the account-wide and project scopes are authorized, initialize a fresh project with `bugx init --root . --cloud-sync sync` and check the first transfer with `bugx cloud sync --root . --scope all`. Initialization installs `.agents/skills/bugx/SKILL.md`. Invoke `/bugx` or run `bugx guide "<query>"` for on-demand steps in a host that discovers project Skills there. For existing projects, use `bugx cloud sync --root . --scope all` after the full scope is authorized, then check the binding and queue with `bugx cloud status --root . --scope all --json`. This flow includes project registration and profile, project knowledge, and account-wide knowledge. Decline requests for partial sync.
60
+ ### 💬 How to Use
96
61
 
97
- ### Option 1: use it inside your AI assistant (recommended)
62
+ #### Option 1: Inside Your AI Coding Assistant (Recommended)
98
63
 
99
- No terminal and no commands to remember. Open your AI assistant in any project — Claude Code, Codex, Cline, OpenCode, ZCode — and just tell it what to check:
64
+ Open any configured project in Cursor, Claude Code, Antigravity, or ZCode, and prompt directly:
100
65
 
101
- **ZCode**
102
- ![Running a BugX audit in ZCode](core/assets/zcode.png)
103
-
104
- **Codex**
105
- ![Running a BugX audit in Codex](core/assets/codex.png)
106
-
107
- **DSH**
108
- ![Running a BugX audit in DSH](core/assets/dsh.png)
109
-
110
- > "Audit this project"
111
- > "Check the login module for vulnerabilities"
112
- > "Review the changes on this branch for security issues"
113
-
114
- The AI inside your host calls BugX on its own: it builds the coverage list, dispatches concurrent workers, runs probes, verifies the findings, and writes the report. To watch an audit live, run `bugx report serve` in a terminal and open **http://127.0.0.1:8080** — that's the full web report.
115
-
116
- ### Option 2: run it from the command line
117
-
118
- On the command line, the AI still comes from your installed hosts: BugX reuses the model and credentials you already configured there and never takes over your API keys (`--model` / `--provider` default to your host's configuration).
119
-
120
- Check the selected host and connection with `bugx doctor --root . --strict`. For a staged CLI run, follow the [lifecycle guide](guides/01_USER_GUIDE.md#8-从-pre-到-post-的完整生命周期) through execution, evidence review, and settlement. See the current stage with `bugx engine --root . status --json`.
121
-
122
- Or let BugX run the whole thing while you do something else:
123
-
124
- ```bash
125
- bugx autonomous --host opencode # model and credentials come from your OpenCode setup
126
- # or give it a target:
127
- bugx goal --host opencode "audit this project's login and payment flows"
128
- ```
129
-
130
- Fixes and outputs are command-line work too:
131
-
132
- ```bash
133
- bugx test-generate ... # generate AAA tests or a self-contained PoC for a unit
134
- bugx test-verify ... # mutate the code to prove your tests catch real bugs
135
- bugx patch-forge --from-issue <id> --diff fix.diff --repro repro.md --test test_ok.py --dry-run
136
- ```
66
+ > "Audit this project"
67
+ > "Check the authentication service for concurrency issues and exception leaks"
68
+ > "Review changes on this branch and provide reproducible PoC verification commands"
137
69
 
138
- `patch-forge` builds a patch bundle and runs static checks on it. It produces the bundle but commits nothing — remove `--dry-run` once you've reviewed it.
70
+ The host AI will autonomously orchestrate BugX Workers, execute sandbox probes, and confirm findings with real reproduction.
139
71
 
140
- Open the web UI for reports (during or after an audit):
72
+ #### Option 2: Autonomous CLI Execution
141
73
 
142
74
  ```bash
143
- bugx report serve # then open http://127.0.0.1:8080 for live coverage, evidence, and findings
144
- ```
75
+ # Autonomous end-to-end audit (reuses credentials from your host assistant)
76
+ bugx autonomous --host opencode
145
77
 
146
- For offline archives, export a static report:
147
-
148
- ```bash
149
- bugx report both --format html --out report.html
78
+ # Launch real-time web dashboard (opens http://127.0.0.1:8080)
79
+ bugx report serve
150
80
  ```
151
81
 
152
- See the host table below for valid `--agent` values; `bugx hosts` lists every environment detected on this machine with its capabilities.
82
+ ---
153
83
 
154
- ## What a full audit looks like
84
+ ### 🖥️ BugX Studio Web Dashboard
155
85
 
156
- 1. **pre (with the game plan).** BugX enumerates your source and configuration files, then builds a minimal list of audit units (single modules plus cross-module business flows). Before anything runs, you get a plan with five decisions in one pass: **cloud sync** (sign in and sync lessons and experience, or explicitly choose offline use), **review mode**, **polling strategy**, **fix mode**, and **commit handling**. Confirm the actual sync scope and review policies presented by the startup gates.
157
- 2. **Workers fan out.** The host hands audit units to concurrent workers. Each worker takes a lease, sends heartbeats, runs probes, and commits checkpoints.
158
- 3. **Evidence lands on disk.** Every worker conclusion carries the command it ran, the exit code, and the artifact hash. Coverage is only ever `covered` or `blocked` — "roughly checked" doesn't exist here.
159
- 4. **Findings get adjudicated.** Candidate bugs first go through the engine's verification channel: two positive runs plus a negative control, executed for real. Only then are they confirmed or rejected, and a rejection needs a stated reason.
160
- 5. **post.** Coverage and findings are cross-checked and the audit settles. Whether it's actually done is decided by the state machine's final state — the model saying "done" doesn't count.
161
- 6. **The report.** `bugx report both --format html --out report.html` produces the formal and visual reports; `bugx report serve` starts the live preview.
162
-
163
- ## A look at the interface
164
-
165
- BugX ships with BugX Studio, a web workbench. Run `bugx report serve` and open http://127.0.0.1:8080:
86
+ Run `bugx report serve` anytime to inspect audit topology, evidence chains, and verified findings:
166
87
 
167
88
  <p align="center">
168
- <img src="core/assets/webui-studio.jpg" alt="BugX Studio workbench" width="860">
89
+ <img src="core/assets/webui-studio.jpg" alt="BugX Studio Dashboard" width="860">
169
90
  </p>
170
91
 
171
- The workspace covers every connected host, and each host keeps its own audit sessions (the sidebar shows ChatGPT, ZCode, Claude, Codex, DSH, OpenCode, Pi, and more):
172
-
173
- <p align="center">
174
- <img src="core/assets/webui-chatgpt.jpg" alt="ChatGPT workspace" width="420">
175
- <img src="core/assets/webui-zcode.jpg" alt="ZCode workspace" width="420">
176
- </p>
177
-
178
- The skill marketplace ships with `/audit` (one-shot full-surface audit with a dual-track report), `/review` (structured findings for branch changes), `/mining` (attack-surface survey and hardening), `/fix` (defensive patches with sandboxed regression), and `/test` (AAA tests with mutation-kill scoring):
179
-
180
- <p align="center">
181
- <img src="core/assets/webui-skills.jpg" alt="Skill marketplace" width="860">
182
- </p>
183
-
184
- ## What it can do
185
-
186
- **Audit**
187
- - **Code review**: bugs and defects, classified by logic / state / boundary / exception / concurrency / performance / resource.
188
- - **Functionality review**: business-flow audit plus a behavior diff — feed the same inputs to your implementation and a reference implementation, then compare what differs.
189
- - **Performance and memory**: performance and resource bugs, plus dedicated memory checks for six target families: native, Python, JVM, Electron, Android, and Apple.
190
- - **UI audit**: layout, contrast, keyboard paths, and design tokens on a running web page (`bugx probe ui`).
92
+ ---
191
93
 
192
- **Reproduce and verify**
193
- - Every finding ships with a command or input you can run yourself: the same bad input breaks it twice, a clean input breaks nothing, and all three runs stay on record.
194
- - Your tests get graded too: `bugx test-verify` mutates your code to check whether the tests actually catch the bugs.
94
+ ### 🔌 Supported AI Coding Hosts
195
95
 
196
- **Fixes and outputs**
197
- - Generate AAA test cases or self-contained PoCs (`bugx test-generate`).
198
- - Build patch bundles with static checks, delivered for your review — never committed for you (`bugx patch-forge`).
199
- - Write reports (`bugx report`).
200
-
201
- **Long term**
202
- - **A lessons base**: sync verified lessons and experience with `bugx cloud sync` in the authorized scope. Use `bugx lesson retrieve` to look up a symptom or module in the next review.
203
- - **Unattended runs**: follow your host (`bugx autonomous`), run toward a goal (`bugx goal`), or keep a resident daemon (`bugx daemon`).
204
- - **Diagnostics & feedback**: `bugx doctor` / `bugx log` / `bugx stats` for installation, logs, and usage; use `bugx issue report` or `bugx feedback` to package sanitized local diagnostics and submit feedback directly.
205
- - **Official documentation (Remote-First)**: built-in `bugx-docs` MCP server and `bugx guide` CLI command, connecting directly to official endpoints by default with seamless local fallback when offline.
206
-
207
- ## FAQ
208
-
209
- **What is BugX?**
210
- An autonomous code-audit agent that lives inside AI coding assistants: it runs via MCP in Claude Code, Codex, Cline, OpenCode, and ZCode, or as a standalone CLI, tracks audit coverage per unit, and verifies every finding with real executions.
211
-
212
- **Which AI coding tools does BugX support?**
213
- BugX currently supports **Claude Code, OpenAI Codex, Cursor, Trae, Windsurf, Kimi Code, MiniMax Code, Google Antigravity, Cline / Roo Code, OpenCode, ZCode, DeepSeek Harness (DSH), WorkBuddy, and Qoder**, with continuous adaptations across the Model Context Protocol (MCP) ecosystem.
214
-
215
- **How does BugX verify a vulnerability?**
216
- Rather than trusting the proposing model's self-report, findings are independently blind-reviewed: an attack input must reliably trigger the vulnerability twice, and a clean input must trigger zero times (two positive runs, one negative control) recorded with command, exit code, and artifact hashes, verified by AST syntax assertions. Refuted findings are recorded in the FP Ledger.
217
-
218
- **Does BugX trigger AI model cyber-security risk blocks?**
219
- BugX includes a declarative Prompt Policy Engine with adaptive prompt profiles (e.g., defensive QA phrasing for OpenAI Codex / GPT-4o) that prevents models from triggering platform Daybreak / Cyber Risk safety blocks, while preserving 100% of the underlying code and CWE details.
220
-
221
- **Does BugX send my code to the cloud?**
222
- The audit itself runs locally. Enabling lesson and experience sync can trigger transfers at startup and after eligible ledger writes. Check the authorized scope and sensitive-data policy before enabling sync.
223
-
224
- **Does BugX replace human review?**
225
- No. It gives you a reviewable ledger — what was checked, what wasn't, and reproducible evidence per finding — so human review starts from facts instead of the model's self-report.
226
-
227
- **What languages does BugX audit?**
228
- Multi-language static and behavioral analysis (Python, JavaScript/TypeScript, Java, Go, Rust, and more via tree-sitter), plus dedicated memory checks for native, Python, JVM, Electron, Android, and Apple targets.
229
-
230
- ## Supported AI coding tools
231
-
232
- | AI coding tool | Integration | Install command |
96
+ | Host Assistant | Integration Protocol | Setup Command |
233
97
  | :--- | :--- | :--- |
234
- | **Claude Code** | Native MCP / autonomous lifecycle | `bugx install --agent claude` |
235
- | **OpenAI Codex** | Workspace subagents / native plugin | `bugx install --agent codex` |
236
- | **Cursor / Trae / Windsurf** | Native project-level MCP integration | `bugx install --agent cursor` |
237
- | **Kimi Code** | Managed plugin / project MCP | `bugx install --agent kimi` |
238
- | **MiniMax Code** | Plugin V1 package / agent & MCP | `bugx install --agent minimax` |
239
- | **Google Antigravity** | Native Agent/Worker, Skills, project-level Supervisor/Worker/docs MCP, ACP direct passthrough | `bugx install --agent antigravity` |
240
- | **Gemini / Gemini Code** | Native MCP connection / automated audit pipelines (Full Gemini 4 Carbon / Neon support) | `bugx install --agent gemini` or standard MCP |
241
- | **OpenCode** | Headless ACP / native MCP | `bugx install --agent opencode` |
242
- | **Cline / Roo Code** | MCP chat sessions / multi-process concurrency | `bugx install --agent cline` |
243
- | **ZCode** | Native MCP / user-level MCP registration | `bugx install --agent zcode` |
244
- | **DeepSeek Harness (DSH)** | Desktop launcher / managed plugin & MCP | `bugx install --agent dsh` |
245
- | **WorkBuddy / Qoder** | Connector meta / native extension | `bugx install --agent workbuddy` |
246
-
247
- Run `bugx hosts` to see all environments detected on your machine.
248
-
249
- ## Data and security
250
-
251
- - Project state lives in the project's `.bugx/` directory; the global engine, credentials, knowledge base, and caches live in a user-level BugX directory.
252
- - Credentials are written to a controlled sandbox when needed (readable only by the current user by default). `bugx auth status` reports whether credentials exist — it never prints them. A model name is not a credential.
253
- - Knowledge sync uses the configured scope and sensitive-data policy. Bundle uploads, diagnostic log reports, and feedback have separate commands and data boundaries.
254
- - `reset` / `uninstall` / `purge` / `--no-backup` delete data. Check each command's dry-run and backup behavior first.
98
+ | **Google Antigravity** | Native Agent/Worker, Skill, Project MCP | `bugx install --agent antigravity` |
99
+ | **Claude Code** | Native MCP / Autonomous Lifecycle | `bugx install --agent claude` |
100
+ | **OpenAI Codex** | Workspace Sub-Agent / Native Plugin | `bugx install --agent codex` |
101
+ | **OpenCode** | Native ACP / Multi-Agent Concurrency / Project MCP | `bugx install --agent opencode` |
102
+ | **Cline / Roo Code** | Isolated Data Sandbox / Project Agent / User MCP | `bugx install --agent cline` |
103
+ | **Qoder AI** | Native Agent/Worker, Subagent Concurrency, User/Project MCP | `bugx install --agent qoder` |
104
+ | **Trae / Trae CN** | Project Agent, Multi-variant MCP Sync Mirror | `bugx install --agent trae` |
105
+ | **DeepSeek Harness (DSH)** | Native Headless Profile / Cordis Patch / MCP Injection | `bugx install --agent dsh` |
106
+ | **Kimi Code** | Headless ACP / Native MCP Plugin | `bugx install --agent kimi` |
107
+ | **MiniMax Code** | Custom Agent, Plugin V1 Worker, Skill & MCP | `bugx install --agent minimax` |
108
+ | **ZCode** | Native MCP / User-Level Registry | `bugx install --agent zcode` |
109
+ | **Agnes Code** | Terminal Native TUI / Agent MCP Injection | `bugx install --agent agnescode` |
110
+ | **WorkBuddy / CodeBuddy** | Native Skill, Desktop Multi-variant Mirror, Project MCP | `bugx install --agent workbuddy` |
111
+ | **GitHub Copilot** | Project Agent/Instructions, User Agent, Project MCP | `bugx install --agent copilot` |
112
+ | **Cursor / Windsurf** | Standard User/Project MCP Integration | `bugx install` (auto-detected) |
255
113
 
256
- ## Documentation
114
+ ---
257
115
 
258
- The documentation is written in Chinese:
116
+ ### 📚 Documentation
259
117
 
260
- - [User guide](guides/01_USER_GUIDE.md): installation, configuration, host capabilities, lifecycle, MCP/ACP, cloud scope, results, and recovery.
261
- - [Command reference](guides/02_COMMANDS.md): every command, argument, default, scope, side effect, and exit behavior.
262
- - [Troubleshooting](guides/03_TROUBLESHOOTING.md) covers common symptoms and recovery steps.
263
- - The [BugX skill](hosts/platform_bugx_SKILL.md) and `bugx guide` cover on-demand setup, cloud sync, evidence review, and lesson reuse.
264
- - [UI audit (probe ui)](guides/02_COMMANDS.md#63-probe): responsive layout, contrast, keyboard paths, and design tokens on a running web UI.
265
- - [AI reference](ai/01_AI_REFERENCE.md): MCP, lifecycle, state, evidence, and failure contracts for hosts and agents.
266
- - `Docs index` (`docs/README.md`): architecture and documentation navigation (including 5 topic cookbooks in `docs/01_guides/04_*`..`08_*`, packaged into `core/bundled_docs/` for instant offline `bugx guide` / `bugx-docs` queries and versioned cloud hot-sync).
118
+ - [User Guide](guides/01_USER_GUIDE.md): Complete setup, audit lifecycle, MCP/ACP usage, and recovery.
119
+ - [CLI Reference](guides/02_COMMANDS.md): Full command index and flag definitions.
120
+ - [Host Matrix & Dispatch Guide](guides/05_HOST_MATRIX_AND_DISPATCH.md): Host-specific configurations.
121
+ - [Troubleshooting](guides/03_TROUBLESHOOTING.md): Problem diagnosis and self-healing recipes.
122
+ - `Architecture & Design` (`docs/02_architecture/01_ARCHITECTURE.md`): State machine, ledger integrity, and verification engines.
267
123
 
268
- ## Development
124
+ ---
269
125
 
270
- Repository conventions (docs sync, version contract, verification gates) live in `AGENTS.md` (`AGENTS.md`); architecture and internal design live in [docs/02_architecture/](docs/02_architecture/). Before committing, run `python3 scripts/bump_version.py --check`.
126
+ ### 🔍 Keywords
271
127
 
272
- ## Keywords
128
+ Google Antigravity · Gemini 4 · Gemini 4 Carbon · Gemini 4 Neon · Gemini Code Assist · G4 Model · Claude 5.5 · Claude Sonnet 5.5 · Claude Opus 5.5 · Claude Code Audit · GPT-4o Code Review · Autonomous Code Review · Automated Code Audit · AI Code Review · Code Review Agent · AI Agent · Vibe Coding Security · PR Review · Zero False Positive · PoC Verification · Blind Verification · Security Audit · Vulnerability Scanner · Static Analysis · MCP Server · MCP Security · Cursor · Windsurf · Trae · OpenAI Codex · OpenCode · Cline · Qoder · GitHub Copilot · DeepSeek Harness · Behavior Diff · Memory Leak Detection · Python Security · JavaScript Security · DevSecOps
273
129
 
274
- Google Antigravity · Antigravity IDE · Gemini 4 · Gemini 4 Carbon · Gemini 4 Neon · Gemini · Gemini Code Assist · G4 models · Claude 5.5 · Claude Sonnet 5.5 · Claude Opus 5.5 · Claude Code review · GPT-4 code review · vibe coding · vibe coding security · pr review · pull request review · zero false positive · poc generator · mcp security · automated code audit · ai code audit · automated code review · code review agent · ai agent · security audit · vulnerability scanner · vulnerability mining · sast · static analysis · mcp server · claude code · openai codex · opencode · cline · zcode · coding agent · llm code review · autonomous audit · behavior diff · memory leak detection · python security · javascript security · devsecops
130
+ ---
275
131
 
276
- ## License
132
+ ### 📄 License
277
133
 
278
- [Business Source License 1.1](LICENSE).
134
+ Licensed under the [Business Source License 1.1](LICENSE).
@@ -2,9 +2,9 @@
2
2
  title: BugX AI Host and Worker Reference
3
3
  audience: AI hosts and native agents
4
4
  status: DOCUMENTATION_UNVERIFIED
5
- version: 0.1.5
5
+ version: 0.1.6
6
6
  protocol: MCP 2024-11-05
7
- server: bugx-supervisor 0.1.5
7
+ server: bugx-supervisor 0.1.6
8
8
  last-verified: 2026-11-17
9
9
  ---
10
10
 
@@ -355,7 +355,7 @@ report source 语义:
355
355
 
356
356
  protocolVersion: 2024-11-05
357
357
  serverName: bugx-supervisor
358
- serverVersion: 0.1.5
358
+ serverVersion: 0.1.6
359
359
  hostHeartbeatIntervalSeconds: 5.0
360
360
  transport: local stdio
361
361
 
@@ -1,6 +1,6 @@
1
1
  # BugX AI 使用指南
2
2
 
3
- > **版本**:0.1.5 | **更新日期**:2026-11-26
3
+ > **版本**:0.1.6 | **更新日期**:2026-11-26
4
4
  > **定位**:给宿主 AI 的任务型操作指南
5
5
  > **相关文档**:[AI Reference](01_AI_REFERENCE.md) | [AI 命令手册](03_AI_COMMANDS.md) | [用户故障排查](../guides/03_TROUBLESHOOTING.md)
6
6
 
@@ -1,6 +1,6 @@
1
1
  # BugX AI 命令选路与使用手册
2
2
 
3
- > **版本**:0.1.5 | **更新日期**:2026-11-26
3
+ > **版本**:0.1.6 | **更新日期**:2026-11-26
4
4
  > 本手册按当前仓库 CLI 解析器整理,覆盖 45 个顶层命令及分组 leaf。宿主和全局引擎可能独立升级;当前安装版的安全帮助入口、命令分发源码与本手册共同确定语法。完整参数表见 [02_COMMANDS.md](../guides/02_COMMANDS.md),生命周期与协议细节见 [01_AI_REFERENCE.md](01_AI_REFERENCE.md)。
5
5
 
6
6
  ## AI 选命令的固定步骤
@@ -2,7 +2,7 @@
2
2
  name: bugx
3
3
  description: BugX 是一个具备自主代码审查与测试能力的智能体,严把代码交付关:它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能符合要求、具备良好的健壮性和稳定性。让开发和测试在繁琐的工作中解放双手,大幅提高工作效率、全面提升代码质量、显著降低后期维护成本,实现科技服务于人。
4
4
  metadata:
5
- bugx_version: "0.1.5"
5
+ bugx_version: "0.1.6"
6
6
  ---
7
7
  <!-- bugx-locale: zh-CN -->
8
8
 
@@ -10,7 +10,7 @@ metadata:
10
10
 
11
11
  BugX ChatGPT Skill 镜像。执行前用 `bugx engine path --name AGENT_GUIDE.md` 和 `bugx engine path --name bugx.md` 读取全局协议;项目 `.bugx/` 只保存状态与配置。
12
12
 
13
- 协议镜像版本:0.1.5
13
+ 协议镜像版本:0.1.6
14
14
 
15
15
  ## ChatGPT 原生交互适配(强制)
16
16
 
@@ -2,7 +2,7 @@
2
2
  name: bugx
3
3
  description: BugX 深度代码审查与缺陷挖掘智能体。提供自主缺陷挖掘、敏捷单点复现(PoC)、环境体检及知识检索能力。
4
4
  metadata:
5
- bugx_version: "0.1.5"
5
+ bugx_version: "0.1.6"
6
6
  ---
7
7
  <!-- bugx-locale: zh-CN -->
8
8
 
@@ -10,7 +10,7 @@ metadata:
10
10
 
11
11
  BugX 核心协议镜像。执行前可通过 `bugx engine path --name bugx.md` 读取完整规范;项目 `.bugx/` 保存运行态与账本。
12
12
 
13
- 协议镜像版本:0.1.5
13
+ 协议镜像版本:0.1.6
14
14
 
15
15
  ## 1. 意图分流决策树 (Triage Decision Tree)
16
16
  拿到任务第一秒,判定属于哪个分支:
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "contract_version": "0.1.5",
3
+ "contract_version": "0.1.6",
4
4
  "file_count": 22,
5
- "total_bytes": 487265,
5
+ "total_bytes": 457959,
6
6
  "files": [
7
7
  {
8
8
  "path": "OVERVIEW.md",
9
9
  "source": "README.md",
10
- "bytes": 24120,
11
- "sha256": "b6739dc0b8a481194341abdfff915cbdfa0ddb926f77069ce3bd2225af2459c7"
10
+ "bytes": 7511,
11
+ "sha256": "8a272498e1a5c41da161a865a81d1458e76cf845f1a5a21392a758bc38a7ace4"
12
12
  },
13
13
  {
14
14
  "path": "README_EN.md",
15
15
  "source": "README_EN.md",
16
- "bytes": 19675,
17
- "sha256": "badb439d333a4d2ab501e8a27af07fa852831b4bb9a215b29d09134f5b5ff2e1"
16
+ "bytes": 6978,
17
+ "sha256": "e529ac3f5566f138ce58b494ab07a716a05fefaff47c6f0fccdfe9bcd3842a63"
18
18
  },
19
19
  {
20
20
  "path": "reference/01_ENVIRONMENT_VARIABLES.md",
@@ -26,13 +26,13 @@
26
26
  "path": "reference/04_REPOSITORY_TOPOLOGY.md",
27
27
  "source": "docs/02_architecture/04_REPOSITORY_TOPOLOGY.md",
28
28
  "bytes": 13055,
29
- "sha256": "d6f810d1aadbacfcc9528766ce54b01229b0f4c6a4aecac34cd55b4611cd2651"
29
+ "sha256": "30ef807e28f9b488503425192f4ff19c2854467be0e62760d26bdfcb5cee5a4a"
30
30
  },
31
31
  {
32
32
  "path": "hosts/platform_bugx_SKILL.md",
33
33
  "source": "skills/platform/bugx/SKILL.md",
34
34
  "bytes": 3941,
35
- "sha256": "15096fa38872feca91efb9a3294210948a9efc0d84c31470ce1ded54dbaad0f3"
35
+ "sha256": "655783b82196921de4f36e4ef07755ec5535cefb0f5fc26cffad8adb38147ba1"
36
36
  },
37
37
  {
38
38
  "path": "hosts/cline_bugx_SKILL.md",
@@ -98,13 +98,13 @@
98
98
  "path": "ai/02_AI_USAGE.md",
99
99
  "source": "docs/03_ai/02_AI_USAGE.md",
100
100
  "bytes": 13575,
101
- "sha256": "b040f63360e854370c7addba4f51df3d62a83ff5afdd344b82e078129e143461"
101
+ "sha256": "d1255ced21937e92133b0a64f5cc858a93332c9e5e57be6d717808aae3b002ce"
102
102
  },
103
103
  {
104
104
  "path": "ai/03_AI_COMMANDS.md",
105
105
  "source": "docs/03_ai/03_AI_COMMANDS.md",
106
106
  "bytes": 46169,
107
- "sha256": "8d62791ce3b2566dcaca12ece45c98ef45da684e50426e38e58c3daa95510bea"
107
+ "sha256": "c50a0c9690bb46e80daa56e511ea4d1b7d5f37f3b27a8c57822c0a1071159797"
108
108
  },
109
109
  {
110
110
  "path": "hosts/bugx_SKILL.md",
@@ -1,6 +1,6 @@
1
1
  # 全域全景架构与权威目录拓扑 (System Architecture & Repository Topology)
2
2
 
3
- > **文档编号**: `DOC-TOPOLOGY` | **基线版本**: `0.1.5` | **更新日期**: 2026-11-26
3
+ > **文档编号**: `DOC-TOPOLOGY` | **基线版本**: `0.1.6` | **更新日期**: 2026-11-26
4
4
  > **文档定位**: Diátaxis - Explanation (工程拓扑、架构正交性与目录层级权威白皮书)
5
5
  > **关联规范**: ``docs/02_architecture/01_ARCHITECTURE.md`` (`docs/02_architecture/01_ARCHITECTURE.md`) (系统高层架构设计), ``docs/02_architecture/02_DESIGN_SPEC.md`` (`docs/02_architecture/02_DESIGN_SPEC.md`) (设计规约总账), ``AGENTS.md`` (`AGENTS.md`) (工程开发宪法)
6
6
 
@@ -572,6 +572,64 @@ class FlywheelUploader:
572
572
  payload["dpo_preference"] = dpo_pair.as_dict() if isinstance(dpo_pair, DPOPreferencePair) else dict(dpo_pair)
573
573
  return self.enqueue(payload, tier=quality)
574
574
 
575
+ def enqueue_review(
576
+ self,
577
+ review_summary: Mapping[str, Any],
578
+ *,
579
+ static_topology: Iterable[Any] | None = None,
580
+ quality: str | int = "tier-2",
581
+ metrics: Mapping[str, Any] | None = None,
582
+ event_type: str = "code_review",
583
+ ) -> int | None:
584
+ """Queue a lightweight code review or probe telemetry event."""
585
+ topology = list(static_topology or [])
586
+ clean_summary = dict(review_summary)
587
+ clean_metrics = dict(metrics or {})
588
+ normalized_event = str(event_type or "code_review").strip().lower()
589
+ payload: dict[str, Any] = {
590
+ "schema_version": 1,
591
+ "event_type": normalized_event,
592
+ "quality_tier": quality_tier_name(quality),
593
+ "topology_hash": merkle_root(topology),
594
+ "review_summary": clean_summary,
595
+ "metrics": clean_metrics,
596
+ }
597
+ return self.enqueue(payload, tier=quality)
598
+
599
+ def record_and_flush(
600
+ self,
601
+ review_summary: Mapping[str, Any],
602
+ *,
603
+ static_topology: Iterable[Any] | None = None,
604
+ quality: str | int = "tier-2",
605
+ metrics: Mapping[str, Any] | None = None,
606
+ event_type: str = "code_review",
607
+ flush: bool = True,
608
+ ) -> dict[str, Any]:
609
+ """Record a telemetry event and attempt immediate non-blocking flush."""
610
+ record_id = self.enqueue_review(
611
+ review_summary,
612
+ static_topology=static_topology,
613
+ quality=quality,
614
+ metrics=metrics,
615
+ event_type=event_type,
616
+ )
617
+ if record_id is None:
618
+ return {"enabled": False, "status": "disabled", "sent": 0}
619
+ sent = 0
620
+ if flush:
621
+ try:
622
+ res = self.flush(limit=20, batch_size=20)
623
+ sent = int(res.get("sent", 0)) if isinstance(res, dict) else 0
624
+ except Exception:
625
+ pass
626
+ return {
627
+ "enabled": True,
628
+ "status": "sent" if sent > 0 else "queued",
629
+ "record_id": record_id,
630
+ "sent": sent,
631
+ }
632
+
575
633
  def enqueue_installation(self, event: str = "heartbeat") -> int | None:
576
634
  """Queue an install/heartbeat identity event in the existing outbox.
577
635
 
@@ -890,6 +948,36 @@ def maybe_report_installation(*, force: bool = False) -> dict[str, Any]:
890
948
  return {"enabled": True, "status": "error", "error": str(exc), "sent": 0}
891
949
 
892
950
 
951
+ def record_review_telemetry(
952
+ review_summary: Mapping[str, Any],
953
+ *,
954
+ static_topology: Iterable[Any] | None = None,
955
+ quality: str | int = "tier-2",
956
+ metrics: Mapping[str, Any] | None = None,
957
+ event_type: str = "code_review",
958
+ flush: bool = True,
959
+ ) -> dict[str, Any]:
960
+ """Convenience helper to record lightweight review telemetry and optionally flush."""
961
+ try:
962
+ from core.cloud_sync.consent import telemetry_enabled
963
+
964
+ if not telemetry_enabled():
965
+ return {"enabled": False, "status": "disabled", "sent": 0}
966
+ with FlywheelUploader() as uploader:
967
+ if not uploader.data_sharing:
968
+ return {"enabled": False, "status": "disabled", "sent": 0}
969
+ return uploader.record_and_flush(
970
+ review_summary=review_summary,
971
+ static_topology=static_topology,
972
+ quality=quality,
973
+ metrics=metrics,
974
+ event_type=event_type,
975
+ flush=flush,
976
+ )
977
+ except Exception as exc: # noqa: BLE001 - telemetry must fail closed and quiet
978
+ return {"enabled": False, "status": "error", "error": str(exc), "sent": 0}
979
+
980
+
893
981
  def _encrypt(data: bytes, passphrase: str) -> bytes:
894
982
  try:
895
983
  from cryptography.hazmat.primitives.ciphers.aead import AESGCM
@@ -928,4 +1016,5 @@ __all__ = [
928
1016
  "MAX_AUDIT_BYTES", "MAX_OUTBOX_BYTES", "MAX_OUTBOX_RECORDS", "OutboxFullError",
929
1017
  "build_dpo_preference_pair", "default_audit_path", "default_outbox_path",
930
1018
  "maybe_report_installation", "merkle_root", "quality_tier", "quality_tier_name",
1019
+ "record_review_telemetry",
931
1020
  ]
@@ -1,6 +1,6 @@
1
1
  # BugX 智能体执行协议与交互契约子系统 (Agent Runtime Contracts & Protocols)
2
2
 
3
- > **版本契约**: `0.1.5` | **父系统**: `core/`
3
+ > **版本契约**: `0.1.6` | **父系统**: `core/`
4
4
  > **工程规范**: 参见 [`docs/02_architecture/05_ARCH_NOMENCLATURE_GUIDE.md`](../../docs/02_architecture/05_ARCH_NOMENCLATURE_GUIDE.md) 与 [`docs/02_architecture/06_MODULE_GOVERNANCE_SPEC.md`](../../docs/02_architecture/06_MODULE_GOVERNANCE_SPEC.md)
5
5
  > **守卫机制**: `scripts/verify_directory_indices.py` (100% 索引对齐防漂移)
6
6
 
@@ -1,4 +1,4 @@
1
- # BugX 运行时契约(0.1.5)
1
+ # BugX 运行时契约(0.1.6)
2
2
 
3
3
  这是部署到用户级全局引擎 `~/.bugx/core/` 的最小运行时契约。项目不再保存
4
4
  `.bugx/core` 可执行入口;需要定位本文件时使用 `bugx engine path --name bugx-runtime-contract.md`。