bugx-cli 0.1.2 → 0.1.4

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 (157) hide show
  1. package/README.md +26 -29
  2. package/core/README.md +5 -3
  3. package/core/agent/agent_orchestrator.py +3 -0
  4. package/core/agent/agent_workspace.py +14 -2
  5. package/core/assets/bugx-wechat-group.png +0 -0
  6. package/core/assets/twitter_promo_art.jpg +0 -0
  7. package/core/assets/twitter_promo_card.svg +166 -0
  8. package/core/assets/twitter_promo_clean.jpg +0 -0
  9. package/core/assets/twitter_terminal_real.png +0 -0
  10. package/core/bugx.md +3 -3
  11. package/core/bugx_paths.py +10 -2
  12. package/core/bundled_docs/OVERVIEW.md +310 -0
  13. package/core/bundled_docs/README.md +10 -0
  14. package/core/bundled_docs/README_EN.md +278 -0
  15. package/core/bundled_docs/ai/01_AI_REFERENCE.md +833 -0
  16. package/core/bundled_docs/ai/02_AI_USAGE.md +161 -0
  17. package/core/bundled_docs/ai/03_AI_COMMANDS.md +322 -0
  18. package/core/bundled_docs/guides/01_USER_GUIDE.md +887 -0
  19. package/core/bundled_docs/guides/02_COMMANDS.md +935 -0
  20. package/core/bundled_docs/guides/03_TROUBLESHOOTING.md +763 -0
  21. package/core/bundled_docs/guides/04_CLOUD_AUTH_AND_SYNC_COOKBOOK.md +48 -0
  22. package/core/bundled_docs/guides/05_HOST_MATRIX_AND_DISPATCH.md +23 -0
  23. package/core/bundled_docs/guides/06_PROBES_AND_POC_COOKBOOK.md +49 -0
  24. package/core/bundled_docs/guides/07_LIFECYCLE_AND_RECOVERY_STATES.md +46 -0
  25. package/core/bundled_docs/guides/08_LESSONS_AND_PRIVACY_BOUNDARY.md +35 -0
  26. package/core/bundled_docs/hosts/bugx-claude_SKILL.md +326 -0
  27. package/core/bundled_docs/hosts/bugx-dsh_SKILL.md +229 -0
  28. package/core/bundled_docs/hosts/bugx-opencode_SKILL.md +129 -0
  29. package/core/bundled_docs/hosts/bugx-zcode_SKILL.md +459 -0
  30. package/core/bundled_docs/hosts/bugx_SKILL.md +118 -0
  31. package/core/bundled_docs/hosts/cline_bugx_SKILL.md +69 -0
  32. package/core/bundled_docs/hosts/platform_bugx_SKILL.md +50 -0
  33. package/core/bundled_docs/manifest.json +140 -0
  34. package/core/bundled_docs/reference/01_ENVIRONMENT_VARIABLES.md +421 -0
  35. package/core/bundled_docs/reference/04_REPOSITORY_TOPOLOGY.md +180 -0
  36. package/core/cli-help.txt +7 -3
  37. package/core/cloud_sync/cloud_client.py +81 -2
  38. package/core/cloud_sync/endpoint_router.py +22 -9
  39. package/core/cloud_sync/issue_uploader.py +297 -0
  40. package/core/cloud_sync/sensitive_filter.py +77 -7
  41. package/core/contracts/AGENT_GUIDE.md +3 -9
  42. package/core/contracts/README.md +1 -1
  43. package/core/contracts/bugx-opencode.md +1 -1
  44. package/core/contracts/bugx-runtime-contract.md +10 -20
  45. package/core/contracts/bugx-worker.md +1 -1
  46. package/core/engine-integrity.json +267 -111
  47. package/core/host_acp/antigravity.py +153 -0
  48. package/core/host_acp/kimi.py +175 -0
  49. package/core/host_acp/minimax.py +28 -0
  50. package/core/host_runtime/adapters.py +5 -1
  51. package/core/host_runtime/antigravity.py +162 -0
  52. package/core/host_runtime/host_bootstrap.py +18 -7
  53. package/core/host_runtime/host_evaluators.py +4 -4
  54. package/core/host_runtime/host_registry.py +25 -4
  55. package/core/host_runtime/mcp_process_tracker.py +30 -3
  56. package/core/host_runtime/mcp_registry_gate.py +34 -11
  57. package/core/hosts/antigravity.py +115 -0
  58. package/core/hosts/codex.py +3 -0
  59. package/core/hosts/dsh.py +43 -24
  60. package/core/hosts/kimi.py +293 -0
  61. package/core/hosts/minimax.py +249 -0
  62. package/core/hosts/zcode.py +5 -0
  63. package/core/i18n.py +94 -5
  64. package/core/infra/README.md +1 -1
  65. package/core/infra/build_info.py +30 -5
  66. package/core/launch_phases/README.md +2 -2
  67. package/core/launch_phases/startup_version_gate.py +2 -2
  68. package/core/launch_phases/supervisor_bridge.py +16 -23
  69. package/core/launch_phases/supervisor_degraded.py +7 -5
  70. package/core/ledger/README.md +1 -1
  71. package/core/locales/en-US.json +3 -3
  72. package/core/locales/zh-CN.json +3 -3
  73. package/core/mcp_runtime_support/environment.py +6 -1
  74. package/core/metadata.txt +2 -2
  75. package/core/planning/README.md +1 -1
  76. package/core/planning/prompt_harness.py +2 -2
  77. package/core/probes/codebase_memory_probe.py +43 -24
  78. package/core/probes/probe_registry.py +10 -7
  79. package/core/prompts/command_routing_en.md +6 -5
  80. package/core/prompts/command_routing_zh.md +6 -5
  81. package/core/repair/rsi_rounds.py +3 -0
  82. package/core/repair/self_heal.py +160 -6
  83. package/core/retrieval/README.md +1 -1
  84. package/core/runtime/README.md +1 -1
  85. package/core/runtime/scenario_eval.py +5 -1
  86. package/core/runtime/setup_ui_env.py +4 -7
  87. package/core/runtime/tool_install_targets.py +12 -2
  88. package/core/skills/README.md +4 -2
  89. package/core/skills/bugx_docs_cloud_sync.py +658 -0
  90. package/core/skills/bugx_docs_mcp_server.py +966 -140
  91. package/core/supervisor/README.md +1 -1
  92. package/core/supervisor/cli.py +2 -2
  93. package/core/supervisor/worker_execution.py +16 -3
  94. package/core/webui/docs_session_service.py +40 -2
  95. package/core/webui/mcp_inspector.py +12 -6
  96. package/core/webui/static/index.html +51 -3
  97. package/core/webui/static/manifest.webmanifest +1 -1
  98. package/core/webui/static/project-settings.js +18 -3
  99. package/core/webui/static/robots.txt +36 -0
  100. package/core/webui/static/sitemap.xml +15 -0
  101. package/docs/07_distribution/01_README_NPM.md +26 -29
  102. package/ecosystem/integrations/cline/skills/bugx/SKILL.md +46 -46
  103. package/ecosystem/integrations/dsh/agents/bugx.md +2 -1
  104. package/ecosystem/integrations/dsh/dsh-patch.yml +2 -2
  105. package/ecosystem/integrations/dsh/mcp/package.json +1 -1
  106. package/ecosystem/integrations/dsh/skills/bugx/SKILL.md +6 -6
  107. package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +1 -1
  108. package/ecosystem/integrations/dsh/ui/package.json +1 -1
  109. package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +2 -2
  110. package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
  111. package/ecosystem/integrations/pi/skills/bugx/SKILL.md +6 -6
  112. package/ecosystem/integrations/qoder/CONNECTORS.md +11 -23
  113. package/ecosystem/integrations/qoder/connector-meta.json +9 -9
  114. package/ecosystem/integrations/workbuddy/connector-meta.json +9 -9
  115. package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +8 -7
  116. package/ecosystem/plugins/bugx/.claude-plugin/marketplace.json +2 -2
  117. package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +2 -2
  118. package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +4 -4
  119. package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +2 -2
  120. package/ecosystem/plugins/bugx/agents/bugx-worker.md +14 -18
  121. package/ecosystem/plugins/bugx/agents/bugx.md +45 -49
  122. package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +8 -8
  123. package/ecosystem/plugins/bugx/skills/bugx-claude/SKILL.md +1 -1
  124. package/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +1 -1
  125. package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +1 -1
  126. package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +3 -3
  127. package/interfaces/bin/bugx.js +2 -0
  128. package/interfaces/cli/bugx_cli/__init__.py +2 -2
  129. package/interfaces/cli/bugx_cli/cli.py +153 -8
  130. package/interfaces/cli/bugx_cli/commands/agent.py +568 -136
  131. package/interfaces/cli/bugx_cli/commands/cloud.py +42 -1
  132. package/interfaces/cli/bugx_cli/commands/doctor.py +668 -223
  133. package/interfaces/cli/bugx_cli/commands/guide.py +143 -0
  134. package/interfaces/cli/bugx_cli/commands/issue.py +262 -0
  135. package/interfaces/cli/bugx_cli/commands/lifecycle.py +99 -62
  136. package/interfaces/cli/bugx_cli/commands/plugin.py +301 -60
  137. package/interfaces/cli/bugx_cli/commands/plugin_antigravity.py +350 -0
  138. package/interfaces/cli/bugx_cli/commands/plugin_claude.py +27 -13
  139. package/interfaces/cli/bugx_cli/commands/plugin_kimi.py +440 -0
  140. package/interfaces/cli/bugx_cli/commands/plugin_minimax.py +522 -0
  141. package/interfaces/cli/bugx_cli/commands/plugin_qoder.py +3 -4
  142. package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +4 -5
  143. package/interfaces/cli/bugx_cli/commands/system.py +75 -5
  144. package/interfaces/cli/bugx_cli/common.py +135 -15
  145. package/interfaces/cli/bugx_cli/host_adapters.py +190 -7
  146. package/interfaces/cli/bugx_cli/hosts/registry.py +6 -3
  147. package/interfaces/cli/bugx_cli/hosts/template_engine.py +31 -11
  148. package/interfaces/cli/bugx_cli/infra/__init__.py +4 -0
  149. package/interfaces/cli/bugx_cli/infra/ai_advisor.py +14 -12
  150. package/interfaces/cli/bugx_cli/infra/engine_installer.py +76 -10
  151. package/interfaces/cli/bugx_cli/infra/host_sync.py +66 -1
  152. package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +242 -52
  153. package/package.json +38 -13
  154. package/pyproject.toml +57 -13
  155. package/scripts/sync-version.mjs +1 -1
  156. package/skills/README.md +24 -0
  157. package/skills/platform/bugx/SKILL.md +50 -0
