bugx-cli 0.1.4 → 0.1.5

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 (95) hide show
  1. package/core/README.md +1 -1
  2. package/core/agent/agent_execution.py +7 -0
  3. package/core/bugx.md +1 -1
  4. package/core/bugx_paths.py +2 -2
  5. package/core/bundled_docs/OVERVIEW.md +3 -2
  6. package/core/bundled_docs/README.md +2 -2
  7. package/core/bundled_docs/ai/01_AI_REFERENCE.md +11 -6
  8. package/core/bundled_docs/ai/02_AI_USAGE.md +1 -1
  9. package/core/bundled_docs/ai/03_AI_COMMANDS.md +1 -1
  10. package/core/bundled_docs/guides/01_USER_GUIDE.md +5 -5
  11. package/core/bundled_docs/guides/02_COMMANDS.md +3 -3
  12. package/core/bundled_docs/guides/03_TROUBLESHOOTING.md +4 -4
  13. package/core/bundled_docs/guides/05_HOST_MATRIX_AND_DISPATCH.md +4 -2
  14. package/core/bundled_docs/hosts/bugx_SKILL.md +2 -2
  15. package/core/bundled_docs/hosts/platform_bugx_SKILL.md +2 -2
  16. package/core/bundled_docs/manifest.json +20 -20
  17. package/core/bundled_docs/reference/01_ENVIRONMENT_VARIABLES.md +1 -0
  18. package/core/bundled_docs/reference/04_REPOSITORY_TOPOLOGY.md +1 -1
  19. package/core/contracts/README.md +1 -1
  20. package/core/contracts/bugx-runtime-contract.md +1 -1
  21. package/core/contracts/bugx-worker.md +1 -1
  22. package/core/coverage/coverage_ai_review.py +15 -11
  23. package/core/coverage/coverage_bootstrap.py +18 -13
  24. package/core/coverage/coverage_discovery.py +1 -1
  25. package/core/dev_harness/interaction_preset.py +1 -1
  26. package/core/engine-integrity.json +119 -111
  27. package/core/host_acp/README.md +4 -0
  28. package/core/host_acp/agnescode.py +128 -0
  29. package/core/host_runtime/README.md +3 -0
  30. package/core/host_runtime/host_registry.py +1 -0
  31. package/core/hosts/README.md +4 -0
  32. package/core/hosts/agnescode.py +415 -0
  33. package/core/hosts/opencode.py +11 -3
  34. package/core/infra/README.md +1 -1
  35. package/core/infra/build_info.py +2 -2
  36. package/core/infra/python_runtime.py +4 -1
  37. package/core/launch_phases/README.md +2 -2
  38. package/core/launch_phases/finding_confirm_phase.py +1 -1
  39. package/core/launch_phases/semantic_recon.py +3 -19
  40. package/core/launch_phases/startup_version_gate.py +2 -2
  41. package/core/launch_phases/verify_loop.py +3 -19
  42. package/core/ledger/README.md +1 -1
  43. package/core/ledger/finding_confirmation.py +1 -1
  44. package/core/ledger/finding_verification.py +2 -20
  45. package/core/ledger/fp_ledger.py +3 -19
  46. package/core/ledger/life_ledger.py +7 -33
  47. package/core/ledger/schema.py +1 -1
  48. package/core/mcp_handlers/supervisor_handlers.py +1 -1
  49. package/core/mcp_runtime_support/common.py +6 -0
  50. package/core/mcp_runtime_support/environment.py +82 -23
  51. package/core/metadata.txt +1 -1
  52. package/core/planning/README.md +1 -1
  53. package/core/planning/target_sandbox_manager.py +2 -0
  54. package/core/probes/mobile_probe.py +1 -0
  55. package/core/probes/sast_probe.py +1 -1
  56. package/core/probes/sca_scanner.py +1 -1
  57. package/core/project_profiler/constants.py +1 -1
  58. package/core/retrieval/README.md +1 -1
  59. package/core/retrieval/symbol_index.py +227 -52
  60. package/core/runtime/README.md +1 -1
  61. package/core/runtime/daemon_runner.py +3 -2
  62. package/core/runtime/project_init.py +1 -1
  63. package/core/runtime/scenario_eval.py +1 -1
  64. package/core/skills/bugx_mcp_server.py +9 -0
  65. package/core/skills/mcp_session_proof.py +3 -31
  66. package/core/supervisor/README.md +1 -1
  67. package/core/supervisor/finding_commit.py +3 -24
  68. package/core/supervisor/task_scheduler.py +5 -2
  69. package/core/supervisor/worker_handoff.py +2 -2
  70. package/ecosystem/integrations/dsh/mcp/package.json +1 -1
  71. package/ecosystem/integrations/dsh/ui/package.json +1 -1
  72. package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +3 -3
  73. package/ecosystem/integrations/opencode/mcp-lock.json +1 -1
  74. package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
  75. package/ecosystem/integrations/qoder/connector-meta.json +1 -1
  76. package/ecosystem/integrations/workbuddy/connector-meta.json +1 -1
  77. package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +1 -1
  78. package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +1 -1
  79. package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +1 -1
  80. package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +1 -1
  81. package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +2 -2
  82. package/interfaces/cli/bugx_cli/__init__.py +1 -1
  83. package/interfaces/cli/bugx_cli/cli.py +15 -0
  84. package/interfaces/cli/bugx_cli/commands/audit.py +2 -1
  85. package/interfaces/cli/bugx_cli/commands/lifecycle.py +1 -1
  86. package/interfaces/cli/bugx_cli/commands/patch.py +5 -1
  87. package/interfaces/cli/bugx_cli/commands/plugin.py +11 -2
  88. package/interfaces/cli/bugx_cli/commands/plugin_claude.py +2 -2
  89. package/interfaces/cli/bugx_cli/host_adapters.py +6 -0
  90. package/interfaces/cli/bugx_cli/hosts/registry.py +1 -1
  91. package/interfaces/cli/bugx_cli/infra/engine_installer.py +4 -4
  92. package/interfaces/cli/bugx_cli/infra/host_sync.py +1 -1
  93. package/package.json +1 -1
  94. package/scripts/sync-version.mjs +1 -1
  95. package/skills/platform/bugx/SKILL.md +2 -2
@@ -2,7 +2,7 @@
2
2
  name: bugx
3
3
  description: BugX 是一个具备自主代码审查与测试能力的智能体,严把代码交付关:它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能符合要求、具备良好的健壮性和稳定性。让开发和测试在繁琐的工作中解放双手,大幅提高工作效率、全面提升代码质量、显著降低后期维护成本,实现科技服务于人。
4
4
  metadata:
5
- bugx_version: "0.1.4"
5
+ bugx_version: "0.1.5"
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.4
13
+ 协议镜像版本:0.1.5
14
14
 
15
15
  ## ChatGPT 原生交互适配(强制)
16
16
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  import os
4
4
 
5
- __version__ = os.environ.get("BUGX_VERSION", "0.1.4")
5
+ __version__ = os.environ.get("BUGX_VERSION", "0.1.5")
6
6
  __build_id__: int = 1
@@ -13,6 +13,21 @@ import typing
13
13
  from pathlib import Path
14
14
 
15
15
 
16
+ def _ensure_utf8_stdio() -> None:
17
+ """Force UTF-8 stdio and child Python encoding on Windows (avoid GBK/cp1252 crashes)."""
18
+ os.environ.setdefault("PYTHONUTF8", "1")
19
+ for stream, err_mode in ((sys.stdin, "strict"), (sys.stdout, "replace"), (sys.stderr, "replace")):
20
+ reconf = getattr(stream, "reconfigure", None)
21
+ if callable(reconf):
22
+ try:
23
+ reconf(encoding="utf-8", errors=err_mode)
24
+ except (OSError, ValueError):
25
+ pass
26
+
27
+
28
+ _ensure_utf8_stdio()
29
+
30
+
16
31
  def _fast_dispatch_mcp_serve() -> None:
17
32
  """Start the stdio MCP script before heavy CLI imports.
18
33
 
@@ -12,6 +12,7 @@ import argparse
12
12
  import hashlib
13
13
  import importlib
14
14
  import json
15
+ import os
15
16
  import stat
16
17
  import sys
17
18
  import time
@@ -115,7 +116,7 @@ def _private_runtime_root() -> Path:
115
116
  if runtime_root.exists():
116
117
  if not runtime_root.is_dir():
117
118
  raise ValueError("Agent audit runtime path must be a directory")
118
- if stat.S_IMODE(runtime_root.stat().st_mode) & 0o077:
119
+ if os.name == "posix" and stat.S_IMODE(runtime_root.stat().st_mode) & 0o077:
119
120
  raise ValueError("Agent audit runtime directory must be private (mode 0700)")
120
121
  else:
121
122
  runtime_root.mkdir(parents=True, mode=0o700)
@@ -84,7 +84,7 @@ def _assemble_project_materials(root: Path, source: Path, layout: Any) -> None:
84
84
  from core.coverage import coverage_bootstrap
85
85
  coverage = coverage_bootstrap.inspect(root)
86
86
  if not coverage.get("ready") and not coverage.get("blocked"):
87
- coverage_bootstrap.bootstrap(root, confirmed=True)
87
+ coverage_bootstrap.bootstrap(root, confirmed=True, symbols=False)
88
88
  except Exception:
89
89
  pass
90
90
 
@@ -732,7 +732,11 @@ def _run_sandbox_script(
732
732
  if script_path.suffix == ".py":
733
733
  cmd = [sys.executable, str(script_path)]
734
734
  elif script_path.suffix == ".sh":
735
- cmd = ["/bin/bash", str(script_path)]
735
+ import shutil as _shutil
736
+ bash_exe = _shutil.which("bash") or ("/bin/bash" if os.name != "nt" else None)
737
+ if not bash_exe:
738
+ return -1, "当前系统缺少 bash,无法执行 .sh 脚本"
739
+ cmd = [bash_exe, str(script_path)]
736
740
  else:
737
741
  cmd = [str(script_path)]
738
742
 
@@ -1489,10 +1489,19 @@ def write_host_mcp_config(
1489
1489
  target = root / migrated.project_relpath
1490
1490
  payload = _load_json_object(target, engine_host_label(host_name))
1491
1491
  servers_key = migrated.container_key
1492
- servers = payload.get(servers_key)
1492
+ container = payload
1493
+ keys = servers_key.split(".")
1494
+ for k in keys[:-1]:
1495
+ child = container.get(k)
1496
+ if not isinstance(child, dict):
1497
+ child = {}
1498
+ container[k] = child
1499
+ container = child
1500
+ leaf_key = keys[-1]
1501
+ servers = container.get(leaf_key)
1493
1502
  if servers is None:
1494
1503
  servers = {}
1495
- payload[servers_key] = servers
1504
+ container[leaf_key] = servers
1496
1505
  if not isinstance(servers, dict):
1497
1506
  raise CliError(
1498
1507
  _i18n_exc(
@@ -262,7 +262,7 @@ _DEFAULT_CLAUDE_SKILL_CONTENT = """---
262
262
  name: bugx
263
263
  description: BugX 是一个具备自主代码审查与测试能力的智能体,严把代码交付关:它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能符合要求、具备良好的健壮性和稳定性。让开发和测试在繁琐的工作中解放双手,大幅提高工作效率、全面提升代码质量、显著降低后期维护成本,实现科技服务于人。
264
264
  metadata:
265
- bugx_version: "0.1.4"
265
+ bugx_version: "0.1.5"
266
266
  ---
267
267
  <!-- bugx-locale: zh-CN -->
268
268
 
@@ -270,7 +270,7 @@ metadata:
270
270
 
271
271
  BugX Claude Skill 镜像。执行前用 `bugx engine path --name AGENT_GUIDE.md` 和 `bugx engine path --name bugx.md` 读取全局协议;项目 `.bugx/` 只保存状态与配置。
272
272
 
273
- 协议镜像版本:0.1.4
273
+ 协议镜像版本:0.1.5
274
274
 
275
275
  ## Claude 原生交互适配(强制)
276
276
 
@@ -1408,6 +1408,11 @@ class OpenCodeAdapter(HostAdapter):
1408
1408
  pass
1409
1409
 
1410
1410
 
1411
+ class AgnesCodeAdapter(HostAdapter):
1412
+ """Agnes Code CLI adapter."""
1413
+ pass
1414
+
1415
+
1411
1416
  class CodexAdapter(HostAdapter):
1412
1417
  """Codex CLI adapter(仅 CLI 侧行为覆写)。
1413
1418
 
@@ -2007,6 +2012,7 @@ HOST_ADAPTERS: tuple[HostAdapter, ...] = (
2007
2012
  # MiniMax Code 桌面端通过 Plugin V1 注册 Agent、Skill 与 MCP。
2008
2013
  *_plugin_backed_adapters(MiniMaxAdapter),
2009
2014
  *_plugin_backed_adapters(AntigravityAdapter),
2015
+ *_plugin_backed_adapters(AgnesCodeAdapter),
2010
2016
  WorkBuddyAdapter(
2011
2017
  "workbuddy", "WorkBuddy AI", "workbuddy", ".workbuddy",
2012
2018
  WORKBUDDY_PROJECT_PATHS[0], "skill", WORKBUDDY_PROJECT_PATHS,
@@ -377,7 +377,7 @@ def _component_from_plugin(name: str) -> HostComponent:
377
377
  #: 它随纵切推进增长;全部宿主迁移完成后本清单与 ``HOST_COMPONENTS`` 的本地字面量
378
378
  #: 会一起消失。
379
379
  PLUGIN_BACKED_HOSTS: tuple[str, ...] = (
380
- "cline", "codex", "claude", "pi", "zcode", "kimi", "minimax", "antigravity",
380
+ "cline", "codex", "claude", "pi", "zcode", "kimi", "minimax", "antigravity", "agnescode",
381
381
  )
382
382
 
383
383
 
@@ -1112,7 +1112,7 @@ def _installed_engine_version(destination: Path) -> str | None:
1112
1112
  except (OSError, ValueError):
1113
1113
  payload = None
1114
1114
  version = payload.get("bugx_version") if isinstance(payload, dict) else None
1115
- if version == "0.1.4":
1115
+ if version == "0.1.5":
1116
1116
  version = os.environ.get("BUGX_VERSION", __version__)
1117
1117
  if isinstance(version, str) and version.strip():
1118
1118
  return _full_engine_version(version.strip(), destination)
@@ -1125,7 +1125,7 @@ def _installed_engine_version(destination: Path) -> str | None:
1125
1125
  match = re.search(r'bugx_version:\s*"([^"]+)"', content)
1126
1126
  if match:
1127
1127
  version = match.group(1)
1128
- if version == "0.1.4":
1128
+ if version == "0.1.5":
1129
1129
  version = os.environ.get("BUGX_VERSION", __version__)
1130
1130
  return _full_engine_version(version, destination)
1131
1131
  return None
@@ -1867,7 +1867,7 @@ def _version_marker(path: Path, pattern: re.Pattern[str], *, allow_symlink: bool
1867
1867
  except (OSError, UnicodeError, CliError):
1868
1868
  return None
1869
1869
  value = match.group(1) if match else None
1870
- if value == "0.1.4":
1870
+ if value == "0.1.5":
1871
1871
  value = os.environ.get("BUGX_VERSION", __version__)
1872
1872
  return value if value and _CONTRACT_VERSION_RE.fullmatch(value) else None
1873
1873
 
@@ -1881,7 +1881,7 @@ def _json_version_marker(path: Path, key: str) -> str | None:
1881
1881
  except (OSError, UnicodeError, json.JSONDecodeError, CliError):
1882
1882
  return None
1883
1883
  value = payload.get(key) if isinstance(payload, dict) else None
1884
- if value == "0.1.4":
1884
+ if value == "0.1.5":
1885
1885
  value = os.environ.get("BUGX_VERSION", __version__)
1886
1886
  return value if isinstance(value, str) and _CONTRACT_VERSION_RE.fullmatch(value) else None
1887
1887
 
@@ -165,7 +165,7 @@ def _plugin_manifest(
165
165
  if not isinstance(name, str) or not re.fullmatch(r"[a-z][a-z0-9-]{1,63}", name):
166
166
  raise CliError(_i18n_exc("common.plugin_name_invalid", f"插件名称无效: {path}", path=path))
167
167
  version = payload.get("version")
168
- if version == "0.1.4":
168
+ if version == "0.1.5":
169
169
  version = os.environ.get("BUGX_VERSION", __version__)
170
170
  payload["version"] = version
171
171
  if not isinstance(version, str) or not PLUGIN_VERSION_RE.fullmatch(version):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bugx-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Autonomous code review and testing agent CLI wrapper. Catches subtle, high-impact bugs, automates black-box and functional QA testing, and safeguards dependable software delivery.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,7 @@ if (!version || !/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(version)) {
15
15
  // temporary/build tree before npm reads the manifest.
16
16
  const pkgJsonPath = join(pkgRoot, 'package.json');
17
17
  const pkgJson = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
18
- if (pkgJson.version === '0.1.4') {
18
+ if (pkgJson.version === '0.1.5') {
19
19
  console.error('[bugx] ✗ 源码 package.json 是模板;请先在临时构建树运行 scripts/render_version.py 或 scripts/package_dist.py');
20
20
  process.exit(1);
21
21
  }
@@ -2,7 +2,7 @@
2
2
  name: bugx
3
3
  description: BugX 深度代码审查与缺陷挖掘智能体。提供自主缺陷挖掘、敏捷单点复现(PoC)、环境体检及知识检索能力。
4
4
  metadata:
5
- bugx_version: "0.1.4"
5
+ bugx_version: "0.1.5"
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.4
13
+ 协议镜像版本:0.1.5
14
14
 
15
15
  ## 1. 意图分流决策树 (Triage Decision Tree)
16
16
  拿到任务第一秒,判定属于哪个分支: