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.
- package/core/README.md +1 -1
- package/core/agent/agent_execution.py +7 -0
- package/core/bugx.md +1 -1
- package/core/bugx_paths.py +2 -2
- package/core/bundled_docs/OVERVIEW.md +3 -2
- package/core/bundled_docs/README.md +2 -2
- package/core/bundled_docs/ai/01_AI_REFERENCE.md +11 -6
- package/core/bundled_docs/ai/02_AI_USAGE.md +1 -1
- package/core/bundled_docs/ai/03_AI_COMMANDS.md +1 -1
- package/core/bundled_docs/guides/01_USER_GUIDE.md +5 -5
- package/core/bundled_docs/guides/02_COMMANDS.md +3 -3
- package/core/bundled_docs/guides/03_TROUBLESHOOTING.md +4 -4
- package/core/bundled_docs/guides/05_HOST_MATRIX_AND_DISPATCH.md +4 -2
- package/core/bundled_docs/hosts/bugx_SKILL.md +2 -2
- package/core/bundled_docs/hosts/platform_bugx_SKILL.md +2 -2
- package/core/bundled_docs/manifest.json +20 -20
- package/core/bundled_docs/reference/01_ENVIRONMENT_VARIABLES.md +1 -0
- package/core/bundled_docs/reference/04_REPOSITORY_TOPOLOGY.md +1 -1
- package/core/contracts/README.md +1 -1
- package/core/contracts/bugx-runtime-contract.md +1 -1
- package/core/contracts/bugx-worker.md +1 -1
- package/core/coverage/coverage_ai_review.py +15 -11
- package/core/coverage/coverage_bootstrap.py +18 -13
- package/core/coverage/coverage_discovery.py +1 -1
- package/core/dev_harness/interaction_preset.py +1 -1
- package/core/engine-integrity.json +119 -111
- package/core/host_acp/README.md +4 -0
- package/core/host_acp/agnescode.py +128 -0
- package/core/host_runtime/README.md +3 -0
- package/core/host_runtime/host_registry.py +1 -0
- package/core/hosts/README.md +4 -0
- package/core/hosts/agnescode.py +415 -0
- package/core/hosts/opencode.py +11 -3
- package/core/infra/README.md +1 -1
- package/core/infra/build_info.py +2 -2
- package/core/infra/python_runtime.py +4 -1
- package/core/launch_phases/README.md +2 -2
- package/core/launch_phases/finding_confirm_phase.py +1 -1
- package/core/launch_phases/semantic_recon.py +3 -19
- package/core/launch_phases/startup_version_gate.py +2 -2
- package/core/launch_phases/verify_loop.py +3 -19
- package/core/ledger/README.md +1 -1
- package/core/ledger/finding_confirmation.py +1 -1
- package/core/ledger/finding_verification.py +2 -20
- package/core/ledger/fp_ledger.py +3 -19
- package/core/ledger/life_ledger.py +7 -33
- package/core/ledger/schema.py +1 -1
- package/core/mcp_handlers/supervisor_handlers.py +1 -1
- package/core/mcp_runtime_support/common.py +6 -0
- package/core/mcp_runtime_support/environment.py +82 -23
- package/core/metadata.txt +1 -1
- package/core/planning/README.md +1 -1
- package/core/planning/target_sandbox_manager.py +2 -0
- package/core/probes/mobile_probe.py +1 -0
- package/core/probes/sast_probe.py +1 -1
- package/core/probes/sca_scanner.py +1 -1
- package/core/project_profiler/constants.py +1 -1
- package/core/retrieval/README.md +1 -1
- package/core/retrieval/symbol_index.py +227 -52
- package/core/runtime/README.md +1 -1
- package/core/runtime/daemon_runner.py +3 -2
- package/core/runtime/project_init.py +1 -1
- package/core/runtime/scenario_eval.py +1 -1
- package/core/skills/bugx_mcp_server.py +9 -0
- package/core/skills/mcp_session_proof.py +3 -31
- package/core/supervisor/README.md +1 -1
- package/core/supervisor/finding_commit.py +3 -24
- package/core/supervisor/task_scheduler.py +5 -2
- package/core/supervisor/worker_handoff.py +2 -2
- package/ecosystem/integrations/dsh/mcp/package.json +1 -1
- package/ecosystem/integrations/dsh/ui/package.json +1 -1
- package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +3 -3
- package/ecosystem/integrations/opencode/mcp-lock.json +1 -1
- package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
- package/ecosystem/integrations/qoder/connector-meta.json +1 -1
- package/ecosystem/integrations/workbuddy/connector-meta.json +1 -1
- package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +1 -1
- package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +1 -1
- package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +1 -1
- package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +2 -2
- package/interfaces/cli/bugx_cli/__init__.py +1 -1
- package/interfaces/cli/bugx_cli/cli.py +15 -0
- package/interfaces/cli/bugx_cli/commands/audit.py +2 -1
- package/interfaces/cli/bugx_cli/commands/lifecycle.py +1 -1
- package/interfaces/cli/bugx_cli/commands/patch.py +5 -1
- package/interfaces/cli/bugx_cli/commands/plugin.py +11 -2
- package/interfaces/cli/bugx_cli/commands/plugin_claude.py +2 -2
- package/interfaces/cli/bugx_cli/host_adapters.py +6 -0
- package/interfaces/cli/bugx_cli/hosts/registry.py +1 -1
- package/interfaces/cli/bugx_cli/infra/engine_installer.py +4 -4
- package/interfaces/cli/bugx_cli/infra/host_sync.py +1 -1
- package/package.json +1 -1
- package/scripts/sync-version.mjs +1 -1
- package/skills/platform/bugx/SKILL.md +2 -2
package/core/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BugX 微内核与核心领域系统 (Core Microkernel & Domain Architecture)
|
|
2
2
|
|
|
3
|
-
> **版本契约**: `0.1.
|
|
3
|
+
> **版本契约**: `0.1.5` | **调度微内核**: `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
5
|
> **守卫机制**: `scripts/verify_directory_indices.py` (100% 索引对齐防漂移)
|
|
6
6
|
|
|
@@ -543,6 +543,13 @@ def _terminate_and_reap_group(
|
|
|
543
543
|
Every group signal is gated by ``identity.matches()``: the numeric PGID is
|
|
544
544
|
observation-only and is never used as a send credential on its own.
|
|
545
545
|
"""
|
|
546
|
+
if not hasattr(os, "killpg"):
|
|
547
|
+
try:
|
|
548
|
+
process.kill()
|
|
549
|
+
process.wait(timeout=1.0)
|
|
550
|
+
except (OSError, subprocess.SubprocessError):
|
|
551
|
+
pass
|
|
552
|
+
return
|
|
546
553
|
pgid = identity.pgid
|
|
547
554
|
|
|
548
555
|
def send(sig: int) -> None:
|
package/core/bugx.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: bugx
|
|
3
3
|
# Frontmatter is host/Agent routing metadata. Human-facing usage guidance belongs in README.md and docs/.
|
|
4
4
|
description: Use BugX when asked to perform autonomous code review, deep bug hunting, black-box testing, or automated functional and performance verification. Do NOT use BugX for normal conversation, everyday coding, minor cosmetic fixes, or documentation tasks. Normal development should proceed without activating BugX lifecycle.
|
|
5
|
-
version: 0.1.
|
|
5
|
+
version: 0.1.5
|
|
6
6
|
mode: all
|
|
7
7
|
temperature: 0.1
|
|
8
8
|
permission:
|
package/core/bugx_paths.py
CHANGED
|
@@ -104,8 +104,8 @@ def _version_from_text(path: Path, pattern: re.Pattern[str],
|
|
|
104
104
|
except (OSError, UnicodeError):
|
|
105
105
|
return None
|
|
106
106
|
value = match.group(1) if match else None
|
|
107
|
-
if value == "0.1.
|
|
108
|
-
value = os.environ.get("BUGX_VERSION", "0.1.
|
|
107
|
+
if value == "0.1.5":
|
|
108
|
+
value = os.environ.get("BUGX_VERSION", "0.1.5").strip()
|
|
109
109
|
return value if value and VERSION_RE.fullmatch(value) else None
|
|
110
110
|
|
|
111
111
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
BugX 是一款装在 AI 编程助手与智能体开发环境里的**自主代码审查与自主测试智能体(Agent)**,严把代码交付关:**它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能完全符合要求、在各种复杂环境下都能稳定运行、不崩溃不卡死,上线放心不翻车。**
|
|
12
12
|
|
|
13
|
-
目前已原生适配全球主流 AI 编程助手与智能体开发平台:**Google Antigravity(反重力)、Gemini Code Assist / Gemini CLI、Claude Code、OpenAI Codex、Cursor、Trae、Windsurf、Cline、OpenCode、Kimi Code、ZCode、MiniMax Code、DSH、WorkBuddy、Qoder**;全面支持以 **Google 最新 Gemini 4 体系(Gemini 4 Carbon / Neon / Hydrogen)、Claude 5.5(Sonnet 5.5 / Opus 5.5)、G4 旗舰大模型**为底座的深层代码推理与漏洞发现。静态分析、行为差分、内存检查与 UI 测试全部自动化执行;通过标准化 MCP 协议接入宿主,测试审查过程断点可续、透明可查。
|
|
13
|
+
目前已原生适配全球主流 AI 编程助手与智能体开发平台:**Google Antigravity(反重力)、Gemini Code Assist / Gemini CLI、Agnes Code、Claude Code、OpenAI Codex、Cursor、Trae、Windsurf、Cline、OpenCode、Kimi Code、ZCode、MiniMax Code、DSH、WorkBuddy、Qoder**;全面支持以 **Google 最新 Gemini 4 体系(Gemini 4 Carbon / Neon / Hydrogen)、Claude 5.5(Sonnet 5.5 / Opus 5.5)、G4 旗舰大模型**为底座的深层代码推理与漏洞发现。静态分析、行为差分、内存检查与 UI 测试全部自动化执行;通过标准化 MCP 协议接入宿主,测试审查过程断点可续、透明可查。
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<a href="https://pypi.org/project/bugx-cli/"><img src="https://img.shields.io/pypi/v/bugx-cli.svg?style=flat&color=0284c7&label=PyPI" alt="PyPI"></a>
|
|
@@ -241,7 +241,7 @@ BugX Studio 是自带的 Web 工作台——跑 `bugx report serve`,浏览器
|
|
|
241
241
|
一款装进 AI 编程助手的自主代码审计 Agent:通过 MCP 在 Claude Code、Codex、Cline、OpenCode、ZCode、MiniMax Code 内运行,也可作为独立 CLI 使用;按单元跟踪审计覆盖,并对每条发现做真实执行验证。
|
|
242
242
|
|
|
243
243
|
**支持哪些 AI 编程工具与大模型?**
|
|
244
|
-
原生支持 **Google Antigravity(反重力)**、**Gemini Code Assist / Gemini CLI**、Claude Code、OpenAI Codex、Cursor、Trae、Windsurf、Cline / Roo Code、OpenCode、Kimi Code、ZCode、MiniMax Code、DeepSeek Harness (DSH)、WorkBuddy、Qoder 等主流 AI 编程助手与 Agent 开发平台;深度兼容 **Google 最新 Gemini 4 体系(Gemini 4 Carbon / Neon / Hydrogen)、Claude 5.5(Sonnet 5.5 / Opus 5.5)、G4 旗舰模型等全系列主力模型**。
|
|
244
|
+
原生支持 **Google Antigravity(反重力)**、**Gemini Code Assist / Gemini CLI**、**Agnes Code**、Claude Code、OpenAI Codex、Cursor、Trae、Windsurf、Cline / Roo Code、OpenCode、Kimi Code、ZCode、MiniMax Code、DeepSeek Harness (DSH)、WorkBuddy、Qoder 等主流 AI 编程助手与 Agent 开发平台;深度兼容 **Google 最新 Gemini 4 体系(Gemini 4 Carbon / Neon / Hydrogen)、Claude 5.5(Sonnet 5.5 / Opus 5.5)、G4 旗舰模型等全系列主力模型**。
|
|
245
245
|
|
|
246
246
|
**如何验证一个漏洞?**
|
|
247
247
|
不靠首发模型的自说自话,由独立的验证员执行盲审验证:一段攻击输入必须两次成功触发该漏洞,一段正常输入必须零触发;三次执行(两正例一负对照)连同命令、退出码与产物哈希全部记录在案,并通过 AST 语法断言防止空壳测试。
|
|
@@ -262,6 +262,7 @@ BugX Studio 是自带的 Web 工作台——跑 `bugx report serve`,浏览器
|
|
|
262
262
|
| **Claude Code** | 原生 MCP / 自治生命周期 | `bugx install --agent claude` |
|
|
263
263
|
| **OpenAI Codex** | 工作区子 Agent / 原生插件 | `bugx install --agent codex` |
|
|
264
264
|
| **OpenCode** | Headless ACP / 原生 MCP | `bugx install --agent opencode` |
|
|
265
|
+
| **Agnes Code** | 终端原生 TUI / 智能体与原生 MCP 注入 | `bugx install --agent agnescode` |
|
|
265
266
|
| **Cline / Roo Code** | MCP 交互会话(单 Claim 串行)/ CLI 多进程池并发 | `bugx install --agent cline` |
|
|
266
267
|
| **Kimi Code** | Headless ACP / 原生 MCP | `bugx install --agent kimi` |
|
|
267
268
|
| **ZCode** | 原生 MCP / 用户级 MCP 注册 | `bugx install --agent zcode` |
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
title: BugX AI Host and Worker Reference
|
|
3
3
|
audience: AI hosts and native agents
|
|
4
4
|
status: DOCUMENTATION_UNVERIFIED
|
|
5
|
-
version: 0.1.
|
|
5
|
+
version: 0.1.5
|
|
6
6
|
protocol: MCP 2024-11-05
|
|
7
|
-
server: bugx-supervisor 0.1.
|
|
7
|
+
server: bugx-supervisor 0.1.5
|
|
8
8
|
last-verified: 2026-11-17
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -69,13 +69,13 @@ CLI 的安装源,也不得用它覆盖更高的全局引擎。
|
|
|
69
69
|
### 1.3 Host capability sets
|
|
70
70
|
|
|
71
71
|
install_adapters =
|
|
72
|
-
chatgpt, claude, cline, codex, dsh, funide, kimi,
|
|
72
|
+
agnescode, antigravity, chatgpt, claude, cline, codex, dsh, funide, kimi,
|
|
73
73
|
minimax, opencode, pi, qoder, trea, workbuddy, zcode
|
|
74
74
|
|
|
75
75
|
ready_engine_plugins =
|
|
76
|
-
opencode, codex, cline, dsh, claude, pi, zcode, kimi, minimax
|
|
76
|
+
opencode, codex, cline, dsh, claude, pi, zcode, kimi, minimax, antigravity, agnescode
|
|
77
77
|
|
|
78
|
-
acp_ready = cline, kimi, opencode
|
|
78
|
+
acp_ready = agnescode, antigravity, cline, kimi, opencode
|
|
79
79
|
acp_todo = chatgpt, workbuddy, qoder, trea, funide
|
|
80
80
|
acp_unavailable = claude, codex, dsh, pi, zcode, minimax
|
|
81
81
|
|
|
@@ -355,7 +355,7 @@ report source 语义:
|
|
|
355
355
|
|
|
356
356
|
protocolVersion: 2024-11-05
|
|
357
357
|
serverName: bugx-supervisor
|
|
358
|
-
serverVersion: 0.1.
|
|
358
|
+
serverVersion: 0.1.5
|
|
359
359
|
hostHeartbeatIntervalSeconds: 5.0
|
|
360
360
|
transport: local stdio
|
|
361
361
|
|
|
@@ -584,6 +584,11 @@ covered 是 coverage value,不是 evidence status。pending、partial、unveri
|
|
|
584
584
|
`MAX_INHERITED_CHAIN_DEPTH = 32`;链条终点自称本地产出却没有本地 passed 记录。继承绝不复制
|
|
585
585
|
证据文件、绝不改写字段,源记录 `target_fingerprint` 漂移与 `observed_at` 年龄信号原样保留。
|
|
586
586
|
|
|
587
|
+
双轨目录排除与渐进式发现(DOC-AIREV):
|
|
588
|
+
- **Track 1(静态白名单)**:`symbol_index` 与探针层自动硬排除 `.git`、`node_modules`、`.tools`、`artifacts` 等已知通用依赖/构建产物;
|
|
589
|
+
- **Track 2(AI 语义扫尾)**:白名单不是万能的,白名单放行后的剩余顶层目录须通过 `coverage review-packages` / `review-apply` 由宿主 AI 基于证据逐一复审并移出非产品目录(持久化于 `.bugx/knowledge/coverage-review.json`);
|
|
590
|
+
- **Tier-1 初始化骨架**:`bugx init` 默认以 `files` 模式建立轻量骨架避免大仓启动挂死;`symbol_index.audit_units` 采用 `.bugx/cache/symbol_cache.db` 持久化缓存与多核并发解析支持大仓全量运行。
|
|
591
|
+
|
|
587
592
|
run_sandboxed_probe 的边界是 argv-only、禁止 shell launcher/operators、timeout 0.5–60 秒和 artifact/evidence 记录;它不是 OS 文件系统 sandbox。AI 不得向用户宣称更强隔离。
|
|
588
593
|
|
|
589
594
|
探针包 `core/probes/__init__.py` 按 PEP 562 模块级 `__getattr__` 惰性加载
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BugX AI 命令选路与使用手册
|
|
2
2
|
|
|
3
|
-
> **版本**:0.1.
|
|
3
|
+
> **版本**:0.1.5 | **更新日期**:2026-11-26
|
|
4
4
|
> 本手册按当前仓库 CLI 解析器整理,覆盖 45 个顶层命令及分组 leaf。宿主和全局引擎可能独立升级;当前安装版的安全帮助入口、命令分发源码与本手册共同确定语法。完整参数表见 [02_COMMANDS.md](../guides/02_COMMANDS.md),生命周期与协议细节见 [01_AI_REFERENCE.md](01_AI_REFERENCE.md)。
|
|
5
5
|
|
|
6
6
|
## AI 选命令的固定步骤
|
|
@@ -198,12 +198,12 @@ BugX 当前有四套有意不同的 Host 列表。使用前先确定你需要的
|
|
|
198
198
|
|
|
199
199
|
| 能力层 | 当前源码事实 |
|
|
200
200
|
|---|---|
|
|
201
|
-
| 安装/检测适配器 | `antigravity`、`chatgpt`、`claude`、`cline`、`codex`、`dsh`、`funide`、`kimi`、`minimax`、`opencode`、`pi`、`qoder`、`trea`、`workbuddy`、`zcode` |
|
|
202
|
-
| ready engine plugin | `antigravity`、`opencode`、`codex`、`cline`、`dsh`、`claude`、`kimi`、`minimax`、`pi`、`zcode` |
|
|
203
|
-
| ACP ready | `antigravity`、`cline`、`opencode` |
|
|
201
|
+
| 安装/检测适配器 | `agnescode`、`antigravity`、`chatgpt`、`claude`、`cline`、`codex`、`dsh`、`funide`、`kimi`、`minimax`、`opencode`、`pi`、`qoder`、`trea`、`workbuddy`、`zcode` |
|
|
202
|
+
| ready engine plugin | `agnescode`、`antigravity`、`opencode`、`codex`、`cline`、`dsh`、`claude`、`kimi`、`minimax`、`pi`、`zcode` |
|
|
203
|
+
| ACP ready | `agnescode`、`antigravity`、`cline`、`kimi`、`opencode` |
|
|
204
204
|
| ACP todo | `chatgpt`、`workbuddy`、`qoder`、`trea`、`funide` |
|
|
205
|
-
| ACP unavailable | `claude`、`codex`、`dsh`、`
|
|
206
|
-
| autonomous CLI choices | `antigravity`、`claude`、`codex`、`opencode`、`dsh`、`cline`、`zcode` |
|
|
205
|
+
| ACP unavailable | `claude`、`codex`、`dsh`、`minimax`、`pi`、`zcode` |
|
|
206
|
+
| autonomous CLI choices | `agnescode`、`antigravity`、`claude`、`codex`、`opencode`、`dsh`、`cline`、`zcode` |
|
|
207
207
|
|
|
208
208
|
因此,“可安装”不等于“有 ready engine plugin”,更不等于“支持 ACP 或自治闭环”。`bugx hosts --json` 是当前机器检测结果;源码矩阵是能力上限,不能代替本机 Host 的安装和登录状态。
|
|
209
209
|
|
|
@@ -148,7 +148,7 @@ help 接受可变数量的 COMMAND 词;completion 的值只有 bash、zsh、fi
|
|
|
148
148
|
[--docs-transport {stdio,remote}] [--docs-remote-url URL]
|
|
149
149
|
[--locale LOCALE] [--json]
|
|
150
150
|
|
|
151
|
-
--agent 可重复;当前安装/检测值为 chatgpt、claude、cline、codex、dsh、funide、kimi、minimax、opencode、pi、qoder、trea、workbuddy、zcode。默认以本地 `stdio` 模式注册 `bugx-supervisor` 与 `bugx-supervisor-worker`;`bugx-docs` 采用「远程优先(Remote-First)」模式默认直连官方只读云端 HTTP MCP 端点,无法联网或传入 `--docs-transport stdio` / `BUGX_DOCS_OFFLINE=1` 时自动无感降级为本地 `stdio` 模式及离线基线。不指定 --agent 时不要假设会配置所有 Host。--allow-missing 允许缺失可选资产时继续,但不改变核心依赖或 Host MCP 的 ready/ACP 状态。
|
|
151
|
+
--agent 可重复;当前安装/检测值为 agnescode、antigravity、chatgpt、claude、cline、codex、dsh、funide、kimi、minimax、opencode、pi、qoder、trea、workbuddy、zcode。默认以本地 `stdio` 模式注册 `bugx-supervisor` 与 `bugx-supervisor-worker`;`bugx-docs` 采用「远程优先(Remote-First)」模式默认直连官方只读云端 HTTP MCP 端点,无法联网或传入 `--docs-transport stdio` / `BUGX_DOCS_OFFLINE=1` 时自动无感降级为本地 `stdio` 模式及离线基线。不指定 --agent 时不要假设会配置所有 Host。--allow-missing 允许缺失可选资产时继续,但不改变核心依赖或 Host MCP 的 ready/ACP 状态。
|
|
152
152
|
安装事务支持双模式:在用户主目录(`~`)未传 `--root` 时进入**用户全局模式**,仅部署共享引擎(`~/.bugx/core`)、全局知识库、必需核心依赖(`codebase-memory-mcp` 与 `tree-sitter-language-pack`,直接安装校验且绝不降级放行)以及用户级宿主资产(DSH 全局 `cordis.patch.yml` 使用无 `--root` 动态参数),不向主目录写入项目状态或删除 `~/.bugx/core`;进入项目仓库执行或显式传 `--root <项目目录>` 时绑定项目运行态并写入项目级 MCP 绑定与 `.bugx/hosts.json`。可选能力(`playwright`、`postmcp`、`codindex`、UI/效率工具、`MCP 离线 runtime`)延迟至实际项目审计 `pre` 阶段按需启用。
|
|
153
153
|
|
|
154
154
|
### 4.6 reset [W][D]
|
|
@@ -651,7 +651,7 @@ start 的 max wall time 默认 14400.0 秒,interval 默认 5.0 秒;attach
|
|
|
651
651
|
|
|
652
652
|
### 9.2 autonomous
|
|
653
653
|
|
|
654
|
-
bugx autonomous [--root ROOT] --host {claude,codex,opencode,dsh,cline,zcode}
|
|
654
|
+
bugx autonomous [--root ROOT] --host {agnescode,antigravity,claude,codex,opencode,dsh,cline,zcode}
|
|
655
655
|
[--workers N] [--model MODEL] [--provider PROVIDER]
|
|
656
656
|
[--max-turns N] [--max-wall-time SECONDS]
|
|
657
657
|
[--agent-timeout SECONDS]
|
|
@@ -669,7 +669,7 @@ start 的 max wall time 默认 14400.0 秒,interval 默认 5.0 秒;attach
|
|
|
669
669
|
### 9.3 goal
|
|
670
670
|
|
|
671
671
|
bugx goal [TARGET_DESCRIPTION] [--root ROOT]
|
|
672
|
-
[--host {claude,codex,opencode,dsh,cline,zcode}]
|
|
672
|
+
[--host {agnescode,antigravity,claude,codex,opencode,dsh,cline,zcode}]
|
|
673
673
|
[--target-coverage PERCENT]
|
|
674
674
|
[--allow-open-findings] [--disallow-quarantine]
|
|
675
675
|
[--max-turns N] [--max-wall-time SECONDS]
|
|
@@ -233,10 +233,10 @@ doctor 不再报告 unsafe layout、identity mismatch 或 missing lifecycle;
|
|
|
233
233
|
|
|
234
234
|
先区分四套能力:
|
|
235
235
|
|
|
236
|
-
- 安装/检测适配器
|
|
237
|
-
- ready engine plugin
|
|
238
|
-
- ACP ready
|
|
239
|
-
- autonomous CLI choices
|
|
236
|
+
- 安装/检测适配器 16 个;
|
|
237
|
+
- ready engine plugin 11 个;
|
|
238
|
+
- ACP ready 包含 agnescode、antigravity、cline、kimi、opencode;
|
|
239
|
+
- autonomous CLI choices 包含 agnescode、antigravity、claude、codex、opencode、dsh、cline、zcode。
|
|
240
240
|
|
|
241
241
|
可安装不等于 ACP ready。--allow-missing 只允许缺失可选资产时继续,不会制造插件 facet。--force 只在确认 BugX-owned 静态资产可以更新时使用;普通 install 不应擅自覆盖用户文件。
|
|
242
242
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# BugX
|
|
1
|
+
# BugX 主流 AI 宿主接入与派发避坑速查卡
|
|
2
2
|
|
|
3
3
|
> 适用场景:安装配置宿主、MCP 未加载、Worker 派发方式选择、各宿主交互原语与常见报错。
|
|
4
4
|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
| 宿主 (`--agent`) | MCP 配置文件位置与作用域 | 交互单选工具 | Worker 并发方式 | 核心注意与坑位 |
|
|
8
8
|
|---|---|---|---|---|
|
|
9
|
+
| **Agnes Code** | 项目根 `agnescode.json` (`mcp.servers`) / 镜像 `.agnescode/` | `question` (`multiple=false`) | `subagent` (`bugx.md`, `background=false`) | 终端原生 TUI;支持 `--agent agnescode` 一键安装与 ACP 无头探活,`AGNESCODE_CONFIG_DIR` 隔离 |
|
|
10
|
+
| **Google Antigravity** | 工作区 `.agents/mcp_config.json` | Agent selector | 串行多进程会话 | 插件本体位于用户级 `~/.gemini/config/plugins`,项目级 MCP 须与插件隔离 |
|
|
9
11
|
| **OpenCode** | 项目根 `opencode.json` (`mcp.servers`) | `question` (`multiple=false`) | `subagent` (`bugx-worker`, `background=false`) | 必须在项目根启动;`pre` 需同步前台跑 (`timeout=300000`);禁止从 shell 另起 `bugx mcp serve`(会触发 `session_occupied`) |
|
|
10
12
|
| **Claude Code** | 项目根 `.mcp.json` + `.claude/mcp.json` (`mcpServers`) | `AskUserQuestion` (`tooling:batch` 用多选) | `Task(subagent_type="bugx-worker")` | **勿传 `process_pid`**;上游无 ACP(`claude -p` 走 headless);确保探针输出非空 stdout/stderr 满足双独立证据通道 |
|
|
11
13
|
| **Codex** | `.codex/config.toml` + `$CODEX_HOME/config.toml` (`mcp_servers`) | `request_user_input_async` | 原生子智能体(`fork_turns="none"`) | 须具备项目信任表 `[projects]`;支持 `command` (`stdio`) 或 `url` (Remote HTTP MCP) |
|
|
@@ -15,7 +17,7 @@
|
|
|
15
17
|
|
|
16
18
|
## 2. 默认接入与远程优先通道
|
|
17
19
|
* **默认方式(100% 全宿主兼容)**:所有宿主均注册 `bugx-supervisor`(Host 本地 stdio)、`bugx-supervisor-worker`(Worker 本地 stdio)。
|
|
18
|
-
* **远程优先官档通道(Remote-First)**:`bugx-docs` 默认采用「远程优先」策略直连云端官档(如 `https://bugx.dev/api/v1/mcp/docs?contract_version=0.1.
|
|
20
|
+
* **远程优先官档通道(Remote-First)**:`bugx-docs` 默认采用「远程优先」策略直连云端官档(如 `https://bugx.dev/api/v1/mcp/docs?contract_version=0.1.5`),零本地常驻进程;在断网环境或传入 `--docs-transport stdio` 时自动无感降级为本地 `stdio` 进程与随包离线快照。`mcp_process_tracker` 会自动识别 URL 形态,不会误报“缺少本地进程”。
|
|
19
21
|
|
|
20
22
|
## 3. 通用高代价避坑(实证复盘)
|
|
21
23
|
1. **静默 `sys.exit(1)` 导致双证据通道校验失败**:正例探针失败退出时,引擎依赖非空 stdout/stderr 构造第二验证通道;纯静默退出会被 Confirmation Gate 拒收。务必打印具体可观测差分值(如 `SENTINEL=True` / `ACTUAL=...`)。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: bugx
|
|
3
3
|
description: BugX 是一个具备自主代码审查与测试能力的智能体,严把代码交付关:它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能符合要求、具备良好的健壮性和稳定性。让开发和测试在繁琐的工作中解放双手,大幅提高工作效率、全面提升代码质量、显著降低后期维护成本,实现科技服务于人。
|
|
4
4
|
metadata:
|
|
5
|
-
bugx_version: "0.1.
|
|
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.
|
|
13
|
+
协议镜像版本:0.1.5
|
|
14
14
|
|
|
15
15
|
## ChatGPT 原生交互适配(强制)
|
|
16
16
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: bugx
|
|
3
3
|
description: BugX 深度代码审查与缺陷挖掘智能体。提供自主缺陷挖掘、敏捷单点复现(PoC)、环境体检及知识检索能力。
|
|
4
4
|
metadata:
|
|
5
|
-
bugx_version: "0.1.
|
|
5
|
+
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.
|
|
13
|
+
协议镜像版本:0.1.5
|
|
14
14
|
|
|
15
15
|
## 1. 意图分流决策树 (Triage Decision Tree)
|
|
16
16
|
拿到任务第一秒,判定属于哪个分支:
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"contract_version": "0.1.
|
|
3
|
+
"contract_version": "0.1.5",
|
|
4
4
|
"file_count": 22,
|
|
5
|
-
"total_bytes":
|
|
5
|
+
"total_bytes": 487265,
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "OVERVIEW.md",
|
|
9
9
|
"source": "README.md",
|
|
10
|
-
"bytes":
|
|
11
|
-
"sha256": "
|
|
10
|
+
"bytes": 24120,
|
|
11
|
+
"sha256": "b6739dc0b8a481194341abdfff915cbdfa0ddb926f77069ce3bd2225af2459c7"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"path": "README_EN.md",
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
{
|
|
20
20
|
"path": "reference/01_ENVIRONMENT_VARIABLES.md",
|
|
21
21
|
"source": "docs/04_reference/01_ENVIRONMENT_VARIABLES.md",
|
|
22
|
-
"bytes":
|
|
23
|
-
"sha256": "
|
|
22
|
+
"bytes": 41844,
|
|
23
|
+
"sha256": "9b73afb3796c7b94e6ead62c7709ba498925fa9b3a70738ab3077a97236b4692"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "reference/04_REPOSITORY_TOPOLOGY.md",
|
|
27
27
|
"source": "docs/02_architecture/04_REPOSITORY_TOPOLOGY.md",
|
|
28
28
|
"bytes": 13055,
|
|
29
|
-
"sha256": "
|
|
29
|
+
"sha256": "d6f810d1aadbacfcc9528766ce54b01229b0f4c6a4aecac34cd55b4611cd2651"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "hosts/platform_bugx_SKILL.md",
|
|
33
33
|
"source": "skills/platform/bugx/SKILL.md",
|
|
34
34
|
"bytes": 3941,
|
|
35
|
-
"sha256": "
|
|
35
|
+
"sha256": "15096fa38872feca91efb9a3294210948a9efc0d84c31470ce1ded54dbaad0f3"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"path": "hosts/cline_bugx_SKILL.md",
|
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
{
|
|
44
44
|
"path": "guides/01_USER_GUIDE.md",
|
|
45
45
|
"source": "docs/01_guides/01_USER_GUIDE.md",
|
|
46
|
-
"bytes":
|
|
47
|
-
"sha256": "
|
|
46
|
+
"bytes": 64848,
|
|
47
|
+
"sha256": "2d860f682c10d09124238027581b7fafdaa16fc06c3e63daf15e9c0c9e828323"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"path": "guides/02_COMMANDS.md",
|
|
51
51
|
"source": "docs/01_guides/02_COMMANDS.md",
|
|
52
|
-
"bytes":
|
|
53
|
-
"sha256": "
|
|
52
|
+
"bytes": 59296,
|
|
53
|
+
"sha256": "3c4bf27fe28465c5b8bd7eabb129ca6e7ee21649711fdc010722a9b679e424f1"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"path": "guides/03_TROUBLESHOOTING.md",
|
|
57
57
|
"source": "docs/01_guides/03_TROUBLESHOOTING.md",
|
|
58
|
-
"bytes":
|
|
59
|
-
"sha256": "
|
|
58
|
+
"bytes": 39154,
|
|
59
|
+
"sha256": "0a763dc6acf173232df1493b5d53ff5ec471916fab38a3b29e6d46275449b614"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "guides/04_CLOUD_AUTH_AND_SYNC_COOKBOOK.md",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
{
|
|
68
68
|
"path": "guides/05_HOST_MATRIX_AND_DISPATCH.md",
|
|
69
69
|
"source": "docs/01_guides/05_HOST_MATRIX_AND_DISPATCH.md",
|
|
70
|
-
"bytes":
|
|
71
|
-
"sha256": "
|
|
70
|
+
"bytes": 3833,
|
|
71
|
+
"sha256": "ae860f14b19dd9cb69e2a27966c2a78449dc94c7efeb675a11ad585fb0bad8ae"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"path": "guides/06_PROBES_AND_POC_COOKBOOK.md",
|
|
@@ -91,20 +91,20 @@
|
|
|
91
91
|
{
|
|
92
92
|
"path": "ai/01_AI_REFERENCE.md",
|
|
93
93
|
"source": "docs/03_ai/01_AI_REFERENCE.md",
|
|
94
|
-
"bytes":
|
|
95
|
-
"sha256": "
|
|
94
|
+
"bytes": 58110,
|
|
95
|
+
"sha256": "77041b3fb6e04938199ee2596ef045806da45f860d2a4ef7f24b3cd636eb4a1a"
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"path": "ai/02_AI_USAGE.md",
|
|
99
99
|
"source": "docs/03_ai/02_AI_USAGE.md",
|
|
100
100
|
"bytes": 13575,
|
|
101
|
-
"sha256": "
|
|
101
|
+
"sha256": "b040f63360e854370c7addba4f51df3d62a83ff5afdd344b82e078129e143461"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"path": "ai/03_AI_COMMANDS.md",
|
|
105
105
|
"source": "docs/03_ai/03_AI_COMMANDS.md",
|
|
106
106
|
"bytes": 46169,
|
|
107
|
-
"sha256": "
|
|
107
|
+
"sha256": "8d62791ce3b2566dcaca12ece45c98ef45da684e50426e38e58c3daa95510bea"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"path": "hosts/bugx_SKILL.md",
|
|
@@ -297,6 +297,7 @@ bugx update --check --root /path/to/project
|
|
|
297
297
|
| `BUGX_CLAUDE_USER_AGENTS_DIR` | 绝对路径 | 覆盖 Claude Desktop/Code 用户级 agents 目录探测位置 | `无默认(None/空)` | `interfaces/cli/bugx_cli/commands/plugin_claude.py` |
|
|
298
298
|
| `BUGX_CLAUDE_USER_SKILLS_DIR` | 绝对路径 | 覆盖 Claude 用户级 skills 目录探测位置 | `无默认(None/空)` | `interfaces/cli/bugx_cli/commands/plugin_claude.py` |
|
|
299
299
|
| `BUGX_CLINE_USER_AGENTS_DIR` | 绝对路径 | 覆盖 Cline 用户级 agents 目录探测位置 | `无默认(None/空)` | `interfaces/cli/bugx_cli/commands/plugin_cline.py` |
|
|
300
|
+
| `BUGX_AGNESCODE_MODEL` | provider/model | Agnes Code 子进程模型 | `""` | `core/hosts/agnescode.py` |
|
|
300
301
|
| `BUGX_CODEX_CONFIG` | 绝对路径 | 覆盖 Codex config.toml 探测位置 | `无默认(None/空)` | `interfaces/cli/bugx_cli/commands/plugin.py` |
|
|
301
302
|
| `BUGX_FUNIDE_DATA_DIR` | 绝对路径 | 覆盖 FunIDE 数据目录 | `无默认(None/空)` | `interfaces/cli/bugx_cli/host_adapters.py` |
|
|
302
303
|
| `BUGX_FUNIDE_PROFILE_DIR` | 绝对路径 | 覆盖 FunIDE profile 目录 | `无默认(None/空)` | `interfaces/cli/bugx_cli/host_adapters.py` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 全域全景架构与权威目录拓扑 (System Architecture & Repository Topology)
|
|
2
2
|
|
|
3
|
-
> **文档编号**: `DOC-TOPOLOGY` | **基线版本**: `0.1.
|
|
3
|
+
> **文档编号**: `DOC-TOPOLOGY` | **基线版本**: `0.1.5` | **更新日期**: 2026-11-26
|
|
4
4
|
> **文档定位**: Diátaxis - Explanation (工程拓扑、架构正交性与目录层级权威白皮书)
|
|
5
5
|
> **关联规范**: ``docs/02_architecture/01_ARCHITECTURE.md`` (`docs/02_architecture/01_ARCHITECTURE.md`) (系统高层架构设计), ``docs/02_architecture/02_DESIGN_SPEC.md`` (`docs/02_architecture/02_DESIGN_SPEC.md`) (设计规约总账), ``AGENTS.md`` (`AGENTS.md`) (工程开发宪法)
|
|
6
6
|
|
package/core/contracts/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BugX 智能体执行协议与交互契约子系统 (Agent Runtime Contracts & Protocols)
|
|
2
2
|
|
|
3
|
-
> **版本契约**: `0.1.
|
|
3
|
+
> **版本契约**: `0.1.5` | **父系统**: `core/`
|
|
4
4
|
> **工程规范**: 参见 [`docs/02_architecture/05_ARCH_NOMENCLATURE_GUIDE.md`](../../docs/02_architecture/05_ARCH_NOMENCLATURE_GUIDE.md) 与 [`docs/02_architecture/06_MODULE_GOVERNANCE_SPEC.md`](../../docs/02_architecture/06_MODULE_GOVERNANCE_SPEC.md)
|
|
5
5
|
> **守卫机制**: `scripts/verify_directory_indices.py` (100% 索引对齐防漂移)
|
|
6
6
|
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
"""AI 覆盖复核机制(DOC-AIREV
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"""AI 覆盖复核机制(DOC-AIREV):双轨目录排除架构——静态白名单打底 + AI 语义复核扫尾。
|
|
2
|
+
|
|
3
|
+
设计约束(双轨互补契约):
|
|
4
|
+
|
|
5
|
+
1. **Track 1(静态确定性白名单/基线)**:由引擎在文件系统遍历层自动硬排除公认的
|
|
6
|
+
依赖、生成物、工具链与运行态目录(如 ``.git``、``node_modules``、``dist``、
|
|
7
|
+
``build``、``.tools``、``artifacts`` 等),防止超大非源码目录在第一阶段拖死进程。
|
|
8
|
+
2. **Track 2(AI 语义全量扫尾复核)**:静态白名单绝非万能——针对白名单放行的
|
|
9
|
+
**所有剩余顶层目录**,引擎打包结构特征、文件摘录与 import 可达性证据
|
|
10
|
+
(``candidate_groups``),由宿主 AI 逐一过一遍并做出 ``product`` / ``exclude``
|
|
11
|
+
语义裁决,清洗自定义构建物、私有脚本库与非产品夹具。
|
|
12
|
+
3. **单向权威与持久化**:AI 裁决只能**移出**单元(``exclude``),不能添加;
|
|
13
|
+
裁决持久化到 ``.bugx/knowledge/coverage-review.json``,带裁决理由/时间/
|
|
14
|
+
裁决者/证据包摘要,可审计可回滚(重审覆盖即可推翻)。
|
|
15
|
+
4. **换项目零迁移**:候选组按当次发现结果动态生成,不携带任何项目名清单。
|
|
12
16
|
"""
|
|
13
17
|
|
|
14
18
|
from __future__ import annotations
|
|
@@ -492,7 +492,7 @@ def write_inventory_diff(manifest: Path, changes: dict) -> None:
|
|
|
492
492
|
|
|
493
493
|
def bootstrap(
|
|
494
494
|
root: Path, *, confirmed: bool = False, inherit_coverage: bool = True,
|
|
495
|
-
reconcile: bool = False,
|
|
495
|
+
reconcile: bool = False, symbols: bool = True,
|
|
496
496
|
) -> dict[str, object]:
|
|
497
497
|
"""Create the manifest after an explicit host/user confirmation.
|
|
498
498
|
|
|
@@ -616,7 +616,7 @@ def bootstrap(
|
|
|
616
616
|
}
|
|
617
617
|
|
|
618
618
|
try:
|
|
619
|
-
discovered = module_coverage.discovery_rows(root)
|
|
619
|
+
discovered = module_coverage.discovery_rows(root, symbols=symbols)
|
|
620
620
|
except (OSError, UnicodeError, ValueError, RuntimeError) as exc:
|
|
621
621
|
strict_detail = str(exc)
|
|
622
622
|
if not _is_partial_parse_failure(exc):
|
|
@@ -686,18 +686,23 @@ def bootstrap(
|
|
|
686
686
|
discovered,
|
|
687
687
|
historical_unit_verdicts(root, exclude_polling=current_polling),
|
|
688
688
|
)
|
|
689
|
-
discovery =
|
|
689
|
+
discovery = (
|
|
690
|
+
build_discovery_metadata(status="complete", mode="symbols")
|
|
691
|
+
if symbols
|
|
692
|
+
else build_discovery_metadata(status="complete", mode="files", confidence="medium")
|
|
693
|
+
)
|
|
690
694
|
write_manifest(manifest, discovered, discovery_metadata=discovery)
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
695
|
+
if symbols:
|
|
696
|
+
try:
|
|
697
|
+
rows, _ = module_coverage.parse_manifest(manifest)
|
|
698
|
+
if not any(r.phase == "业务" for r in rows):
|
|
699
|
+
business_lines = module_coverage.business_discovery_rows(root, rows)
|
|
700
|
+
if business_lines:
|
|
701
|
+
with open(manifest, "a", encoding="utf-8") as f:
|
|
702
|
+
for bl in business_lines:
|
|
703
|
+
f.write(bl + "\n")
|
|
704
|
+
except Exception:
|
|
705
|
+
pass
|
|
701
706
|
rows, _ = module_coverage.parse_manifest(manifest)
|
|
702
707
|
return {
|
|
703
708
|
"ready": True,
|
|
@@ -929,7 +929,7 @@ def discovery_row(number: str, unit: dict, *, reset: bool = True,
|
|
|
929
929
|
note += f" platform:{unit_platform_name}"
|
|
930
930
|
difficulty = "3"
|
|
931
931
|
calc_risk: float | None = None
|
|
932
|
-
if root is not None:
|
|
932
|
+
if root is not None and unit.get("parser") != "files-only":
|
|
933
933
|
try:
|
|
934
934
|
operation_cache = risk_cache if risk_cache is not None else {}
|
|
935
935
|
calc_risk = cached_unit_risk_score(file_path, root, digest, operation_cache)
|
|
@@ -58,7 +58,7 @@ def _read_preset_raw_payload(root: Path | None = None) -> dict[str, Any]:
|
|
|
58
58
|
|
|
59
59
|
try:
|
|
60
60
|
st = preset_file.stat()
|
|
61
|
-
if bool(st.st_mode & 0o002): # world-writable 防御
|
|
61
|
+
if os.name == "posix" and bool(st.st_mode & 0o002): # world-writable 防御
|
|
62
62
|
return {}
|
|
63
63
|
|
|
64
64
|
payload = json.loads(preset_file.read_text(encoding="utf-8"))
|