@@ -1,6 +1,6 @@
1
1
  # BugX Supervisor (并发协调与智能体调度仲裁中心)
2
2
 
3
- > **版本契约**: `0.1.2` | **所属分层**: `Layer 3: 并发协调、智能体编排与账本`
3
+ > **版本契约**: `0.1.4` | **所属分层**: `Layer 3: 并发协调、智能体编排与账本`
4
4
  > **工程规范**: 参见 [`docs/02_architecture/05_ARCH_NOMENCLATURE_GUIDE.md`](../../docs/02_architecture/05_ARCH_NOMENCLATURE_GUIDE.md)
5
5
  > **守卫机制**: `scripts/verify_directory_indices.py` (100% 物理条目索引覆盖)
6
6
 
@@ -41,9 +41,9 @@ _RPC_CLIENT_INFO: Mapping[str, object] = {
41
41
 
42
42
  try:
43
43
  if hasattr(sys.stdout, "reconfigure"):
44
- sys.stdout.reconfigure(line_buffering=True)
44
+ sys.stdout.reconfigure(line_buffering=True, encoding="utf-8", errors="replace")
45
45
  if hasattr(sys.stderr, "reconfigure"):
46
- sys.stderr.reconfigure(line_buffering=True)
46
+ sys.stderr.reconfigure(line_buffering=True, encoding="utf-8", errors="replace")
47
47
  except (AttributeError, ValueError):
48
48
  pass
49
49
 
@@ -84,10 +84,23 @@ def terminate_group(process: subprocess.Popen[bytes]) -> None:
84
84
  # 即使父进程已经退出,后台孙进程仍可能保留该进程组;必须
85
85
  # 继续清理整个组,避免它们脱离 Worker 生命周期。
86
86
  os.killpg(process.pid, signal.SIGTERM)
87
- elif process.poll() is None: # pragma: no cover - Windows fallback
88
- process.terminate()
89
- except (OSError, ProcessLookupError):
87
+ else: # pragma: no cover - Windows fallback
88
+ # Do not invoke an asynchronous tree-kill command here: a delayed
89
+ # PID-based command can target an unrelated process after PID
90
+ # reuse. The caller owns the exact ACP parent and closes its pipes.
91
+ if process.poll() is None:
92
+ process.terminate()
93
+ except (OSError, ProcessLookupError, subprocess.TimeoutExpired):
90
94
  pass
95
+ if os.name == "nt": # pragma: no cover - Windows fallback
96
+ # Windows process handles may remain non-signaled while Antigravity's
97
+ # child MCP pipes drain. Never wait on that handle in the teardown
98
+ # path: kill this exact parent and return.
99
+ try:
100
+ process.kill()
101
+ except (OSError, ProcessLookupError):
102
+ pass
103
+ return
91
104
  deadline = time.monotonic() + _KILL_GRACE_SECONDS
92
105
  while process.poll() is None and time.monotonic() < deadline:
93
106
  time.sleep(0.02)
@@ -358,11 +358,49 @@ def _search_docs_fts5(self, proj_root: Path, query: str) -> dict[str, Any]:
358
358
  return {"ok": True, "query": "", "results": []}
359
359
  root = proj_root.resolve()
360
360
  results: list[dict[str, Any]] = []
361
+ seen_paths: set[str] = set()
361
362
 
362
- # Scan indexed docs tree for fast substring/token match with line numbers
363
+ # 1. 优先对接 bugx-docs 双作用域章节级 FTS5 trigram 检索引擎(DOC-006 设计项 7)
364
+ try:
365
+ from core.skills import bugx_docs_mcp_server as docs_server
366
+ db_path = root / ".bugx" / "knowledge" / "docs.sqlite3"
367
+ project_id = root.name
368
+ rag = docs_server.call_tool(
369
+ db_path,
370
+ "search_docs",
371
+ {"query": q, "limit": 20, "library_id": "all", "project_id": project_id},
372
+ project_id=project_id,
373
+ expected_token=None,
374
+ )
375
+ for item in rag.get("results") or []:
376
+ rel = str(item.get("source") or "")
377
+ if not rel:
378
+ continue
379
+ lib = str(item.get("library_id") or "")
380
+ key = f"{lib}:{rel}:{item.get('section') or ''}"
381
+ if key in seen_paths:
382
+ continue
383
+ seen_paths.add(key)
384
+ results.append({
385
+ "path": rel,
386
+ "name": rel.rsplit("/", 1)[-1],
387
+ "category": "official_docs" if lib == docs_server.OFFICIAL_LIBRARY_ID else "project_docs",
388
+ "library_id": lib,
389
+ "section": item.get("section") or "",
390
+ "heading_path": item.get("heading_path") or "",
391
+ "line": 1,
392
+ "snippet": str(item.get("snippet") or "")[:300],
393
+ })
394
+ except Exception:
395
+ pass
396
+
397
+ # 2. 补充扫描未纳入 bugx-docs 的本地报告/配置 (.bugx/ 报告及顶层配置)
363
398
  tree = self._get_docs_tree(root)
364
399
  q_lower = q.lower()
365
400
  for grp in tree.get("groups", []):
401
+ grp_id = grp.get("id")
402
+ if grp_id not in {"audit_reports", "config_files"} and results:
403
+ continue
366
404
  for item in grp.get("items", []):
367
405
  rel = item["path"]
368
406
  fpath = root / rel
@@ -384,7 +422,7 @@ def _search_docs_fts5(self, proj_root: Path, query: str) -> dict[str, Any]:
384
422
  break
385
423
  except Exception:
386
424
  continue
387
- return {"ok": True, "query": q, "results": results}
425
+ return {"ok": True, "query": q, "results": results[:50]}
388
426
 
389
427
  def _list_fs(self, sub_path: str) -> dict[str, Any]:
390
428
  """List subdirectories and files in sub_path (supports ~, absolute, and relative paths)."""
@@ -383,7 +383,7 @@ def _default_mcp_command(name: str, reg_entry: dict[str, Any]) -> tuple[str, lis
383
383
  if name == "bugx-supervisor-worker":
384
384
  return "bugx", ["mcp", "serve", "--root", ".", "--role", "worker"]
385
385
  if name == "bugx-docs":
386
- return "bugx", ["mcp", "serve", "--root", ".", "--role", "docs"]
386
+ return "bugx", ["mcp", "docs", "serve", "--root", ".", "--db", ".bugx/knowledge/docs.sqlite3"]
387
387
  if name in ONLINE_MCP_CATALOG:
388
388
  on_item = ONLINE_MCP_CATALOG[name]
389
389
  return str(on_item.get("command") or "npx"), list(on_item.get("args") or [])
@@ -482,7 +482,7 @@ def inspect_workspace_mcp(workspace_path: Path | str) -> dict[str, Any]:
482
482
  if not servers:
483
483
  for def_name, def_tools, def_cmd in (
484
484
  ("bugx-supervisor", 12, "bugx mcp serve --root . --role host"),
485
- ("bugx-docs", 4, "bugx mcp serve --root . --role docs"),
485
+ ("bugx-docs", 4, "bugx mcp docs serve --root . --db .bugx/knowledge/docs.sqlite3"),
486
486
  ):
487
487
  is_dis = def_name in disabled_mcps
488
488
  servers.append({
@@ -536,10 +536,10 @@ MCP_TOOLS_CATALOG: dict[str, list[dict[str, str]]] = {
536
536
  {"name": "bugx_supervisor_status", "description": "查询 Supervisor 全局健康状态与运行指标", "parameters": "verbose"},
537
537
  ],
538
538
  "bugx-docs": [
539
- {"name": "docs_search", "description": "基于 SQLite FTS5 的项目架构与安全文档全文检索", "parameters": "query, top_k, namespace"},
540
- {"name": "docs_read", "description": "高效只读读取指定规范文档或 ADR 提案", "parameters": "path, line_range"},
541
- {"name": "docs_schema", "description": "获取文档元数据、目录结构与章节索引", "parameters": "category"},
542
- {"name": "docs_tree", "description": "检索工程文档树与 Diátaxis 架构规范", "parameters": "depth, filter"},
539
+ {"name": "resolve_library", "description": "解析当前项目或 BugX 官方受控文档库", "parameters": "name, project_id"},
540
+ {"name": "search_docs", "description": "在官方与当前项目文档章节级 FTS5 trigram 索引中检索", "parameters": "query, project_id, library_id, limit"},
541
+ {"name": "fetch_doc", "description": "高效只读读取指定文档或精确章节(保留子标题完整边界)", "parameters": "document_id, section, project_id"},
542
+ {"name": "list_sections", "description": "获取文档完整 Markdown 标题目录 (TOC) 与字符估算", "parameters": "document_id, project_id"},
543
543
  ],
544
544
  "postmcp": [
545
545
  {"name": "postmcp_http_request", "description": "构造并执行受控 HTTP/REST 请求(支持全动词)", "parameters": "url, method, headers, body, timeout"},
@@ -958,6 +958,12 @@ def toggle_project_mcp(
958
958
 
959
959
  res = inspect_workspace_mcp(ws)
960
960
  res["ok"] = True
961
+ if mount:
962
+ res["session_restart_required"] = True
963
+ res["restart_guidance"] = (
964
+ "项目 MCP 配置已更新至 .mcp.json。宿主进程(VS Code / Cursor / Windsurf / Claude 等)"
965
+ "不支持动态热重载,必须【重载窗口 / 重启宿主会话】方可生效。"
966
+ )
961
967
  res["sandbox_env_path"] = str(_sandbox_env_file(ws))
962
968
  return res
963
969
 
@@ -6,11 +6,45 @@
6
6
  name="viewport"
7
7
  content="width=device-width,initial-scale=1,viewport-fit=cover"
8
8
  />
9
- <title>BugX Studio · AI 编程与自主审计工作台</title>
9
+ <title>BugX Studio · 自主代码审查与智能测试智能体 | 全自动黑盒/功能/性能测试与质量保障</title>
10
10
  <meta
11
11
  name="description"
12
- content="BugX Studio — 统一多项目控制台与智能体调度工作台。"
12
+ content="BugX 是一个具备自主代码审查与测试能力的智能体,严把代码交付关:帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码稳定运行不崩溃不卡死,上线放心不翻车。"
13
13
  />
14
+ <meta
15
+ name="keywords"
16
+ content="BugX,代码审查,自主代码审查,自动化测试,智能测试,黑盒测试,功能测试,性能测试,代码质检,软件质量保障,解放双手,Bug排查,测试智能体,AI代码审查,Claude Code,Codex,OpenCode,ZCode"
17
+ />
18
+ <link rel="canonical" href="https://bugx.dev/" />
19
+ <!-- OpenGraph / Social Sharing -->
20
+ <meta property="og:type" content="website" />
21
+ <meta property="og:title" content="BugX · 自主代码审查与智能测试智能体" />
22
+ <meta property="og:description" content="严把代码交付关:帮助开发自动排查隐藏深层 Bug,帮助测试自动运行黑盒/功能/性能测试,确保稳定运行不崩溃不翻车,解放双手降本增效。" />
23
+ <meta property="og:url" content="https://bugx.dev/" />
24
+ <meta property="og:image" content="https://bugx.dev/icon-192.png" />
25
+ <meta property="og:site_name" content="BugX" />
26
+ <!-- Twitter Cards -->
27
+ <meta name="twitter:card" content="summary_large_image" />
28
+ <meta name="twitter:title" content="BugX · Autonomous Code Review & Automated Testing Agent" />
29
+ <meta name="twitter:description" content="Safeguarding software delivery: catches hidden deep bugs for developers, automates black-box, functional, and performance testing for QA, ensuring rock-solid stability." />
30
+ <meta name="twitter:image" content="https://bugx.dev/icon-192.png" />
31
+ <!-- Schema.org JSON-LD -->
32
+ <script type="application/ld+json">
33
+ {
34
+ "@context": "https://schema.org",
35
+ "@type": "SoftwareApplication",
36
+ "name": "BugX",
37
+ "operatingSystem": "All",
38
+ "applicationCategory": "DeveloperApplication",
39
+ "description": "BugX 是一个具备自主代码审查与测试能力的智能体,严把代码交付关:它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能符合要求、具备良好的健壮性和稳定性。让开发和测试在繁琐的工作中解放双手,大幅提高工作效率、全面提升代码质量、显著降低后期维护成本,实现科技服务于人。",
40
+ "url": "https://bugx.dev",
41
+ "offers": {
42
+ "@type": "Offer",
43
+ "price": "0",
44
+ "priceCurrency": "USD"
45
+ }
46
+ }
47
+ </script>
14
48
  <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
15
49
  <meta name="theme-color" content="#151517" media="(prefers-color-scheme: dark)" />
16
50
  <link rel="manifest" href="./manifest.webmanifest" />
@@ -50,6 +84,20 @@
50
84
  <script src="./project-settings.js?v=366" defer></script>
51
85
  </head>
52
86
  <body>
53
- <div id="app"></div>
87
+ <div id="app">
88
+ <noscript>
89
+ <div style="padding: 24px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; max-width: 800px; margin: 40px auto; color: #1e293b;">
90
+ <h1>BugX — 自主代码审查与自主测试智能体</h1>
91
+ <p><strong>BugX</strong> 是一个具备自主代码审查与测试能力的智能体,严把代码交付关:它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能符合要求、具备良好的健壮性和稳定性。让开发和测试在繁琐的工作中解放双手,大幅提高工作效率、全面提升代码质量、显著降低后期维护成本,实现科技服务于人。</p>
92
+ <h2>主要能力与适用场景</h2>
93
+ <ul>
94
+ <li><strong>代码审查(Code Review)</strong>:功能编写完成或提交 PR 时自动排查隐藏的深层逻辑缺陷与代码异味;</li>
95
+ <li><strong>自动化黑盒测试</strong>:在隔离沙箱中自动构造测试场景与边界用例,验证功能完备性;</li>
96
+ <li><strong>功能与性能验证</strong>:精准发现死锁、竞态、内存泄漏与资源未释放等深层隐患;</li>
97
+ <li><strong>上线前质量守门</strong>:确保交付用户的软件在复杂环境下稳定运行、不崩溃不卡死,上线放心不翻车。</li>
98
+ </ul>
99
+ </div>
100
+ </noscript>
101
+ </div>
54
102
  </body>
55
103
  </html>
@@ -2,7 +2,7 @@
2
2
  "id": "/",
3
3
  "name": "BugX Studio",
4
4
  "short_name": "BugX Studio",
5
- "description": "AI 编程与自主审计工作台 — 统一多项目控制台与智能体调度中心。",
5
+ "description": "自主代码审查与自主测试智能体 — 严把代码交付关,自动化运行黑盒测试、功能验证与性能测试,保障软件稳定不翻车。",
6
6
  "start_url": "/",
7
7
  "scope": "/",
8
8
  "display": "standalone",
@@ -7841,7 +7841,12 @@
7841
7841
  body: JSON.stringify(payload)
7842
7842
  });
7843
7843
  if (res.ok) {
7844
- showToast(`已成功挂载 MCP: ${srvName}`);
7844
+ const resData = await res.json().catch(() => ({}));
7845
+ if (resData && resData.session_restart_required) {
7846
+ alert(`【必须重启宿主】已成功挂载 MCP: ${srvName}\n\n项目 MCP 配置已更新至 .mcp.json。\n宿主(VS Code / Cursor / Windsurf / Claude 等)不支持动态热加载,请务必【重载窗口 / 重启宿主会话】方可生效!`);
7847
+ } else {
7848
+ showToast(`已成功挂载 MCP: ${srvName}`);
7849
+ }
7845
7850
  await this.loadData();
7846
7851
  this.render();
7847
7852
  } else {
@@ -8019,7 +8024,12 @@
8019
8024
  if (res.ok) {
8020
8025
  it.mounted = true;
8021
8026
  it.enabled = true;
8022
- showToast(`已成功挂载 MCP: ${it.name}`);
8027
+ const resData = await res.json().catch(() => ({}));
8028
+ if (resData && resData.session_restart_required) {
8029
+ alert(`【必须重启宿主】已成功挂载 MCP: ${it.name}\n\n项目 MCP 配置已更新至 .mcp.json。\n宿主(VS Code / Cursor / Windsurf / Claude 等)不支持动态热加载,请务必【重载窗口 / 重启宿主会话】方可生效!`);
8030
+ } else {
8031
+ showToast(`已成功挂载 MCP: ${it.name}`);
8032
+ }
8023
8033
  await this.loadData();
8024
8034
  this.render();
8025
8035
  } else {
@@ -8198,7 +8208,12 @@
8198
8208
  })
8199
8209
  });
8200
8210
  if (res.ok) {
8201
- showToast(`成功挂载自定义 MCP: ${name}`);
8211
+ const resData = await res.json().catch(() => ({}));
8212
+ if (resData && resData.session_restart_required) {
8213
+ alert(`【必须重启宿主】成功挂载自定义 MCP: ${name}\n\n项目 MCP 配置已更新至 .mcp.json。\n宿主(VS Code / Cursor / Windsurf / Claude 等)不支持动态热加载,请务必【重载窗口 / 重启宿主会话】方可生效!`);
8214
+ } else {
8215
+ showToast(`成功挂载自定义 MCP: ${name}`);
8216
+ }
8202
8217
  closeModal();
8203
8218
  await this.loadData();
8204
8219
  this.render();
@@ -0,0 +1,36 @@
1
+ # robots.txt for BugX WebUI & Public Interface
2
+ User-agent: *
3
+ Allow: /
4
+ Disallow: /api/
5
+ Disallow: /private/
6
+
7
+ # Explicitly Allow Major Search Bots and Generative AI Answer Engines
8
+ User-agent: Googlebot
9
+ Allow: /
10
+
11
+ User-agent: Baiduspider
12
+ Allow: /
13
+
14
+ User-agent: Bingbot
15
+ Allow: /
16
+
17
+ User-agent: GPTBot
18
+ Allow: /
19
+
20
+ User-agent: OAI-SearchBot
21
+ Allow: /
22
+
23
+ User-agent: PerplexityBot
24
+ Allow: /
25
+
26
+ User-agent: ClaudeBot
27
+ Allow: /
28
+
29
+ User-agent: Applebot-Extended
30
+ Allow: /
31
+
32
+ User-agent: Bytespider
33
+ Allow: /
34
+
35
+ # Sitemap Location
36
+ Sitemap: https://bugx.dev/sitemap.xml
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
+ <url>
4
+ <loc>https://bugx.dev/</loc>
5
+ <lastmod>2026-11-23</lastmod>
6
+ <changefreq>daily</changefreq>
7
+ <priority>1.0</priority>
8
+ </url>
9
+ <url>
10
+ <loc>https://bugx.dev/docs</loc>
11
+ <lastmod>2026-11-23</lastmod>
12
+ <changefreq>weekly</changefreq>
13
+ <priority>0.8</priority>
14
+ </url>
15
+ </urlset>
@@ -2,11 +2,16 @@
2
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
- # BugX — AI Code Audit & Code Review Agent for Claude Code, Codex, Cline, OpenCode, and ZCode
5
+ # BugX — Autonomous Code Review & Automated Testing Agent
6
6
 
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.
7
+ BugX is an autonomous code review and automated testing agent that lives inside your AI coding assistant or runs standalone on the command line.
8
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.
9
+ **It safeguards software delivery at every step:**
10
+ - **For Developers**: Catches subtle, high-impact bugs immediately after code is written, eliminating painful debugging loops and rework.
11
+ - **For QA & Test Engineers**: Automates black-box, functional, and performance testing across complex edge cases that manual reviews often miss.
12
+ - **For Engineering Teams**: Guarantees code strictly meets functional contracts with rock-solid stability and resilience, ensuring dependable, crash-free releases.
13
+
14
+ 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**.
10
15
 
11
16
  <p align="center">
12
17
  <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>
@@ -73,12 +78,10 @@ The skill marketplace ships with `/audit` (one-shot full-surface audit with a du
73
78
 
74
79
  Requires Node.js `>=18`. Python `>=3.11` is detected and managed by the wrapper.
75
80
 
76
- **Run without installing (zero-config):**
81
+ **Check the CLI without a global install:**
77
82
 
78
83
  ```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
84
+ npx bugx-cli --version
82
85
  ```
83
86
 
84
87
  **Or install globally** (pick your package manager):
@@ -90,15 +93,21 @@ npm install -g bugx-cli
90
93
  # bun add -g bugx-cli
91
94
  ```
92
95
 
93
- After installing, run this once from any directory:
96
+ After installing, run this from the repository you want to use:
94
97
 
95
98
  ```bash
96
99
  bugx install # lists detected AI hosts and registers the BugX MCP servers
97
100
  bugx doctor --strict # health diagnostics
98
101
  ```
99
102
 
103
+ > ⚠️ **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.
104
+
100
105
  To install everywhere at once: `bugx install --agent all`.
101
106
 
107
+ Sign in with `bugx auth login --root .`, then check the expected account and `auth_verified=true` with `bugx auth status --root . --verify --json`. Confirm which data may sync before enabling the project. If both the account-wide and project scopes are authorized, initialize a fresh project with `bugx init --root . --cloud-sync sync` and verify the transfer with `bugx cloud sync --root . --scope all`. Decline partial-sync requests. For existing projects and sync errors, see the [user guide](https://github.com/Bencibr/bugx/blob/main/docs/01_guides/01_USER_GUIDE.md#3-初始化项目).
108
+
109
+ Use `bugx engine --root . status --json` to check the current stage. After review and settlement, sync newly recorded lessons and experience in the same scope and check `bugx cloud status --root . --scope all --json`.
110
+
102
111
  **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:
103
112
 
104
113
  **ZCode**
@@ -117,13 +126,6 @@ To install everywhere at once: `bugx install --agent all`.
117
126
  **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.
118
127
 
119
128
  ```bash
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
126
-
127
129
  bugx autonomous --host opencode # full audit without supervision
128
130
  bugx goal --host opencode "audit this project's login and payment flows"
129
131
 
@@ -166,7 +168,7 @@ DeepSeek Harness (DSH), WorkBuddy, Cursor / Windsurf, and more are being adapted
166
168
 
167
169
  - 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
170
  - 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.
171
+ - Knowledge sync uses the configured scope and sensitive-data policy. Bundle uploads, diagnostic log reports, and feedback have separate commands and data boundaries.
170
172
  - `reset` / `uninstall` / `purge` / `--no-backup` delete data. Check each command's dry-run and backup behavior first.
171
173
 
172
174
  ### FAQ
@@ -181,7 +183,7 @@ Rather than trusting the proposing model's self-report, findings are independent
181
183
  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.
182
184
 
183
185
  **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.
186
+ The audit runs locally. When you enable lesson and experience sync, startup and eligible ledger writes can trigger cloud transfers. The authorized scope and sensitive-data policy govern the records sent.
185
187
 
186
188
  **Does BugX replace human review?**
187
189
  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.
@@ -217,12 +219,10 @@ BugX 用一本账和四条硬规矩对抗这件事:逐单元覆盖清单(查
217
219
 
218
220
  要求 Node.js `>=18`;Python `>=3.11` 由包装器自动检测管理。
219
221
 
220
- **免安装直接执行:**
222
+ **免全局安装,先检查 CLI:**
221
223
 
222
224
  ```bash
223
- npx bugx-cli doctor --strict # 检查系统就绪与 AI 工具连通
224
- npx bugx-cli init # 初始化当前仓库(.bugx/)
225
- npx bugx-cli install # 注册本地 AI 助手
225
+ npx bugx-cli --version
226
226
  ```
227
227
 
228
228
  **或全局安装:**
@@ -231,7 +231,7 @@ npx bugx-cli install # 注册本地 AI 助手
231
231
  npm install -g bugx-cli
232
232
  ```
233
233
 
234
- 装好后任意目录跑一次:
234
+ 装好后在目标仓库运行:
235
235
 
236
236
  ```bash
237
237
  bugx install # 列出检测到的 AI 宿主并注册 BugX MCP 服务
@@ -240,6 +240,10 @@ bugx doctor --strict # 健康自检
240
240
 
241
241
  一次装全所有宿主:`bugx install --agent all`。
242
242
 
243
+ 在目标仓库运行 `bugx auth login --root .`,再用 `bugx auth status --root . --verify --json` 核对账号和 `auth_verified=true`。确认同步范围和敏感数据策略后再开启同步。两层都已授权且为全新项目时,用 `bugx init --root . --cloud-sync sync` 初始化,然后用 `bugx cloud sync --root . --scope all` 验证首次推拉。只授权部分数据时停止同步。已有项目或同步失败时,参照[用户指南](https://github.com/Bencibr/bugx/blob/main/docs/01_guides/01_USER_GUIDE.md#3-初始化项目)。
244
+
245
+ 用 `bugx engine --root . status --json` 查看当前阶段。审查收尾后,按同一授权范围同步本轮录入的错题和经验,再用 `bugx cloud status --root . --scope all --json` 核对绑定与同步状态。
246
+
243
247
  **方式一:在 AI 助手里用(推荐)。** 在任意项目里打开 Claude Code、Codex、Cline、OpenCode 或 ZCode,直接说:
244
248
 
245
249
  > 「审计一下这个项目」
@@ -250,13 +254,6 @@ bugx doctor --strict # 健康自检
250
254
  **方式二:命令行直接跑。** AI 同样来自你已装好的宿主——模型和凭据直接复用,不接管你的 Key。
251
255
 
252
256
  ```bash
253
- bugx auth login # 登录云端账号(错题/经验同步用)
254
- bugx init --cloud-sync sync # 开启云端同步
255
-
256
- bugx engine pre # 建立覆盖清单与审计计划
257
- bugx engine status # 看进度
258
- bugx engine post # 结账:核对覆盖、证据与裁决
259
-
260
257
  bugx autonomous --host opencode # 无人值守完整审计
261
258
  bugx report serve # 实时 Web 报告 http://127.0.0.1:8080
262
259
  ```