bugx-cli 0.1.0 → 0.1.2

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 (338) hide show
  1. package/README.md +193 -185
  2. package/core/README.md +2 -2
  3. package/core/agent/README.md +2 -1
  4. package/core/agent/agent_artifacts.py +8 -6
  5. package/core/agent/agent_eval.py +136 -54
  6. package/core/agent/agent_execution.py +218 -52
  7. package/core/agent/agent_orchestrator.py +14 -8
  8. package/core/agent/agent_targets.py +8 -2
  9. package/core/agent/feature_baseline.py +150 -0
  10. package/core/assets/README.md +3 -2
  11. package/core/assets/axe-core/LICENSE-3RD-PARTY.txt +66 -0
  12. package/core/assets/axe-core/LICENSE.txt +362 -0
  13. package/core/assets/axe-core/UPSTREAM.md +10 -0
  14. package/core/assets/axe-core/axe.min.js +12 -0
  15. package/core/assets/bugx-hero-en.svg +74 -0
  16. package/core/assets/bugx-hero-zh.svg +74 -0
  17. package/core/assets/bugx-social-preview.svg +71 -0
  18. package/core/assets/bugx-wechat-group.png +0 -0
  19. package/core/assets/codex.png +0 -0
  20. package/core/assets/dsh.png +0 -0
  21. package/core/assets/webui-chatgpt.jpg +0 -0
  22. package/core/assets/webui-session.jpg +0 -0
  23. package/core/assets/webui-skills.jpg +0 -0
  24. package/core/assets/webui-studio.jpg +0 -0
  25. package/core/assets/webui-zcode.jpg +0 -0
  26. package/core/assets/zcode.png +0 -0
  27. package/core/audit_packs/README.md +2 -0
  28. package/core/audit_packs/pitfalls/auth_crypto.json +64 -0
  29. package/core/audit_packs/pitfalls/file_ssrf_cmd.json +64 -0
  30. package/core/audit_packs/pitfalls/go_backend.json +66 -0
  31. package/core/audit_packs/pitfalls/java_spring.json +64 -0
  32. package/core/audit_packs/pitfalls/js_ts_web.json +67 -0
  33. package/core/audit_packs/pitfalls/python_web.json +82 -0
  34. package/core/autonomous_cve/SPEC.md +1 -1
  35. package/core/autonomous_cve/attack_graph_store.py +152 -106
  36. package/core/autonomous_cve/behavior_graph.py +8 -2
  37. package/core/autonomous_cve/verifier.py +4 -1
  38. package/core/bugx.md +1 -1
  39. package/core/bugx_paths.py +43 -8
  40. package/core/cli-help.txt +66 -0
  41. package/core/cloud_sync/SPEC.md +1 -1
  42. package/core/cloud_sync/cloud_client.py +81 -11
  43. package/core/cloud_sync/cloud_onboard.py +42 -1
  44. package/core/cloud_sync/consent.py +33 -3
  45. package/core/cloud_sync/flywheel_client.py +186 -15
  46. package/core/cloud_sync/network_transport.py +24 -3
  47. package/core/cloud_sync/sensitive_filter.py +2 -2
  48. package/core/cloud_sync/sync_push.py +12 -10
  49. package/core/contracts/AGENT_GUIDE.md +6 -9
  50. package/core/contracts/README.md +2 -2
  51. package/core/contracts/bugx-runtime-contract.md +1 -1
  52. package/core/contracts/bugx-worker.md +1 -1
  53. package/core/contracts/engine_gap_contracts.py +86 -3
  54. package/core/coverage/coverage_discovery.py +599 -29
  55. package/core/coverage/coverage_evidence.py +47 -0
  56. package/core/coverage/coverage_forensics.py +9 -0
  57. package/core/coverage/coverage_validate.py +6 -1
  58. package/core/dev_harness/SPEC.md +1 -1
  59. package/core/engine-integrity.json +670 -442
  60. package/core/fuzzing/concurrency_fuzzer.py +53 -0
  61. package/core/fuzzing/differential_oracle.py +562 -27
  62. package/core/fuzzing/fuzz_input.py +109 -6
  63. package/core/fuzzing/stateful_fuzzer.py +72 -0
  64. package/core/governance/secret_redactor.py +22 -10
  65. package/core/host_acp/SPEC.md +1 -1
  66. package/core/host_acp/__init__.py +4 -4
  67. package/core/host_acp/claude.py +59 -1
  68. package/core/host_acp/cline.py +64 -1
  69. package/core/host_acp/codex.py +56 -1
  70. package/core/host_acp/dsh.py +59 -1
  71. package/core/host_acp/opencode.py +56 -1
  72. package/core/host_acp/pi.py +59 -1
  73. package/core/host_acp/zcode.py +59 -1
  74. package/core/host_runtime/SPEC.md +1 -1
  75. package/core/host_runtime/adapters.py +1 -1
  76. package/core/host_runtime/cline.py +13 -0
  77. package/core/host_runtime/host_evaluators.py +44 -4
  78. package/core/host_runtime/host_probe.py +1 -1
  79. package/core/host_runtime/host_provider_arbitrator.py +116 -62
  80. package/core/host_runtime/host_registry.py +15 -8
  81. package/core/host_runtime/mcp_registry_gate.py +12 -1
  82. package/core/host_runtime/pi.py +102 -0
  83. package/core/host_runtime/provider_facts.py +66 -0
  84. package/core/hosts/SPEC.md +1 -1
  85. package/core/hosts/__init__.py +6 -2
  86. package/core/hosts/_dsh_usage.py +1 -1
  87. package/core/hosts/base.py +32 -4
  88. package/core/hosts/claude.py +55 -0
  89. package/core/hosts/cline.py +6 -2
  90. package/core/hosts/codex.py +58 -0
  91. package/core/hosts/dsh.py +9 -1
  92. package/core/hosts/opencode.py +6 -6
  93. package/core/hosts/pi.py +159 -2
  94. package/core/infra/README.md +4 -2
  95. package/core/infra/__init__.py +2 -0
  96. package/core/infra/build_info.py +22 -3
  97. package/core/infra/client_metadata.py +1 -1
  98. package/core/infra/json_utils.py +22 -0
  99. package/core/launch_phases/README.md +6 -3
  100. package/core/launch_phases/SPEC.md +1 -1
  101. package/core/launch_phases/common.py +21 -2
  102. package/core/launch_phases/finding_confirm_phase.py +170 -5
  103. package/core/launch_phases/finding_settlement.py +188 -1
  104. package/core/launch_phases/judge_phase.py +69 -12
  105. package/core/launch_phases/orchestrator_controls.py +11 -7
  106. package/core/launch_phases/post_coverage_sync.py +9 -2
  107. package/core/launch_phases/post_phase.py +144 -8
  108. package/core/launch_phases/post_receipt.py +12 -1
  109. package/core/launch_phases/pre_phase.py +3 -3
  110. package/core/launch_phases/pre_recon_scout.py +66 -36
  111. package/core/launch_phases/pre_state_builder.py +23 -176
  112. package/core/launch_phases/report_sharing.py +3 -7
  113. package/core/launch_phases/round_orchestrator.py +129 -58
  114. package/core/launch_phases/semantic_recon.py +545 -0
  115. package/core/launch_phases/session_runtime.py +56 -9
  116. package/core/launch_phases/startup_gates.py +36 -8
  117. package/core/launch_phases/startup_interaction.py +68 -12
  118. package/core/launch_phases/startup_version_gate.py +13 -3
  119. package/core/launch_phases/supervisor_bridge.py +46 -17
  120. package/core/launch_phases/supervisor_coverage.py +8 -2
  121. package/core/launch_phases/supervisor_degraded.py +1 -9
  122. package/core/launch_phases/verify_loop.py +767 -0
  123. package/core/launch_phases/worker_barriers.py +15 -5
  124. package/core/launch_phases/worker_orchestrator.py +105 -25
  125. package/core/launch_phases/worker_prior.py +115 -0
  126. package/core/ledger/README.md +2 -1
  127. package/core/ledger/SPEC.md +1 -1
  128. package/core/ledger/_facade.py +2 -1
  129. package/core/ledger/archive_ops.py +60 -2
  130. package/core/ledger/cli.py +6 -1
  131. package/core/ledger/export_ops.py +6 -1
  132. package/core/ledger/finding_confirmation.py +48 -6
  133. package/core/ledger/finding_lifecycle.py +428 -5
  134. package/core/ledger/finding_verification.py +555 -10
  135. package/core/ledger/fp_ledger.py +255 -0
  136. package/core/ledger/incidents.py +10 -4
  137. package/core/ledger/patterns.py +10 -7
  138. package/core/ledger/receipt_contract.py +17 -1
  139. package/core/ledger/sync_ops.py +21 -16
  140. package/core/ledger/tool_experience.py +2 -1
  141. package/core/ledger/verify_life.py +88 -17
  142. package/core/locales/en-US.json +2 -2
  143. package/core/locales/zh-CN.json +2 -2
  144. package/core/mcp_handlers/SPEC.md +1 -1
  145. package/core/mcp_handlers/base.py +23 -3
  146. package/core/mcp_handlers/channel_lifecycle.py +85 -30
  147. package/core/mcp_handlers/retrieval_handlers.py +11 -1
  148. package/core/mcp_handlers/rpc_server.py +6 -1
  149. package/core/mcp_handlers/supervisor_handlers.py +32 -6
  150. package/core/mcp_handlers/tool_table.py +15 -0
  151. package/core/mcp_runtime_support/environment.py +0 -38
  152. package/core/mcp_runtime_support/verifier.py +0 -52
  153. package/core/metadata.txt +2 -3
  154. package/core/planning/README.md +2 -1
  155. package/core/planning/domain_router.py +4 -2
  156. package/core/planning/dynamic_flow_analyzer.py +219 -14
  157. package/core/planning/judge_pipeline.py +87 -4
  158. package/core/planning/prompt_harness.py +57 -15
  159. package/core/planning/prompt_policy_engine.py +386 -0
  160. package/core/planning/spec_harvester.py +4 -4
  161. package/core/probes/INTERFACE.md +11 -1
  162. package/core/probes/SPEC.md +11 -1
  163. package/core/probes/__init__.py +46 -40
  164. package/core/probes/android_probe.py +177 -9
  165. package/core/probes/codebase_memory_probe.py +57 -0
  166. package/core/probes/desktop_probe.py +104 -0
  167. package/core/probes/differential_probe.py +99 -21
  168. package/core/probes/efficiency_probe.py +64 -0
  169. package/core/probes/ios_binary_probe.py +105 -1
  170. package/core/probes/memory_probe.py +66 -0
  171. package/core/probes/miniprogram_probe.py +75 -13
  172. package/core/probes/mobile_probe.py +215 -30
  173. package/core/probes/native_probe.py +88 -0
  174. package/core/probes/openwiki_probe.py +70 -0
  175. package/core/probes/pattern_probe.py +106 -0
  176. package/core/probes/platform_probe.py +81 -0
  177. package/core/probes/probe_registry.py +108 -7
  178. package/core/probes/sast_fixture_corpus.py +340 -0
  179. package/core/probes/sast_probe.py +553 -52
  180. package/core/probes/sast_rules.py +668 -28
  181. package/core/probes/sca_scanner.py +48 -0
  182. package/core/probes/ui_accessibility.py +149 -0
  183. package/core/probes/ui_audit.py +513 -0
  184. package/core/probes/ui_contract.py +273 -0
  185. package/core/probes/ui_evidence.py +212 -0
  186. package/core/probes/ui_measurements.py +314 -0
  187. package/core/probes/ui_repair.py +250 -0
  188. package/core/probes/ui_review.py +133 -0
  189. package/core/probes/ui_storybook.py +107 -0
  190. package/core/probes/ui_tokens.py +185 -0
  191. package/core/probes/ui_visual_diff.py +131 -0
  192. package/core/probes/web_probe.py +373 -18
  193. package/core/project_profiler/SPEC.md +1 -1
  194. package/core/project_profiler/arbitrator.py +6 -1
  195. package/core/project_profiler/detector.py +8 -1
  196. package/core/project_profiler/strategy.py +51 -15
  197. package/core/prompts/README.md +4 -2
  198. package/core/prompts/command_routing_en.md +2 -2
  199. package/core/prompts/command_routing_zh.md +2 -2
  200. package/core/prompts/policies/prompt_policies.json +101 -0
  201. package/core/prompts/stages/stage_repair.md +1 -1
  202. package/core/prompts/stages/stage_verify.defensive.md +42 -0
  203. package/core/prompts/stages/stage_verify.md +44 -0
  204. package/core/repair/README.md +1 -1
  205. package/core/repair/l7_repair_loop.py +1 -4
  206. package/core/repair/rsi_fixer.py +4 -4
  207. package/core/repair/rsi_loop.py +1 -3
  208. package/core/repair/rsi_repair.py +7 -7
  209. package/core/repair/rsi_scope.py +27 -8
  210. package/core/report_engine/SPEC.md +1 -1
  211. package/core/report_engine/attestation.py +8 -4
  212. package/core/report_engine/finding_report.py +2 -1
  213. package/core/report_engine/models.py +7 -9
  214. package/core/report_engine/report_share.py +0 -8
  215. package/core/report_engine/sast_bridge.py +2 -2
  216. package/core/report_engine/server.py +18 -8
  217. package/core/report_engine/web-conformance.md +123 -18
  218. package/core/report_engine/web_conformance.py +21 -52
  219. package/core/retrieval/README.md +2 -1
  220. package/core/retrieval/SPEC.md +1 -1
  221. package/core/retrieval/code_analyzer.py +50 -14
  222. package/core/retrieval/context_assembler.py +7 -1
  223. package/core/retrieval/knowledge_sync.py +108 -14
  224. package/core/retrieval/pitfall_packs.py +277 -0
  225. package/core/retrieval/symbol_index.py +25 -6
  226. package/core/retrieval/universal_code_matcher.py +234 -49
  227. package/core/runtime/README.md +1 -1
  228. package/core/runtime/bugx_logging.py +78 -7
  229. package/core/runtime/fixture_solidify.py +5 -10
  230. package/core/runtime/global_telemetry.py +20 -0
  231. package/core/runtime/incident_eval.py +1 -1
  232. package/core/runtime/model_runner.py +4 -41
  233. package/core/runtime/platform_adapter.py +2 -2
  234. package/core/runtime/prep_validate.py +4 -2
  235. package/core/runtime/project_settings.py +2 -1
  236. package/core/runtime/scenario_eval.py +50 -8
  237. package/core/skills/bugx_docs_mcp_server.py +3 -1
  238. package/core/skills/bugx_mcp_server.py +29 -2
  239. package/core/skills/tools_kb.py +1 -1
  240. package/core/supervisor/README.md +1 -1
  241. package/core/supervisor/SPEC.md +1 -1
  242. package/core/supervisor/budget_governor.py +503 -9
  243. package/core/supervisor/checkpoint_pipeline.py +248 -6
  244. package/core/supervisor/checkpoint_sync.py +13 -0
  245. package/core/supervisor/claim_events.py +1 -1
  246. package/core/supervisor/finding_workflow.py +22 -5
  247. package/core/supervisor/lease_manager.py +1 -1
  248. package/core/supervisor/lifecycle_blocks.py +6 -1
  249. package/core/supervisor/rejection_remedies.py +52 -5
  250. package/core/supervisor/serial_authorization.py +48 -4
  251. package/core/supervisor/task_scheduler.py +2 -2
  252. package/core/supervisor/worker_checkpoint.py +8 -1
  253. package/core/supervisor/worker_runtime.py +8 -2
  254. package/core/supervisor_types/worker_claim.py +9 -0
  255. package/core/webui/README.md +1 -1
  256. package/core/webui/SPEC.md +2 -1
  257. package/core/webui/adapters/claude.py +5 -1
  258. package/core/webui/adapters/cline.py +10 -2
  259. package/core/webui/adapters/codex.py +5 -1
  260. package/core/webui/adapters/dsh.py +5 -1
  261. package/core/webui/docs_session_service.py +2 -2
  262. package/core/webui/mcp_inspector.py +11 -7
  263. package/core/webui/static/00-base.css +1060 -0
  264. package/core/webui/static/01-monitoring.css +802 -0
  265. package/core/webui/static/02-header-actions.css +321 -0
  266. package/core/webui/static/03-trigger-popover.css +697 -0
  267. package/core/webui/static/04-composer.css +628 -0
  268. package/core/webui/static/05-skills-center.css +878 -0
  269. package/core/webui/static/06-mcp-center.css +623 -0
  270. package/core/webui/static/07-skill-detail.css +265 -0
  271. package/core/webui/static/08-files-management.css +167 -0
  272. package/core/webui/static/09-files-center.css +386 -0
  273. package/core/webui/static/10-icons.css +105 -0
  274. package/core/webui/static/11-project-options.css +185 -0
  275. package/core/webui/static/12-profile-tab.css +383 -0
  276. package/core/webui/static/design-tokens.css +113 -0
  277. package/core/webui/static/index.html +14 -1
  278. package/core/webui/workspace_service.py +1 -1
  279. package/docs/07_distribution/01_README_NPM.md +193 -185
  280. package/ecosystem/integrations/README.md +1 -1
  281. package/ecosystem/integrations/dsh/mcp/package.json +1 -1
  282. package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +1 -1
  283. package/ecosystem/integrations/dsh/ui/package.json +1 -1
  284. package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +4 -4
  285. package/ecosystem/integrations/opencode/mcp-lock.json +14 -6
  286. package/ecosystem/integrations/opencode/opencode.json +23 -12
  287. package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
  288. package/ecosystem/integrations/qoder/connector-meta.json +1 -1
  289. package/ecosystem/integrations/workbuddy/connector-meta.json +1 -1
  290. package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +1 -1
  291. package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +1 -1
  292. package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +1 -1
  293. package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +1 -1
  294. package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +2 -2
  295. package/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +1 -1
  296. package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +1 -1
  297. package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +1 -1
  298. package/interfaces/bin/bugx.js +37 -0
  299. package/interfaces/cli/bugx_cli/__init__.py +4 -2
  300. package/interfaces/cli/bugx_cli/cli.py +172 -69
  301. package/interfaces/cli/bugx_cli/commands/advisory.py +1 -1
  302. package/interfaces/cli/bugx_cli/commands/agent.py +461 -134
  303. package/interfaces/cli/bugx_cli/commands/audit.py +10 -9
  304. package/interfaces/cli/bugx_cli/commands/autonomous.py +1 -1
  305. package/interfaces/cli/bugx_cli/commands/cloud.py +31 -22
  306. package/interfaces/cli/bugx_cli/commands/doctor.py +449 -204
  307. package/interfaces/cli/bugx_cli/commands/interaction.py +5 -1
  308. package/interfaces/cli/bugx_cli/commands/knowledge.py +5 -4
  309. package/interfaces/cli/bugx_cli/commands/lifecycle.py +3 -3
  310. package/interfaces/cli/bugx_cli/commands/plugin.py +58 -23
  311. package/interfaces/cli/bugx_cli/commands/plugin_claude.py +7 -7
  312. package/interfaces/cli/bugx_cli/commands/plugin_funide.py +2 -1
  313. package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +1 -1
  314. package/interfaces/cli/bugx_cli/commands/project.py +6 -13
  315. package/interfaces/cli/bugx_cli/commands/report.py +2 -6
  316. package/interfaces/cli/bugx_cli/commands/system.py +524 -169
  317. package/interfaces/cli/bugx_cli/common.py +21 -15
  318. package/interfaces/cli/bugx_cli/host_adapters.py +29 -54
  319. package/interfaces/cli/bugx_cli/hosts/registry.py +8 -6
  320. package/interfaces/cli/bugx_cli/infra/ai_advisor.py +157 -27
  321. package/interfaces/cli/bugx_cli/infra/engine_installer.py +35 -16
  322. package/interfaces/cli/bugx_cli/infra/host_sync.py +11 -8
  323. package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +76 -5
  324. package/interfaces/cli/bugx_cli/infra/security.py +13 -6
  325. package/package.json +30 -15
  326. package/pyproject.toml +60 -9
  327. package/scripts/ensure-python.mjs +7 -7
  328. package/scripts/sync-version.mjs +10 -21
  329. package/scripts/test-npm-wrapper.mjs +1 -1
  330. package/core/assets/bugx-hero-cn.png +0 -0
  331. package/core/assets/bugx-hero-en.png +0 -0
  332. package/core/webui/static/project-settings.css +0 -6458
  333. package/docs/07_distribution/README.md +0 -16
  334. package/docs/README.md +0 -121
  335. package/interfaces/README.md +0 -143
  336. package/interfaces/bin/README.md +0 -35
  337. package/interfaces/cli/README.md +0 -90
  338. package/scripts/README.md +0 -118
package/README.md CHANGED
@@ -1,281 +1,289 @@
1
1
  <p align="center">
2
- <strong>BugX · AI writes the code. BugX hunts the bugs.</strong>
2
+ <img src="https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/bugx-hero-en.svg" alt="BugX — effortless audits of AI-written code" width="1000">
3
3
  </p>
4
4
 
5
- > **Version 1.0.0** | **Updated: 2026-11-10**
5
+ # BugX — AI Code Audit & Code Review Agent for Claude Code, Codex, Cline, OpenCode, and ZCode
6
6
 
7
- <p align="center">
8
- <strong>The autonomous, evidence-driven code auditing and vulnerability-hunting agent for modern AI programming tools.</strong>
9
- <br>
10
- <em>AI writes the code. BugX hunts the bugs. · 面向主流 AI 编程助手的自主闭环、证据驱动型深度代码审计智能体。</em>
11
- </p>
7
+ BugX is an autonomous code-audit and automated code review agent that runs inside your AI coding assistant or on the command line. It audits AI-written code end to end: it builds a coverage list of your project, dispatches concurrent audit workers, verifies every candidate finding with real executions, and produces an actionable report where each finding ships with a command you can run yourself to reproduce it.
8
+
9
+ If you use AI coding tools to write production code, BugX is the automated code review and security audit agent that checks what the model actually delivered — not what it claims to have delivered.
12
10
 
13
11
  <p align="center">
14
- <a href="https://www.npmjs.com/package/@bencibro/bugx"><img src="https://img.shields.io/npm/v/@bencibro/bugx.svg?style=flat&color=0284c7&label=npm" alt="npm version"></a>
15
- <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D18.0.0-334155.svg?style=flat&logo=nodedotjs&logoColor=white" alt="Node.js Version"></a>
12
+ <a href="https://www.npmjs.com/package/bugx-cli"><img src="https://img.shields.io/npm/v/bugx-cli.svg?style=flat&color=0284c7&label=npm" alt="npm version"></a>
13
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D18.0.0-334155.svg?style=flat" alt="Node.js"></a>
16
14
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-BSL--1.1-334155.svg?style=flat" alt="License: BSL-1.1"></a>
17
- <a href="https://www.npmjs.com/package/@bencibro/bugx"><img src="https://img.shields.io/badge/install-Zero--Config%20%2F%20npx-0284c7.svg?style=flat" alt="Zero Config"></a>
18
- <a href="https://www.npmjs.com/package/@bencibro/bugx"><img src="https://img.shields.io/badge/security-AST--Redacted%20%26%20Local--First-334155.svg?style=flat" alt="Security"></a>
15
+ <img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-334155.svg?style=flat" alt="Platform">
19
16
  </p>
20
17
 
21
- ---
18
+ 🌐 Website · 官网:**https://bugx.dev**
22
19
 
23
20
  <p align="center">
24
- <a href="#-english-documentation">English Documentation</a> •
25
- <a href="#-简体中文说明">简体中文说明</a>
21
+ <a href="#-english-documentation">English</a> •
22
+ <a href="#简体中文说明">简体中文</a>
26
23
  </p>
27
24
 
28
25
  ---
29
26
 
30
- ## 🌐 English Documentation
27
+ ## English Documentation
31
28
 
32
- ### ⚡ What is BugX?
29
+ ### Why AI-written code needs an audit
33
30
 
34
- **BugX** seamlessly embeds deep adversarial security inspection into your modern AI coding workflow (Claude Code, OpenAI Codex, OpenCode, Cursor, Windsurf, DeepSeek Harness, WorkBuddy, Pi).
31
+ AI writes code faster than any human can review it, and the model carries a training-level bias toward sounding done rather than being done:
35
32
 
36
- Rather than dumping hundreds of noisy, unverified regex alerts, BugX implements an **evidence-based closed verification loop**:
33
+ 1. **The grader rewards confidence.** Human raters score "I checked it carefully, nothing found" higher than "I haven't finished reading the files." The model learns to report good news.
34
+ 2. **Checking is expensive; claiming is cheap.** Reading hundreds of files takes real work. Replying "no issues found" takes a few words.
35
+ 3. **It doesn't know what it hasn't checked.** The model cannot see its own coverage gaps and will not say "half done."
37
36
 
38
- ```mermaid
39
- flowchart LR
40
- A[Source Code] --> B[AST & Route Discovery]
41
- B --> C[Mutation & Race Fuzzing]
42
- C --> D[Executable PoC Script]
43
- D --> E[TDD Red-to-Green Patch]
44
- ```
37
+ BugX counters this with a ledger and four hard rules: a per-unit coverage list (checked / blocked / pending), mandatory reproduction (the same attack input must trigger the finding twice and a clean input must trigger nothing), crash-resumable audits, and hash-chained records that keep every verdict reviewable.
45
38
 
46
- - **Zero Speculation**: An issue is only confirmed when an executable, self-contained reproduction script (PoC) succeeds in isolating it.
47
- - **Red-Green Patch Synthesis**: BugX automatically synthesizes minimal fixes and verifies them with dual test runs before closing findings.
48
- - **Host-Neutral Architecture**: BugX never hijacks LLM execution. Your AI coding agent drives the actual code analysis and testing natively.
39
+ ### What BugX does
49
40
 
50
- ---
41
+ - **AI code review** — bugs and defects classified by logic, state, boundary, exception, concurrency, performance, and resource handling.
42
+ - **Functionality review** — a behavior diff: the same inputs go to your implementation and a reference implementation, and the differences are reported.
43
+ - **Performance and memory checks** — performance and resource defects, plus dedicated memory inspection for native, Python, JVM, Electron, Android, and Apple targets.
44
+ - **UI audit** — layout, contrast, keyboard paths, and design tokens on a running web page (`bugx probe ui`).
45
+ - **Reproducible findings & blind verification** — every vulnerability is blind-reviewed by an independent verifier with a reproduction command or PoC; verified with AST negative control assertions; refuted cases are logged to the FP Ledger.
46
+ - **Prompt Policy Engine** — declarative prompt profiles adapt to model-specific safety filters (e.g. OpenAI Cyber Risk / Daybreak) without losing code fidelity.
47
+ - **Mutation-verified tests** — `bugx test-verify` mutates your code to check whether the tests actually catch the bugs.
48
+ - **Patch bundles** — `bugx patch-forge` builds a patch with static checks and hands it to you for review; it never commits on its own.
49
+ - **Lessons base and unattended runs** — `bugx lesson` / `bugx knowledge` accumulate project and global experience; `bugx autonomous` and `bugx goal` run end-to-end audits without supervision.
51
50
 
52
- ### 📦 Quick Start
51
+ ### BugX Studio
53
52
 
54
- #### Requirements
55
- - **Node.js**: `>= 18.0.0`
56
- - **Python**: `>= 3.11` (The BugX core engine is Python-powered; the npm package serves as a lightweight, zero-dependency global wrapper that automatically interfaces with your local Python environment).
53
+ BugX ships with a built-in web console. Run `bugx report serve` and open http://127.0.0.1:8080:
57
54
 
58
- The npm tarball includes the integrity-checked BugX core payload, its catalog, and the bundled Web UI static shell. It has no native `sqlite3` npm dependency; MCP registry storage uses the Node runtime's built-in `node:sqlite` path where applicable.
55
+ <p align="center">
56
+ <img src="https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/webui-studio.jpg" alt="BugX Studio workbench" width="860">
57
+ </p>
59
58
 
60
- ---
59
+ Every connected host keeps its own audit sessions (ChatGPT, ZCode, Claude, Codex, DSH, OpenCode, Pi, and more):
61
60
 
62
- #### 1. Instant Execution with `npx` (Zero Installation)
61
+ <p align="center">
62
+ <img src="https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/webui-chatgpt.jpg" alt="ChatGPT workspace" width="420">
63
+ <img src="https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/webui-zcode.jpg" alt="ZCode workspace" width="420">
64
+ </p>
63
65
 
64
- Run BugX commands directly in any project without installing anything globally:
66
+ 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):
65
67
 
66
- ```bash
67
- # Check system readiness and AI tool connectivity
68
- npx @bencibro/bugx doctor
68
+ <p align="center">
69
+ <img src="https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/webui-skills.jpg" alt="Skill marketplace" width="860">
70
+ </p>
71
+
72
+ ### Quick start
69
73
 
70
- # Initialize current repository (.bugx/)
71
- npx @bencibro/bugx init
74
+ Requires Node.js `>=18`. Python `>=3.11` is detected and managed by the wrapper.
72
75
 
73
- # Auto-configure local AI assistants (Claude, Codex, OpenCode, etc.)
74
- npx @bencibro/bugx install
76
+ **Run without installing (zero-config):**
77
+
78
+ ```bash
79
+ npx bugx-cli doctor --strict # check system readiness and AI tool connectivity
80
+ npx bugx-cli init # initialize the current repository (.bugx/)
81
+ npx bugx-cli install # register local AI assistants
75
82
  ```
76
83
 
77
- ---
84
+ **Or install globally** (pick your package manager):
78
85
 
79
- #### 2. Global Installation (Recommended for Daily Use)
86
+ ```bash
87
+ npm install -g bugx-cli
88
+ # pnpm add -g bugx-cli
89
+ # yarn global add bugx-cli
90
+ # bun add -g bugx-cli
91
+ ```
80
92
 
81
- Install globally via your preferred package manager:
93
+ After installing, run this once from any directory:
82
94
 
83
95
  ```bash
84
- # npm
85
- npm install -g @bencibro/bugx
96
+ bugx install # lists detected AI hosts and registers the BugX MCP servers
97
+ bugx doctor --strict # health diagnostics
98
+ ```
86
99
 
87
- # pnpm
88
- pnpm add -g @bencibro/bugx
100
+ To install everywhere at once: `bugx install --agent all`.
89
101
 
90
- # yarn
91
- yarn global add @bencibro/bugx
102
+ **Option 1 — inside your AI assistant (recommended).** Open Claude Code, Codex, Cline, OpenCode, or ZCode in any project and just tell it what to check:
92
103
 
93
- # bun
94
- bun add -g @bencibro/bugx
95
- ```
104
+ **ZCode**
105
+ ![Running a BugX audit in ZCode](https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/zcode.png)
106
+
107
+ **Codex**
108
+ ![Running a BugX audit in Codex](https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/codex.png)
96
109
 
97
- Once installed, use the unified `bugx` command directly:
110
+ **DSH**
111
+ ![Running a BugX audit in DSH](https://raw.githubusercontent.com/Bencibr/bugx/main/core/assets/dsh.png)
112
+
113
+ > "Audit this project"
114
+ > "Check the login module for vulnerabilities"
115
+ > "Review the changes on this branch for security issues"
116
+
117
+ **Option 2 — from the terminal.** 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.
98
118
 
99
119
  ```bash
100
- # Initialize workspace
101
- bugx init
120
+ bugx auth login # sign in to the cloud account (lesson and experience sync)
121
+ bugx init --cloud-sync sync # enable cloud sync so the project works across devices
122
+
123
+ bugx engine pre # build the coverage list and audit plan
124
+ bugx engine status # follow progress
125
+ bugx engine post # settle: cross-check coverage, evidence, and verdicts
102
126
 
103
- # Discover and register local AI tools
104
- bugx install
127
+ bugx autonomous --host opencode # full audit without supervision
128
+ bugx goal --host opencode "audit this project's login and payment flows"
105
129
 
106
- # Run health diagnostics
107
- bugx doctor
130
+ bugx report serve # live web console at http://127.0.0.1:8080
131
+ bugx report both --format html --out report.html # offline archive
108
132
  ```
109
133
 
110
- ---
134
+ ### Essential commands
111
135
 
112
- ### 🤖 Supported AI Coding Ecosystem
136
+ | Command | What it does |
137
+ | :--- | :--- |
138
+ | `bugx install` | register the BugX MCP servers with detected AI hosts |
139
+ | `bugx hosts` | list every AI environment detected on this machine |
140
+ | `bugx doctor --strict` | health diagnostics for installation and connectivity |
141
+ | `bugx engine pre / status / post` | run and settle a structured audit lifecycle |
142
+ | `bugx autonomous --host <host>` | full unattended audit through your host |
143
+ | `bugx goal --host <host> "<target>"` | audit toward a stated target |
144
+ | `bugx report serve` | live web console (BugX Studio) |
145
+ | `bugx report both --format html` | export the formal + visual report |
146
+ | `bugx probe ui --url <url>` | audit a running web UI |
147
+ | `bugx test-generate` | generate AAA tests or a self-contained PoC |
148
+ | `bugx test-verify` | prove your tests catch real bugs via mutation |
149
+ | `bugx patch-forge` | build a reviewed patch bundle |
150
+ | `bugx lesson` / `bugx knowledge` | project and global experience base |
151
+ | `bugx daemon` | resident watchdog for unattended audits |
152
+
153
+ ### Supported AI coding tools
154
+
155
+ | AI coding tool | Integration | Install |
156
+ | :--- | :--- | :--- |
157
+ | Claude Code | native MCP / autonomous lifecycle | `bugx install --agent claude` |
158
+ | OpenAI Codex | workspace subagents / native plugin | `bugx install --agent codex` |
159
+ | OpenCode | headless ACP / native MCP | `bugx install --agent opencode` |
160
+ | Cline / Roo Code | MCP sessions (serial) / CLI process-pool concurrency | `bugx install --agent cline` |
161
+ | ZCode | native MCP / user-level MCP registration | `bugx install --agent zcode` |
113
162
 
114
- BugX automatically detects and configures Model Context Protocol (MCP) servers and skill configurations across your tools:
163
+ DeepSeek Harness (DSH), WorkBuddy, Cursor / Windsurf, and more are being adapted. Run `bugx hosts` to list everything detected on this machine.
115
164
 
116
- | AI Coding Assistant | Integration Mechanism | Setup Command |
117
- | :--- | :--- | :--- |
118
- | **Claude Code** | Native MCP / Autonomous Protocol | `bugx install --agent claude` |
119
- | **OpenAI Codex** | Workspace Subagent / Native Plugin | `bugx install --agent codex` |
120
- | **OpenCode** | Headless ACP / Native MCP | `bugx install --agent opencode` |
121
- | **DeepSeek Harness (DSH)** | Official Web UI Extension & MCP | `bugx install --agent dsh` |
122
- | **WorkBuddy** | Official IDE Connector Bundle | `bugx install --agent workbuddy` |
123
- | **Cline / Roo Code** | MCP; interactive single-claim or CLI process-pool execution | `bugx install --agent cline` |
124
- | **ChatGPT** | Project MCP / interactive host integration | `bugx install --agent chatgpt` |
125
- | **ZCode** | Native MCP / host integration | `bugx install --agent zcode` |
126
- | **Pi** | Native MCP / host integration | `bugx install --agent pi` |
127
- | **Qoder AI** | Native MCP / host integration | `bugx install --agent qoder` |
128
- | **Trea** | Native MCP / host integration | `bugx install --agent trea` |
129
- | **FunIDE** | Native MCP / host integration | `bugx install --agent funide` |
130
- | **Cursor / Windsurf** | Standard MCP Server | `bugx mcp serve --role host` |
131
-
132
- Run `bugx hosts` to see all supported and detected environments on your system.
165
+ ### Security and privacy
133
166
 
134
- ---
167
+ - Project state lives in the project's `.bugx/` directory; the global engine, credentials, knowledge base, and caches live in a user-level BugX directory.
168
+ - 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.
169
+ - Cloud uploads, feedback, diagnostic log reporting, and sync are all explicit operations: each states its `--scope` before it runs.
170
+ - `reset` / `uninstall` / `purge` / `--no-backup` delete data. Check each command's dry-run and backup behavior first.
135
171
 
136
- ### 🛠️ Essential Commands
172
+ ### FAQ
137
173
 
138
- | Command | Description |
139
- | :--- | :--- |
140
- | `bugx init` | Initialize repository audit workspace and configuration (`.bugx/`) |
141
- | `bugx install` | Automatically register BugX with local AI assistants and editors |
142
- | `bugx doctor` | Diagnostic suite for MCP servers, environment binaries, and project configuration |
143
- | `bugx autonomous` | Run unattended, multi-round autonomous audit sessions; Cline supports `--workers 2..6` (or `0` for adaptive capacity) |
144
- | `bugx stats` | Global cross-project governance, token economy, and audit velocity metrics |
145
- | `bugx test-generate` | Generate standardized AAA unit tests or minimal reproduction PoCs |
146
- | `bugx test-audit` | Four-dimensional quality audit for existing test suites |
147
- | `bugx test-verify` | Verify test suite defect-catching effectiveness via AST mutation |
148
- | `bugx patch-forge` | Synthesize minimal self-healing patches and run red-green verification |
149
- | `bugx uninstall` | Cleanly remove host integrations while safely retaining audit findings |
150
- | `bugx update` | Check and upgrade BugX to the latest release |
151
-
152
- Autonomous sessions keep their host, execution mode, worker capacity, and dispatch settings in the current project’s `.bugx/bugx-runtime.json`. Each workspace has its own runtime context, so concurrent hosts do not share global scheduling state. Use `bugx autonomous --host cline --workers 4` to select an explicit Cline process-pool capacity; `0` keeps adaptive capacity.
174
+ **What is BugX?**
175
+ An autonomous code-audit agent for AI-written code. It runs inside AI coding assistants (via MCP) or as a CLI, tracks audit coverage per unit, and verifies every finding by executing it.
153
176
 
154
- ---
177
+ **How does BugX verify a vulnerability?**
178
+ 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.
155
179
 
156
- ### 🛡️ Security & Privacy Guarantees
180
+ **Does BugX trigger AI model cyber-security risk blocks?**
181
+ 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.
157
182
 
158
- - **Local-First Execution**: AST parsing, mutation runs, reproduction scripts, and local audit artifacts remain on your disk in `.bugx/`.
159
- - **No Unsolicited Source Upload**: BugX does not transmit proprietary source code without explicit cloud-sync or reporting authorization. Finding/report behavior follows the configured cloud and redaction settings; `BUGX_REPORT_REDACTION=standard` enables credential/path redaction.
160
- - **Deterministic Bounds**: Concurrency budgets, timeout thresholds, and execution sandboxes ensure your host system remains stable.
183
+ **Does BugX send my code to the cloud?**
184
+ The audit itself runs locally. Cloud sync of lessons and experience is an explicit opt-in; nothing is uploaded unless you run it.
161
185
 
162
- ---
186
+ **Does BugX replace human review?**
187
+ 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.
163
188
 
164
- ## 🇨🇳 简体中文说明
189
+ **What languages does BugX audit?**
190
+ 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.
165
191
 
166
- ### ⚡ 什么是 BugX?
192
+ ### Keywords
167
193
 
168
- **BugX** 是一款专为现代主流 AI 编程助手(Claude Code、OpenAI Codex、OpenCode、Cursor、Windsurf、DeepSeek Harness 等)打造的**自主闭环、证据驱动型深度代码审计与漏洞挖掘智能体**。
194
+ 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 · roo code · zcode · coding agent · llm code review · autonomous audit · behavior diff · memory leak detection · python security · javascript security · devsecops
169
195
 
170
- 与传统的静态代码分析工具(仅产生大量未经证实的告警和噪音)不同,BugX 严格遵循**“事实证据闭环验证协议”**:
196
+ ---
171
197
 
172
- ```mermaid
173
- flowchart LR
174
- A[项目源码] --> B[白盒 AST 与接口遍历]
175
- B --> C[变异测试与并发竞态扰动]
176
- C --> D[自包含独立可执行 PoC]
177
- D --> E[TDD 红绿双跑最小安全补丁]
178
- ```
198
+ ## 简体中文说明
179
199
 
180
- - **拒绝口头推测**:每一个被确认的缺陷,系统都必须自动合成可独立执行验证的最小复现代码(Proof-of-Concept);
181
- - **红绿测试自愈合成**:通过本地隔离沙箱执行 Red-to-Green 差异双跑,在确认补丁精准修复且不引入任何回归前,绝不虚假结案;
182
- - **宿主无关,零侵入性**:不争夺模型执行权,代码阅读、测试执行与修复方案全部由开发者信任的 AI 宿主原生驱动。
200
+ ### 什么是 BugX?
183
201
 
184
- ---
202
+ BugX 是装进 AI 编程助手的**自动代码审计与自动化 Code Review 智能体(Agent)**。它对 AI 写出的代码做端到端自动化审计与代码审查:把项目拆成覆盖清单、派发并发审计 Worker、对每条候选漏洞做真实执行验证,最终产出一份详实的审计报告——每条漏洞都附带一条你可以亲手运行的复现命令。
185
203
 
186
- ### 📦 快速上手
204
+ 如果你的生产代码来自 AI 编程工具,BugX 就是那个专注于**自动代码审计**、**Code Review** 与安全加固的智能体层:它核查模型**实际交付了什么**,而不是模型**声称交付了什么**。
187
205
 
188
- #### 环境依赖要求
189
- - **Node.js**:`>= 18.0.0`
190
- - **Python**:`>= 3.11`(BugX 底层核心引擎由 Python 驱动,npm 包作为轻量 CLI 封装,启动时会自动无缝对接本机 Python 环境)
206
+ ### 为什么 AI 代码需要审计
191
207
 
192
- npm tarball 会完整携带经过完整性清单校验的 BugX 核心载荷、目录清单和 Web UI 静态资源;不依赖原生 `sqlite3` npm 包,MCP 注册表在适用运行时使用 Node 内置的 `node:sqlite` 路径。
208
+ AI 写代码的速度远超人工审查,而且模型带着训练层面的偏差——听起来做完了,比真的做完了更容易:
193
209
 
194
- ---
210
+ 1. **评分机制奖励自信。** 人类评分员给「我仔细查过了,没发现问题」的分数高于「文件我还没看完」。模型学会的是报喜。
211
+ 2. **检查贵,声称便宜。** 读几百个文件是体力活,回一句「没发现问题」只要几个字。
212
+ 3. **它不知道自己没查完。** 模型看不见自己的覆盖盲区,也不会说「做了一半」。
195
213
 
196
- #### 1. 使用 `npx` 免安装直接执行(零安装成本)
214
+ BugX 用一本账和四条硬规矩对抗这件事:逐单元覆盖清单(查完 / 卡住 / 未查)、强制复现(同一段攻击输入触发两次、正常输入触发零次)、审计可断点续跑、哈希链记录让每条结论都可复查。
197
215
 
198
- 无需全局安装,在任意工程目录下即可直接执行:
216
+ ### 快速上手
199
217
 
200
- ```bash
201
- # 检查系统与 AI 工具连通就绪状态
202
- npx @bencibro/bugx doctor
218
+ 要求 Node.js `>=18`;Python `>=3.11` 由包装器自动检测管理。
203
219
 
204
- # 在当前项目初始化审计工作空间 (.bugx/)
205
- npx @bencibro/bugx init
220
+ **免安装直接执行:**
206
221
 
207
- # 自动发现并接入本机已安装的主流 AI 工具
208
- npx @bencibro/bugx install
222
+ ```bash
223
+ npx bugx-cli doctor --strict # 检查系统就绪与 AI 工具连通
224
+ npx bugx-cli init # 初始化当前仓库(.bugx/)
225
+ npx bugx-cli install # 注册本地 AI 助手
209
226
  ```
210
227
 
211
- ---
228
+ **或全局安装:**
212
229
 
213
- #### 2. 全局安装(推荐日常开发)
230
+ ```bash
231
+ npm install -g bugx-cli
232
+ ```
214
233
 
215
- 使用你习惯的包管理器进行全局安装:
234
+ 装好后任意目录跑一次:
216
235
 
217
236
  ```bash
218
- # npm
219
- npm install -g @bencibro/bugx
237
+ bugx install # 列出检测到的 AI 宿主并注册 BugX MCP 服务
238
+ bugx doctor --strict # 健康自检
239
+ ```
220
240
 
221
- # pnpm
222
- pnpm add -g @bencibro/bugx
241
+ 一次装全所有宿主:`bugx install --agent all`。
223
242
 
224
- # yarn
225
- yarn global add @bencibro/bugx
243
+ **方式一:在 AI 助手里用(推荐)。** 在任意项目里打开 Claude Code、Codex、Cline、OpenCode 或 ZCode,直接说:
226
244
 
227
- # bun
228
- bun add -g @bencibro/bugx
229
- ```
245
+ > 「审计一下这个项目」
246
+ > 「查一下登录模块有没有漏洞」
247
+
248
+ 宿主里的 AI 会自动调用 BugX:建覆盖清单、派发并发 Worker、跑探针、验证漏洞、出报告。想实时看,终端跑 `bugx report serve`,浏览器打开 http://127.0.0.1:8080。
230
249
 
231
- 全局安装后,在任意代码仓库根目录下直接使用 `bugx` 命令:
250
+ **方式二:命令行直接跑。** AI 同样来自你已装好的宿主——模型和凭据直接复用,不接管你的 Key。
232
251
 
233
252
  ```bash
234
- # 初始化
235
- bugx init
253
+ bugx auth login # 登录云端账号(错题/经验同步用)
254
+ bugx init --cloud-sync sync # 开启云端同步
236
255
 
237
- # 一键接入全部 AI 工具
238
- bugx install
256
+ bugx engine pre # 建立覆盖清单与审计计划
257
+ bugx engine status # 看进度
258
+ bugx engine post # 结账:核对覆盖、证据与裁决
239
259
 
240
- # 诊断与健康检查
241
- bugx doctor
260
+ bugx autonomous --host opencode # 无人值守完整审计
261
+ bugx report serve # 实时 Web 报告 http://127.0.0.1:8080
242
262
  ```
243
263
 
244
- 安装完成后,直接在你的 AI 编程助手(如 Claude Code 或 OpenCode)中对话即可:
245
- > *“使用 BugX 对本项目的 API 边界与数据持久化逻辑进行深度审计。”*
264
+ ### 支持的 AI 编程宿主
246
265
 
247
- ---
248
-
249
- ### 🤖 支持的 AI 编程宿主
250
-
251
- | AI 编程助手 | 接入机制 | 快速安装命令 |
266
+ | AI 编程助手 | 接入方式 | 安装命令 |
252
267
  | :--- | :--- | :--- |
253
- | **Claude Code** | 原生 MCP / 自治生命周期 | `bugx install --agent claude` |
254
- | **OpenAI Codex** | 工作区子 Agent / 原生插件 | `bugx install --agent codex` |
255
- | **OpenCode** | Headless ACP / 原生 MCP | `bugx install --agent opencode` |
256
- | **DeepSeek Harness (DSH)** | 官方 Web UI 扩展与 MCP | `bugx install --agent dsh` |
257
- | **WorkBuddy** | 官方 IDE 连接器拓展包 | `bugx install --agent workbuddy` |
258
- | **Cline / Roo Code** | 插件 MCP 交互会话(单 Claim 串行)/ CLI 多进程池自治并发 | `bugx install --agent cline` |
259
- | **ChatGPT** | 项目级 MCP / 交互式宿主接入 | `bugx install --agent chatgpt` |
260
- | **ZCode** | 原生 MCP / 宿主接入 | `bugx install --agent zcode` |
261
- | **Pi** | 原生 MCP / 宿主接入 | `bugx install --agent pi` |
262
- | **Qoder AI** | 原生 MCP / 宿主接入 | `bugx install --agent qoder` |
263
- | **Trea** | 原生 MCP / 宿主接入 | `bugx install --agent trea` |
264
- | **FunIDE** | 原生 MCP / 宿主接入 | `bugx install --agent funide` |
265
- | **Cursor / Windsurf** | 通用 MCP 服务协议 | `bugx mcp serve --role host` |
266
-
267
- 运行 `bugx hosts` 可实时查看当前设备上支持与检测到的 AI 工具清单。
268
+ | Claude Code | 原生 MCP / 自治生命周期 | `bugx install --agent claude` |
269
+ | OpenAI Codex | 工作区子 Agent / 原生插件 | `bugx install --agent codex` |
270
+ | OpenCode | Headless ACP / 原生 MCP | `bugx install --agent opencode` |
271
+ | Cline / Roo Code | MCP 会话(串行)/ CLI 多进程池并发 | `bugx install --agent cline` |
272
+ | ZCode | 原生 MCP / 用户级注册 | `bugx install --agent zcode` |
268
273
 
269
- ---
274
+ DeepSeek Harness(DSH)、WorkBuddy、Cursor / Windsurf 等持续适配中。运行 `bugx hosts` 查看本机检测到的宿主。
270
275
 
271
- ### 🛡️ 安全与隐私保障
276
+ ### 安全与隐私
272
277
 
273
- - **本地优先执行(Local-First)**:AST 解析、变异测试、PoC 脚本与本地审计产物保留在本地磁盘的 `.bugx/` 目录中。
274
- - **不擅自上传源码**:未经明确的云同步或报告授权,BugX 不会传输业务专有源代码;Finding/报告行为遵循当前云端与脱敏配置,设置 `BUGX_REPORT_REDACTION=standard` 可启用凭据和路径脱敏。
275
- - **沙盒自愈与资源有界防护**:严格限定最大并发度、单回合墙钟预算与文件资源锁,保障宿主系统的绝对稳定性。
278
+ - 项目状态存放在项目内 `.bugx/` 目录;全局引擎、凭据、知识库与缓存在用户级 BugX 目录。
279
+ - 凭据按需写入受控沙箱(默认仅当前用户可读);`bugx auth status` 只报告是否存在,不输出内容。
280
+ - 云端上传、反馈、诊断上报与同步都是显式操作,执行前明确 `--scope`。
281
+ - `reset` / `uninstall` / `purge` / `--no-backup` 会删除数据,注意各自的 dry-run 与备份行为。
276
282
 
277
- ---
283
+ ### 关键词
284
+
285
+ 自动代码审计 · AI 代码审计 · 自动化 Code Review · Code Review · 代码审查 Agent · 代码审计智能体 · AI Agent · Vibe Coding 安全 · 氛围编程审计 · PR 自动审查 · 零误报 · 真实 PoC 复现 · 盲审验证 · 安全审计 · 漏洞扫描 · 漏洞挖掘 · 静态分析 · MCP 服务 · MCP 安全 · Claude Code 审计 · Codex 审计 · 编程助手安全 · 自主审计 · 行为差分 · 内存泄漏检测 · Python 安全 · JavaScript 安全 · DevSecOps
278
286
 
279
- ### 📄 许可证与商业授权
287
+ ## License
280
288
 
281
- 基于 BSL 1.1 (Business Source License 1.1) 协议(见仓库根 [LICENSE](../../LICENSE) 或 npm 包内 LICENSE 文件),允许个人与企业免费用于内部研发与日常安全评估;发布 3 年后自动转为 Apache 2.0。BugX Cloud 云端服务采用商业授权,商务合作请联系 business@bugx.dev。
289
+ [Business Source License 1.1](https://github.com/Bencibr/bugx/blob/main/LICENSE)
package/core/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # BugX 微内核与核心领域系统 (Core Microkernel & Domain Architecture)
2
2
 
3
- > **版本契约**: `1.0.0` | **调度微内核**: `core/launch_bugx.py` + `core/supervisor/`
3
+ > **版本契约**: `0.1.2` | **调度微内核**: `core/launch_bugx.py` + `core/supervisor/`
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
- > **守卫机制**: `scripts/verify_directory_indices.py` + `tests/test_consistency.py` (100% 索引对齐防漂移)
5
+ > **守卫机制**: `scripts/verify_directory_indices.py` (100% 索引对齐防漂移)
6
6
 
7
7
  本文档为 BugX `core/` 目录的唯一权威架构全景与物理文件索引字典。记录了微内核分层架构、34 个专业领域子系统、核心底层资产及全部物理文件索引。
8
8
 
@@ -20,7 +20,7 @@ flowchart TD
20
20
 
21
21
  subgraph ArtifactsEvaluation["3. 产物封签与效果评估"]
22
22
  AA["agent_artifacts.py<br/>中间补丁、测试日志与产物规范哈希封签"]
23
- AE["agent_eval.py<br/>行为指标度量、基线门槛对比与质量打分"]
23
+ AE["agent_eval.py<br/>行为指标度量、基线门槛对比与质量打分<br/>feature_baseline.py(功能完备性基准评测)"]
24
24
  end
25
25
 
26
26
  Orchestration --> WorkspaceExecution
@@ -36,6 +36,7 @@ flowchart TD
36
36
  | `__init__.py` | 智能体领域子包入口与核心符号导出 | `AgentOrchestrator`, `AgentWorkspace`, `AgentArtifact` |
37
37
  | `agent_artifacts.py` | 统一管理 Worker 生成的中间补丁、测试日志与证据文件规范与哈希封签 | `AgentArtifact`, `BugCandidate`, `ReproCase`, `PatchCandidate`, `seal_artifact` |
38
38
  | `agent_eval.py` | 对 Agent 执行输出进行一致性度量与质量评估打分 | `score`, `validate_cases`, `validate_findings`, `metrics_record` |
39
+ | `feature_baseline.py` | 功能完备性基准评测(F-022):声明被审产品功能清单与植入缺失,`completeness_recall/precision/by_domain` 三指标计入 quality_score(权重 0.25)。管线接线:baseline 可经 `--feature-baseline` 或**评测集内嵌**(cases payload `feature_baseline` 键,flag 优先)启用;`_print_score` 输出 `完备性召回/完备性精确/植入缺失检出` 行供 scenario_eval L4 解析 | `validate_feature_baseline`, `completeness_metrics`, `FeatureBaselineError` |
39
40
  | `agent_execution.py` | Agent 执行管道,驱动任务状态机并在超时时安全回收子进程组 | `execute_check_plan`, `CheckPlan`, `ExecutionObservation` |
40
41
  | `agent_orchestrator.py` | 多 Agent 协作调度微内核,负责任务拆解、拓扑依赖与工作分配 | `AgentOrchestrator`, `assemble_task_prompt` |
41
42
  | `agent_targets.py` | 被测代码库攻击面切片与多 Worker 并发分配算法 | `adapt_project`, `adapt_python_project`, `adapt_node_project` |
@@ -13,6 +13,8 @@ from functools import lru_cache
13
13
  from pathlib import Path, PureWindowsPath
14
14
  from typing import Any, Mapping, TypeAlias
15
15
 
16
+ from core.infra.json_utils import unique_json_object
17
+
16
18
  try:
17
19
  from jsonschema import Draft202012Validator, FormatChecker
18
20
  except ImportError: # strict validation fails closed when the validator is unavailable
@@ -356,12 +358,12 @@ def _finite_float(value: str) -> float:
356
358
 
357
359
 
358
360
  def _unique_object(pairs: list[tuple[str, Any]]) -> dict[str, Any]:
359
- result: dict[str, Any] = {}
360
- for key, value in pairs:
361
- if key in result:
362
- raise ArtifactValidationError(f"duplicate JSON object key: {key}")
363
- result[key] = value
364
- return result
361
+ return unique_json_object(
362
+ pairs,
363
+ error_factory=lambda key: ArtifactValidationError(
364
+ f"duplicate JSON object key: {key}"
365
+ ),
366
+ )
365
367
 
366
368
 
367
369
  def parse_json(data: str | bytes | bytearray) -> Any: