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.
- package/README.md +193 -185
- package/core/README.md +2 -2
- package/core/agent/README.md +2 -1
- package/core/agent/agent_artifacts.py +8 -6
- package/core/agent/agent_eval.py +136 -54
- package/core/agent/agent_execution.py +218 -52
- package/core/agent/agent_orchestrator.py +14 -8
- package/core/agent/agent_targets.py +8 -2
- package/core/agent/feature_baseline.py +150 -0
- package/core/assets/README.md +3 -2
- package/core/assets/axe-core/LICENSE-3RD-PARTY.txt +66 -0
- package/core/assets/axe-core/LICENSE.txt +362 -0
- package/core/assets/axe-core/UPSTREAM.md +10 -0
- package/core/assets/axe-core/axe.min.js +12 -0
- package/core/assets/bugx-hero-en.svg +74 -0
- package/core/assets/bugx-hero-zh.svg +74 -0
- package/core/assets/bugx-social-preview.svg +71 -0
- package/core/assets/bugx-wechat-group.png +0 -0
- package/core/assets/codex.png +0 -0
- package/core/assets/dsh.png +0 -0
- package/core/assets/webui-chatgpt.jpg +0 -0
- package/core/assets/webui-session.jpg +0 -0
- package/core/assets/webui-skills.jpg +0 -0
- package/core/assets/webui-studio.jpg +0 -0
- package/core/assets/webui-zcode.jpg +0 -0
- package/core/assets/zcode.png +0 -0
- package/core/audit_packs/README.md +2 -0
- package/core/audit_packs/pitfalls/auth_crypto.json +64 -0
- package/core/audit_packs/pitfalls/file_ssrf_cmd.json +64 -0
- package/core/audit_packs/pitfalls/go_backend.json +66 -0
- package/core/audit_packs/pitfalls/java_spring.json +64 -0
- package/core/audit_packs/pitfalls/js_ts_web.json +67 -0
- package/core/audit_packs/pitfalls/python_web.json +82 -0
- package/core/autonomous_cve/SPEC.md +1 -1
- package/core/autonomous_cve/attack_graph_store.py +152 -106
- package/core/autonomous_cve/behavior_graph.py +8 -2
- package/core/autonomous_cve/verifier.py +4 -1
- package/core/bugx.md +1 -1
- package/core/bugx_paths.py +43 -8
- package/core/cli-help.txt +66 -0
- package/core/cloud_sync/SPEC.md +1 -1
- package/core/cloud_sync/cloud_client.py +81 -11
- package/core/cloud_sync/cloud_onboard.py +42 -1
- package/core/cloud_sync/consent.py +33 -3
- package/core/cloud_sync/flywheel_client.py +186 -15
- package/core/cloud_sync/network_transport.py +24 -3
- package/core/cloud_sync/sensitive_filter.py +2 -2
- package/core/cloud_sync/sync_push.py +12 -10
- package/core/contracts/AGENT_GUIDE.md +6 -9
- package/core/contracts/README.md +2 -2
- package/core/contracts/bugx-runtime-contract.md +1 -1
- package/core/contracts/bugx-worker.md +1 -1
- package/core/contracts/engine_gap_contracts.py +86 -3
- package/core/coverage/coverage_discovery.py +599 -29
- package/core/coverage/coverage_evidence.py +47 -0
- package/core/coverage/coverage_forensics.py +9 -0
- package/core/coverage/coverage_validate.py +6 -1
- package/core/dev_harness/SPEC.md +1 -1
- package/core/engine-integrity.json +670 -442
- package/core/fuzzing/concurrency_fuzzer.py +53 -0
- package/core/fuzzing/differential_oracle.py +562 -27
- package/core/fuzzing/fuzz_input.py +109 -6
- package/core/fuzzing/stateful_fuzzer.py +72 -0
- package/core/governance/secret_redactor.py +22 -10
- package/core/host_acp/SPEC.md +1 -1
- package/core/host_acp/__init__.py +4 -4
- package/core/host_acp/claude.py +59 -1
- package/core/host_acp/cline.py +64 -1
- package/core/host_acp/codex.py +56 -1
- package/core/host_acp/dsh.py +59 -1
- package/core/host_acp/opencode.py +56 -1
- package/core/host_acp/pi.py +59 -1
- package/core/host_acp/zcode.py +59 -1
- package/core/host_runtime/SPEC.md +1 -1
- package/core/host_runtime/adapters.py +1 -1
- package/core/host_runtime/cline.py +13 -0
- package/core/host_runtime/host_evaluators.py +44 -4
- package/core/host_runtime/host_probe.py +1 -1
- package/core/host_runtime/host_provider_arbitrator.py +116 -62
- package/core/host_runtime/host_registry.py +15 -8
- package/core/host_runtime/mcp_registry_gate.py +12 -1
- package/core/host_runtime/pi.py +102 -0
- package/core/host_runtime/provider_facts.py +66 -0
- package/core/hosts/SPEC.md +1 -1
- package/core/hosts/__init__.py +6 -2
- package/core/hosts/_dsh_usage.py +1 -1
- package/core/hosts/base.py +32 -4
- package/core/hosts/claude.py +55 -0
- package/core/hosts/cline.py +6 -2
- package/core/hosts/codex.py +58 -0
- package/core/hosts/dsh.py +9 -1
- package/core/hosts/opencode.py +6 -6
- package/core/hosts/pi.py +159 -2
- package/core/infra/README.md +4 -2
- package/core/infra/__init__.py +2 -0
- package/core/infra/build_info.py +22 -3
- package/core/infra/client_metadata.py +1 -1
- package/core/infra/json_utils.py +22 -0
- package/core/launch_phases/README.md +6 -3
- package/core/launch_phases/SPEC.md +1 -1
- package/core/launch_phases/common.py +21 -2
- package/core/launch_phases/finding_confirm_phase.py +170 -5
- package/core/launch_phases/finding_settlement.py +188 -1
- package/core/launch_phases/judge_phase.py +69 -12
- package/core/launch_phases/orchestrator_controls.py +11 -7
- package/core/launch_phases/post_coverage_sync.py +9 -2
- package/core/launch_phases/post_phase.py +144 -8
- package/core/launch_phases/post_receipt.py +12 -1
- package/core/launch_phases/pre_phase.py +3 -3
- package/core/launch_phases/pre_recon_scout.py +66 -36
- package/core/launch_phases/pre_state_builder.py +23 -176
- package/core/launch_phases/report_sharing.py +3 -7
- package/core/launch_phases/round_orchestrator.py +129 -58
- package/core/launch_phases/semantic_recon.py +545 -0
- package/core/launch_phases/session_runtime.py +56 -9
- package/core/launch_phases/startup_gates.py +36 -8
- package/core/launch_phases/startup_interaction.py +68 -12
- package/core/launch_phases/startup_version_gate.py +13 -3
- package/core/launch_phases/supervisor_bridge.py +46 -17
- package/core/launch_phases/supervisor_coverage.py +8 -2
- package/core/launch_phases/supervisor_degraded.py +1 -9
- package/core/launch_phases/verify_loop.py +767 -0
- package/core/launch_phases/worker_barriers.py +15 -5
- package/core/launch_phases/worker_orchestrator.py +105 -25
- package/core/launch_phases/worker_prior.py +115 -0
- package/core/ledger/README.md +2 -1
- package/core/ledger/SPEC.md +1 -1
- package/core/ledger/_facade.py +2 -1
- package/core/ledger/archive_ops.py +60 -2
- package/core/ledger/cli.py +6 -1
- package/core/ledger/export_ops.py +6 -1
- package/core/ledger/finding_confirmation.py +48 -6
- package/core/ledger/finding_lifecycle.py +428 -5
- package/core/ledger/finding_verification.py +555 -10
- package/core/ledger/fp_ledger.py +255 -0
- package/core/ledger/incidents.py +10 -4
- package/core/ledger/patterns.py +10 -7
- package/core/ledger/receipt_contract.py +17 -1
- package/core/ledger/sync_ops.py +21 -16
- package/core/ledger/tool_experience.py +2 -1
- package/core/ledger/verify_life.py +88 -17
- package/core/locales/en-US.json +2 -2
- package/core/locales/zh-CN.json +2 -2
- package/core/mcp_handlers/SPEC.md +1 -1
- package/core/mcp_handlers/base.py +23 -3
- package/core/mcp_handlers/channel_lifecycle.py +85 -30
- package/core/mcp_handlers/retrieval_handlers.py +11 -1
- package/core/mcp_handlers/rpc_server.py +6 -1
- package/core/mcp_handlers/supervisor_handlers.py +32 -6
- package/core/mcp_handlers/tool_table.py +15 -0
- package/core/mcp_runtime_support/environment.py +0 -38
- package/core/mcp_runtime_support/verifier.py +0 -52
- package/core/metadata.txt +2 -3
- package/core/planning/README.md +2 -1
- package/core/planning/domain_router.py +4 -2
- package/core/planning/dynamic_flow_analyzer.py +219 -14
- package/core/planning/judge_pipeline.py +87 -4
- package/core/planning/prompt_harness.py +57 -15
- package/core/planning/prompt_policy_engine.py +386 -0
- package/core/planning/spec_harvester.py +4 -4
- package/core/probes/INTERFACE.md +11 -1
- package/core/probes/SPEC.md +11 -1
- package/core/probes/__init__.py +46 -40
- package/core/probes/android_probe.py +177 -9
- package/core/probes/codebase_memory_probe.py +57 -0
- package/core/probes/desktop_probe.py +104 -0
- package/core/probes/differential_probe.py +99 -21
- package/core/probes/efficiency_probe.py +64 -0
- package/core/probes/ios_binary_probe.py +105 -1
- package/core/probes/memory_probe.py +66 -0
- package/core/probes/miniprogram_probe.py +75 -13
- package/core/probes/mobile_probe.py +215 -30
- package/core/probes/native_probe.py +88 -0
- package/core/probes/openwiki_probe.py +70 -0
- package/core/probes/pattern_probe.py +106 -0
- package/core/probes/platform_probe.py +81 -0
- package/core/probes/probe_registry.py +108 -7
- package/core/probes/sast_fixture_corpus.py +340 -0
- package/core/probes/sast_probe.py +553 -52
- package/core/probes/sast_rules.py +668 -28
- package/core/probes/sca_scanner.py +48 -0
- package/core/probes/ui_accessibility.py +149 -0
- package/core/probes/ui_audit.py +513 -0
- package/core/probes/ui_contract.py +273 -0
- package/core/probes/ui_evidence.py +212 -0
- package/core/probes/ui_measurements.py +314 -0
- package/core/probes/ui_repair.py +250 -0
- package/core/probes/ui_review.py +133 -0
- package/core/probes/ui_storybook.py +107 -0
- package/core/probes/ui_tokens.py +185 -0
- package/core/probes/ui_visual_diff.py +131 -0
- package/core/probes/web_probe.py +373 -18
- package/core/project_profiler/SPEC.md +1 -1
- package/core/project_profiler/arbitrator.py +6 -1
- package/core/project_profiler/detector.py +8 -1
- package/core/project_profiler/strategy.py +51 -15
- package/core/prompts/README.md +4 -2
- package/core/prompts/command_routing_en.md +2 -2
- package/core/prompts/command_routing_zh.md +2 -2
- package/core/prompts/policies/prompt_policies.json +101 -0
- package/core/prompts/stages/stage_repair.md +1 -1
- package/core/prompts/stages/stage_verify.defensive.md +42 -0
- package/core/prompts/stages/stage_verify.md +44 -0
- package/core/repair/README.md +1 -1
- package/core/repair/l7_repair_loop.py +1 -4
- package/core/repair/rsi_fixer.py +4 -4
- package/core/repair/rsi_loop.py +1 -3
- package/core/repair/rsi_repair.py +7 -7
- package/core/repair/rsi_scope.py +27 -8
- package/core/report_engine/SPEC.md +1 -1
- package/core/report_engine/attestation.py +8 -4
- package/core/report_engine/finding_report.py +2 -1
- package/core/report_engine/models.py +7 -9
- package/core/report_engine/report_share.py +0 -8
- package/core/report_engine/sast_bridge.py +2 -2
- package/core/report_engine/server.py +18 -8
- package/core/report_engine/web-conformance.md +123 -18
- package/core/report_engine/web_conformance.py +21 -52
- package/core/retrieval/README.md +2 -1
- package/core/retrieval/SPEC.md +1 -1
- package/core/retrieval/code_analyzer.py +50 -14
- package/core/retrieval/context_assembler.py +7 -1
- package/core/retrieval/knowledge_sync.py +108 -14
- package/core/retrieval/pitfall_packs.py +277 -0
- package/core/retrieval/symbol_index.py +25 -6
- package/core/retrieval/universal_code_matcher.py +234 -49
- package/core/runtime/README.md +1 -1
- package/core/runtime/bugx_logging.py +78 -7
- package/core/runtime/fixture_solidify.py +5 -10
- package/core/runtime/global_telemetry.py +20 -0
- package/core/runtime/incident_eval.py +1 -1
- package/core/runtime/model_runner.py +4 -41
- package/core/runtime/platform_adapter.py +2 -2
- package/core/runtime/prep_validate.py +4 -2
- package/core/runtime/project_settings.py +2 -1
- package/core/runtime/scenario_eval.py +50 -8
- package/core/skills/bugx_docs_mcp_server.py +3 -1
- package/core/skills/bugx_mcp_server.py +29 -2
- package/core/skills/tools_kb.py +1 -1
- package/core/supervisor/README.md +1 -1
- package/core/supervisor/SPEC.md +1 -1
- package/core/supervisor/budget_governor.py +503 -9
- package/core/supervisor/checkpoint_pipeline.py +248 -6
- package/core/supervisor/checkpoint_sync.py +13 -0
- package/core/supervisor/claim_events.py +1 -1
- package/core/supervisor/finding_workflow.py +22 -5
- package/core/supervisor/lease_manager.py +1 -1
- package/core/supervisor/lifecycle_blocks.py +6 -1
- package/core/supervisor/rejection_remedies.py +52 -5
- package/core/supervisor/serial_authorization.py +48 -4
- package/core/supervisor/task_scheduler.py +2 -2
- package/core/supervisor/worker_checkpoint.py +8 -1
- package/core/supervisor/worker_runtime.py +8 -2
- package/core/supervisor_types/worker_claim.py +9 -0
- package/core/webui/README.md +1 -1
- package/core/webui/SPEC.md +2 -1
- package/core/webui/adapters/claude.py +5 -1
- package/core/webui/adapters/cline.py +10 -2
- package/core/webui/adapters/codex.py +5 -1
- package/core/webui/adapters/dsh.py +5 -1
- package/core/webui/docs_session_service.py +2 -2
- package/core/webui/mcp_inspector.py +11 -7
- package/core/webui/static/00-base.css +1060 -0
- package/core/webui/static/01-monitoring.css +802 -0
- package/core/webui/static/02-header-actions.css +321 -0
- package/core/webui/static/03-trigger-popover.css +697 -0
- package/core/webui/static/04-composer.css +628 -0
- package/core/webui/static/05-skills-center.css +878 -0
- package/core/webui/static/06-mcp-center.css +623 -0
- package/core/webui/static/07-skill-detail.css +265 -0
- package/core/webui/static/08-files-management.css +167 -0
- package/core/webui/static/09-files-center.css +386 -0
- package/core/webui/static/10-icons.css +105 -0
- package/core/webui/static/11-project-options.css +185 -0
- package/core/webui/static/12-profile-tab.css +383 -0
- package/core/webui/static/design-tokens.css +113 -0
- package/core/webui/static/index.html +14 -1
- package/core/webui/workspace_service.py +1 -1
- package/docs/07_distribution/01_README_NPM.md +193 -185
- package/ecosystem/integrations/README.md +1 -1
- package/ecosystem/integrations/dsh/mcp/package.json +1 -1
- package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/integrations/dsh/ui/package.json +1 -1
- package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +4 -4
- package/ecosystem/integrations/opencode/mcp-lock.json +14 -6
- package/ecosystem/integrations/opencode/opencode.json +23 -12
- 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/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +1 -1
- package/interfaces/bin/bugx.js +37 -0
- package/interfaces/cli/bugx_cli/__init__.py +4 -2
- package/interfaces/cli/bugx_cli/cli.py +172 -69
- package/interfaces/cli/bugx_cli/commands/advisory.py +1 -1
- package/interfaces/cli/bugx_cli/commands/agent.py +461 -134
- package/interfaces/cli/bugx_cli/commands/audit.py +10 -9
- package/interfaces/cli/bugx_cli/commands/autonomous.py +1 -1
- package/interfaces/cli/bugx_cli/commands/cloud.py +31 -22
- package/interfaces/cli/bugx_cli/commands/doctor.py +449 -204
- package/interfaces/cli/bugx_cli/commands/interaction.py +5 -1
- package/interfaces/cli/bugx_cli/commands/knowledge.py +5 -4
- package/interfaces/cli/bugx_cli/commands/lifecycle.py +3 -3
- package/interfaces/cli/bugx_cli/commands/plugin.py +58 -23
- package/interfaces/cli/bugx_cli/commands/plugin_claude.py +7 -7
- package/interfaces/cli/bugx_cli/commands/plugin_funide.py +2 -1
- package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +1 -1
- package/interfaces/cli/bugx_cli/commands/project.py +6 -13
- package/interfaces/cli/bugx_cli/commands/report.py +2 -6
- package/interfaces/cli/bugx_cli/commands/system.py +524 -169
- package/interfaces/cli/bugx_cli/common.py +21 -15
- package/interfaces/cli/bugx_cli/host_adapters.py +29 -54
- package/interfaces/cli/bugx_cli/hosts/registry.py +8 -6
- package/interfaces/cli/bugx_cli/infra/ai_advisor.py +157 -27
- package/interfaces/cli/bugx_cli/infra/engine_installer.py +35 -16
- package/interfaces/cli/bugx_cli/infra/host_sync.py +11 -8
- package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +76 -5
- package/interfaces/cli/bugx_cli/infra/security.py +13 -6
- package/package.json +30 -15
- package/pyproject.toml +60 -9
- package/scripts/ensure-python.mjs +7 -7
- package/scripts/sync-version.mjs +10 -21
- package/scripts/test-npm-wrapper.mjs +1 -1
- package/core/assets/bugx-hero-cn.png +0 -0
- package/core/assets/bugx-hero-en.png +0 -0
- package/core/webui/static/project-settings.css +0 -6458
- package/docs/07_distribution/README.md +0 -16
- package/docs/README.md +0 -121
- package/interfaces/README.md +0 -143
- package/interfaces/bin/README.md +0 -35
- package/interfaces/cli/README.md +0 -90
- package/scripts/README.md +0 -118
package/core/hosts/pi.py
CHANGED
|
@@ -12,13 +12,16 @@
|
|
|
12
12
|
* engine_run ← 无头通道为 ``pi --approve -p <prompt>``,自治执行为 ``pi --approve -p <prompt> --mode json``;
|
|
13
13
|
无原生 Task / Subagent 编排(``native_task=False``)。
|
|
14
14
|
* worker_runtime← ``mode="process"``,最大并发 4 路;独立进程模式。
|
|
15
|
-
* mcp_write ← 配置容器键为 ``mcpServers``,项目级作用域为 ``.pi/mcp.json
|
|
15
|
+
* mcp_write ← 配置容器键为 ``mcpServers``,项目级作用域为 ``.pi/mcp.json``;
|
|
16
|
+
根绝对化在插件 ``bootstrap`` 写入路径落地(``Path.resolve()``
|
|
17
|
+
后落盘,dsh 同类 cwd 陷阱已消解)。
|
|
16
18
|
* acp ← 上游 ``pi 0.85.1`` 无 ACP 子命令/flag,由 ``core/host_acp/pi.py``
|
|
17
19
|
以 ``status="unavailable"`` 声明。
|
|
18
20
|
"""
|
|
19
21
|
|
|
20
22
|
from __future__ import annotations
|
|
21
23
|
|
|
24
|
+
import shutil
|
|
22
25
|
from pathlib import Path
|
|
23
26
|
|
|
24
27
|
from .base import (
|
|
@@ -33,7 +36,7 @@ from .base import (
|
|
|
33
36
|
WorkerRuntimeFacet,
|
|
34
37
|
)
|
|
35
38
|
|
|
36
|
-
__all__ = ["PLUGIN"]
|
|
39
|
+
__all__ = ["PLUGIN", "is_available", "run_static_degraded"]
|
|
37
40
|
|
|
38
41
|
_NAME = "pi"
|
|
39
42
|
|
|
@@ -83,6 +86,92 @@ def _agent_config_path(root: Path) -> Path:
|
|
|
83
86
|
return root / ".pi"
|
|
84
87
|
|
|
85
88
|
|
|
89
|
+
_MCP_SERVERS_KEY = "mcpServers"
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _absolutize_mcp_args(args: list[str], root_str: str, root: Path) -> list[str]:
|
|
93
|
+
"""把 server argv 里的 ``--root`` 与项目内 ``--db`` 绝对化到本项目。
|
|
94
|
+
|
|
95
|
+
只改写这两个 token 的**下一个**参数;其余 argv 逐字保留。
|
|
96
|
+
"""
|
|
97
|
+
resolved = list(args)
|
|
98
|
+
for index, token in enumerate(resolved):
|
|
99
|
+
if token == "--root" and index + 1 < len(resolved):
|
|
100
|
+
resolved[index + 1] = root_str
|
|
101
|
+
elif (
|
|
102
|
+
token == "--db"
|
|
103
|
+
and index + 1 < len(resolved)
|
|
104
|
+
and str(resolved[index + 1]).startswith(".bugx/")
|
|
105
|
+
):
|
|
106
|
+
resolved[index + 1] = str(root / str(resolved[index + 1]))
|
|
107
|
+
return resolved
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def _bootstrap(root: Path, servers) -> dict:
|
|
111
|
+
"""把 BugX 的 MCP 通道写进项目级 ``.pi/mcp.json``(幂等、根绝对化)。
|
|
112
|
+
|
|
113
|
+
历史缺陷(与 dsh 已记录陷阱同类):条目曾写死 ``--root .``,假设 Pi 以被测
|
|
114
|
+
项目为 cwd spawn stdio MCP server。MCP server 由长驻 Pi 宿主进程 spawn,
|
|
115
|
+
cwd 是 Pi 自己的目录,``.`` 于是指向宿主目录而不是被审计项目。插件声明
|
|
116
|
+
``requires_absolutize=True`` 的语义在**本写入路径**落地:root 先
|
|
117
|
+
``Path.resolve()`` 绝对化,再落盘 ``--root``/``--db``。
|
|
118
|
+
|
|
119
|
+
幂等语义与 dsh 一致:不能用「命中就跳过」——那会让换了项目的用户永远停留
|
|
120
|
+
在旧根;只按传入的 BugX 自有 server 名逐字段比对重写,``mcpServers`` 下
|
|
121
|
+
他人的配置逐字保留。非对象形态的既有配置 fail-fast,绝不静默覆盖。
|
|
122
|
+
"""
|
|
123
|
+
import json
|
|
124
|
+
|
|
125
|
+
import core.secure_atomic as secure_atomic
|
|
126
|
+
|
|
127
|
+
resolved = Path(root).expanduser().resolve()
|
|
128
|
+
target = resolved / ".pi" / "mcp.json"
|
|
129
|
+
if target.is_symlink():
|
|
130
|
+
raise OSError(f"拒绝通过符号链接写入 Pi MCP 配置: {target}")
|
|
131
|
+
existed = target.exists()
|
|
132
|
+
payload: dict = {}
|
|
133
|
+
if existed:
|
|
134
|
+
try:
|
|
135
|
+
loaded = json.loads(target.read_text(encoding="utf-8"))
|
|
136
|
+
except (OSError, UnicodeError, ValueError) as exc:
|
|
137
|
+
raise OSError(f"Pi MCP 配置无法解析: {target}: {exc}") from exc
|
|
138
|
+
if not isinstance(loaded, dict):
|
|
139
|
+
raise OSError(
|
|
140
|
+
f"Pi MCP 配置顶层必须是对象: {target}。"
|
|
141
|
+
'合法形态为 {"mcpServers": {"<name>": {...}}};'
|
|
142
|
+
"若文件为空或只有一个列表,请重建为对象后再重试。"
|
|
143
|
+
)
|
|
144
|
+
payload = loaded
|
|
145
|
+
container = payload.get(_MCP_SERVERS_KEY)
|
|
146
|
+
if container is None:
|
|
147
|
+
container = {}
|
|
148
|
+
payload[_MCP_SERVERS_KEY] = container
|
|
149
|
+
if not isinstance(container, dict):
|
|
150
|
+
raise OSError(f"Pi MCP 配置 mcpServers 必须是对象: {target}")
|
|
151
|
+
root_str = str(resolved)
|
|
152
|
+
desired: dict[str, dict] = {}
|
|
153
|
+
for name, entry in dict(servers).items():
|
|
154
|
+
normalized = dict(entry)
|
|
155
|
+
args = normalized.get("args")
|
|
156
|
+
if isinstance(args, list) and all(isinstance(token, str) for token in args):
|
|
157
|
+
normalized["args"] = _absolutize_mcp_args(args, root_str, resolved)
|
|
158
|
+
desired[str(name)] = normalized
|
|
159
|
+
changed = any(container.get(name) != entry for name, entry in desired.items())
|
|
160
|
+
if not changed:
|
|
161
|
+
return {
|
|
162
|
+
"path": str(target), "changed": False, "created": False,
|
|
163
|
+
"servers": sorted(desired),
|
|
164
|
+
}
|
|
165
|
+
mode = target.stat().st_mode & 0o777 if existed else 0o600
|
|
166
|
+
container.update(dict(desired))
|
|
167
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
168
|
+
secure_atomic.atomic_write_json(target, payload, mode=mode)
|
|
169
|
+
return {
|
|
170
|
+
"path": str(target), "changed": True, "created": not existed,
|
|
171
|
+
"servers": sorted(desired),
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
|
|
86
175
|
PLUGIN = HostPlugin(
|
|
87
176
|
identity=IdentityFacet(
|
|
88
177
|
name=_NAME,
|
|
@@ -137,6 +226,15 @@ PLUGIN = HostPlugin(
|
|
|
137
226
|
max_concurrency=1,
|
|
138
227
|
requires_process_mode=True,
|
|
139
228
|
sandbox_sync=(),
|
|
229
|
+
# pi 无自有 CLI worker 协议:审计循环仍由引擎默认执行器
|
|
230
|
+
# (``worker_runtime._execute_autonomous_worker``)独家承载,本模块
|
|
231
|
+
# (``host_runtime.pi``)只做宿主 profile 预算透传(见下)。
|
|
232
|
+
runner_module="host_runtime.pi",
|
|
233
|
+
# 单 claim 墙钟预算:集成验证实测(2026-11-17)——pi 无 runner_module 时
|
|
234
|
+
# 模型 CLI 超时回落 tier 阶梯 recon=180s,codex 模型在 checkpoint 准备
|
|
235
|
+
# 阶段超过 180s 即被 ``run_model`` 击杀(与 E1 cline FAIL 同根因,
|
|
236
|
+
# build.566 只覆盖了 cline)。与 cline 同值 600s。
|
|
237
|
+
worker_timeout_seconds=600.0,
|
|
140
238
|
),
|
|
141
239
|
mcp_write=McpWriteFacet(
|
|
142
240
|
container_key="mcpServers",
|
|
@@ -145,7 +243,66 @@ PLUGIN = HostPlugin(
|
|
|
145
243
|
global_scope=None,
|
|
146
244
|
mirror_relpaths=(),
|
|
147
245
|
requires_absolutize=True,
|
|
246
|
+
# ``requires_absolutize`` 的落地点:引擎侧启动/自治引导(bootstrap_host_mcp)
|
|
247
|
+
# 委托本实现,落盘前把 --root/--db 绝对化(dsh 同类 cwd 陷阱)。
|
|
248
|
+
bootstrap=_bootstrap,
|
|
148
249
|
entry_extra={},
|
|
149
250
|
),
|
|
150
251
|
acp=AcpFacet(plugin=_NAME),
|
|
151
252
|
)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def is_available() -> tuple[bool, str]:
|
|
256
|
+
"""降级契约:机械探活 Pi CLI 是否安装(零子进程 ``shutil.which``)。
|
|
257
|
+
|
|
258
|
+
宿主探活语义:CLI 缺失时无头 ``pi --approve -p``、自治通道与 Pi 扩展面
|
|
259
|
+
全部不可用,调用方必须走 ``run_static_degraded`` 输出静态事实声明,
|
|
260
|
+
禁止伪装宿主可用。
|
|
261
|
+
"""
|
|
262
|
+
path = shutil.which("pi")
|
|
263
|
+
if path is None:
|
|
264
|
+
return False, "pi 可执行文件未安装;headless(pi --approve -p)与自治通道不可用"
|
|
265
|
+
return True, path
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def run_static_degraded(root: Path | None = None) -> dict:
|
|
269
|
+
"""Pi CLI 缺失时的静态降级输出:只声明插件事实,绝不伪装宿主健康。
|
|
270
|
+
|
|
271
|
+
输出与宿主真实可用状态字段级可区分:``status="degraded"`` + ``degraded=True``
|
|
272
|
+
+ ``degraded_reason``,且 ``headless_available`` / ``native_task_available``
|
|
273
|
+
跟随真实探活结果;MCP 健康检查在 CLI 缺失时显式声明 ``unknown``。
|
|
274
|
+
"""
|
|
275
|
+
available, availability_detail = is_available()
|
|
276
|
+
return {
|
|
277
|
+
"plugin": _NAME,
|
|
278
|
+
"schema_version": 1,
|
|
279
|
+
"success": available,
|
|
280
|
+
"status": "degraded",
|
|
281
|
+
"degraded": True,
|
|
282
|
+
"degraded_reason": (
|
|
283
|
+
"static_facts_only" if available else "pi_cli_not_installed"
|
|
284
|
+
),
|
|
285
|
+
"probe_mode": "static_degraded",
|
|
286
|
+
"headless_available": available,
|
|
287
|
+
"native_task_available": bool(available and PLUGIN.engine_run.native_task),
|
|
288
|
+
"mcp_health": "unknown" if not available else "not_probed",
|
|
289
|
+
"identity": {
|
|
290
|
+
"executable": PLUGIN.identity.executable,
|
|
291
|
+
"aliases": list(PLUGIN.identity.aliases),
|
|
292
|
+
"markers": list(PLUGIN.identity.markers),
|
|
293
|
+
},
|
|
294
|
+
"agent_entry": PLUGIN.install.path,
|
|
295
|
+
"mcp_project_relpath": PLUGIN.mcp_write.project_relpath,
|
|
296
|
+
"mcp_global_scope": PLUGIN.mcp_write.global_scope,
|
|
297
|
+
"mcp_config_format": getattr(PLUGIN.mcp_write, "config_format", "json"),
|
|
298
|
+
"findings": [],
|
|
299
|
+
"evidence": {
|
|
300
|
+
"availability_detail": availability_detail,
|
|
301
|
+
"project_root": str(root) if root else None,
|
|
302
|
+
},
|
|
303
|
+
"metadata": {
|
|
304
|
+
"degraded_mode": "static_plugin_facts_only",
|
|
305
|
+
"acp": "unavailable(机读声明,见 core/host_acp/pi.py)",
|
|
306
|
+
"fallback": "宿主 CLI 缺失时由外层宿主/用户决策接管;BugX 不代装宿主 CLI",
|
|
307
|
+
},
|
|
308
|
+
}
|
package/core/infra/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# BugX Core Infrastructure & Primitives (核心基础设施与底层操作系统原语子系统)
|
|
2
2
|
|
|
3
|
-
> **版本契约**: `1.
|
|
3
|
+
> **版本契约**: `0.1.2` | **所属分层**: `Layer 0: 基础设施与操作系统抽象`
|
|
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`
|
|
5
|
+
> **守卫机制**: `scripts/verify_directory_indices.py` (100% 物理条目索引覆盖)
|
|
6
6
|
|
|
7
7
|
`core/infra/` 构成了 BugX 微内核底层的纯净基础设施与底层操作系统原生能力抽象,为上层分析规划、攻防探针、并发调度与宿主集成提供高可靠、零脆弱性的基础原语支撑。
|
|
8
8
|
|
|
@@ -15,6 +15,7 @@ core/infra/
|
|
|
15
15
|
├── __init__.py # 统一导出门面
|
|
16
16
|
├── build_info.py # 固化单调自增 Build ID,提供运行时版本与编译元数据
|
|
17
17
|
├── client_metadata.py # 采集宿主硬件架构、操作系统版本与 Node/Python 运行时信息
|
|
18
|
+
├── json_utils.py # 严格 JSON 对象解析辅助,拒绝重复键
|
|
18
19
|
├── python_runtime.py # 探测并驱动独立的受控 Python 解释器执行隔离代码
|
|
19
20
|
└── safe_xml.py # 防御 XXE (XML 外部实体注入) 的安全解析适配器
|
|
20
21
|
```
|
|
@@ -28,6 +29,7 @@ core/infra/
|
|
|
28
29
|
| `__init__.py` | 统一导出门面 | 聚合导出核心基础设施与系统原语接口 | `__all__` |
|
|
29
30
|
| `build_info.py` | 构建信息固化 | 固化单调自增 Build ID,提供运行时版本、Build ID 与编译元数据查询 | `build_id`, `build_version` |
|
|
30
31
|
| `client_metadata.py` | 元数据采集器 | 采集当前宿主机硬件架构、操作系统内核与 Node/Python 运行时环境信息 | `collect_client_metadata` |
|
|
32
|
+
| `json_utils.py` | JSON 容器校验 | 构建并校验无重复键的 JSON 对象,供协议解析器复用 | `unique_json_object` |
|
|
31
33
|
| `python_runtime.py` | 隔离解释器 | 探测、校验并驱动独立的受控 Python 解释器环境执行隔离代码 | `transparent_reexec_if_needed`, `resolve_python` |
|
|
32
34
|
| `safe_xml.py` | 安全 XML 解析 | 防御 XXE (XML 外部实体注入)、DTD 实体膨胀与超深 XML 递归的安全解析适配器 | `parse_xml`, `parse_xml_file`, `XmlSecurityError` |
|
|
33
35
|
|
package/core/infra/__init__.py
CHANGED
|
@@ -4,12 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from . import build_info
|
|
6
6
|
from . import client_metadata
|
|
7
|
+
from . import json_utils
|
|
7
8
|
from . import python_runtime
|
|
8
9
|
from . import safe_xml
|
|
9
10
|
|
|
10
11
|
__all__ = [
|
|
11
12
|
"build_info",
|
|
12
13
|
"client_metadata",
|
|
14
|
+
"json_utils",
|
|
13
15
|
"python_runtime",
|
|
14
16
|
"safe_xml",
|
|
15
17
|
]
|
package/core/infra/build_info.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""BugX 构建标识与自增 Build ID 管理模块 (DOC-169).
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
语义版本号从 ``BUGX_VERSION`` 解析;源码模板只在构建 staging 时物化。
|
|
5
5
|
日常开发与提交通过单调自增、从 1 开始无上限递增的 Build ID 进行版本追踪。
|
|
6
6
|
"""
|
|
7
7
|
|
|
@@ -11,7 +11,23 @@ import os
|
|
|
11
11
|
import re
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
VERSION_ENV = "BUGX_VERSION"
|
|
15
|
+
VERSION_TOKEN = "0.1.2"
|
|
16
|
+
_DEFAULT_VERSION = "0.1.2"
|
|
17
|
+
_VERSION_RE = re.compile(r"^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def resolve_base_version(value: str | None = None) -> str:
|
|
21
|
+
"""Resolve the base version from ``BUGX_VERSION`` with one source fallback."""
|
|
22
|
+
candidate = (value or os.environ.get(VERSION_ENV) or _DEFAULT_VERSION).strip()
|
|
23
|
+
if candidate == VERSION_TOKEN:
|
|
24
|
+
candidate = os.environ.get(VERSION_ENV, _DEFAULT_VERSION).strip()
|
|
25
|
+
if not _VERSION_RE.fullmatch(candidate):
|
|
26
|
+
raise ValueError(f"invalid BugX version: {candidate!r}")
|
|
27
|
+
return candidate
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
BASE_VERSION = resolve_base_version()
|
|
15
31
|
_BUILD_ID_RE = re.compile(r"^build_id:\s*(\d+)", re.M)
|
|
16
32
|
|
|
17
33
|
|
|
@@ -73,14 +89,17 @@ def bump_build_id(root: Path | None = None) -> int:
|
|
|
73
89
|
|
|
74
90
|
|
|
75
91
|
def get_full_version_string(root: Path | None = None) -> str:
|
|
76
|
-
"""返回标准版本与 Build ID 组合字符串,例如 1.
|
|
92
|
+
"""返回标准版本与 Build ID 组合字符串,例如 0.1.1+build.627。"""
|
|
77
93
|
bid = get_build_id(root)
|
|
78
94
|
return f"{BASE_VERSION}+build.{bid}"
|
|
79
95
|
|
|
80
96
|
|
|
81
97
|
__all__ = [
|
|
82
98
|
"BASE_VERSION",
|
|
99
|
+
"VERSION_ENV",
|
|
100
|
+
"VERSION_TOKEN",
|
|
83
101
|
"bump_build_id",
|
|
84
102
|
"get_build_id",
|
|
85
103
|
"get_full_version_string",
|
|
104
|
+
"resolve_base_version",
|
|
86
105
|
]
|
|
@@ -65,7 +65,7 @@ def client_version(metadata_path: str | Path | None = None) -> str:
|
|
|
65
65
|
if value:
|
|
66
66
|
return value
|
|
67
67
|
try:
|
|
68
|
-
return importlib.metadata.version("bugx-
|
|
68
|
+
return importlib.metadata.version("bugx-cli")
|
|
69
69
|
except importlib.metadata.PackageNotFoundError:
|
|
70
70
|
return "unknown"
|
|
71
71
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Small JSON container helpers shared by protocol validators."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Callable, Iterable
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def unique_json_object(
|
|
10
|
+
pairs: Iterable[tuple[str, Any]],
|
|
11
|
+
*,
|
|
12
|
+
error_factory: Callable[[str], Exception] | None = None,
|
|
13
|
+
) -> dict[str, Any]:
|
|
14
|
+
"""Build an object while rejecting duplicate JSON member names."""
|
|
15
|
+
result: dict[str, Any] = {}
|
|
16
|
+
for key, value in pairs:
|
|
17
|
+
if key in result:
|
|
18
|
+
if error_factory is None:
|
|
19
|
+
raise ValueError(f"duplicate JSON object key: {key}")
|
|
20
|
+
raise error_factory(key)
|
|
21
|
+
result[key] = value
|
|
22
|
+
return result
|
|
@@ -26,7 +26,8 @@ flowchart TD
|
|
|
26
26
|
subgraph Phase3["3. Adjudication & Settlement (裁决结算与确认)"]
|
|
27
27
|
C1["judge_phase.py<br/>Judge 智能体证据审查"] --> C2["findings_adjudication.py<br/>反事实验证与漏洞仲裁"]
|
|
28
28
|
C2 --> C3["candidate_revalidation.py<br/>候选补丁复验与消歧"]
|
|
29
|
-
C3 -->
|
|
29
|
+
C3 --> C3V["verify_loop.py<br/>独立验证员盲审与报错自纠错闭环"]
|
|
30
|
+
C3V --> C4["finding_confirm_phase.py<br/>人机或自治确认闭环"]
|
|
30
31
|
C4 --> C5["finding_settlement.py<br/>Finding 最终落盘与账本结算"]
|
|
31
32
|
C5 --> C6["findings_snapshot.py<br/>Finding 阶段性快照保存"]
|
|
32
33
|
end
|
|
@@ -84,11 +85,13 @@ flowchart TD
|
|
|
84
85
|
| `pre_state_builder.py` | 前置会话状态构建器,初始化 `.bugx` 会话目录与配置注入 | `build_initial_session_state` |
|
|
85
86
|
| `report_sharing.py` | 审计与攻防报告外发分发器(Webhook、钉钉/企微、文件导出) | `dispatch_report_share` |
|
|
86
87
|
| `round_orchestrator.py` | 轮次迭代编排器,驱动多轮 Worker -> Judge -> Settle 循环推进 | `orchestrate_rounds` |
|
|
88
|
+
| `semantic_recon.py` | Recon 阶段轻量语义侦察叠加层(隐式路由 / 自定义鉴权边界 / 业务不变量),含物理锚点核验与反注入净化 (P2) | `run_semantic_recon_overlay`, `load_semantic_overlay` |
|
|
87
89
|
| `session_runtime.py` | 会话级运行态上下文管理器,守卫会话持久化与单例实例 | `SessionRuntimeContext` |
|
|
88
90
|
| `SPEC.md` | 生命周期规范设计与状态迁移状态机真理文档 | 阶段规范与失败处理契约 |
|
|
89
91
|
| `startup_gates.py` | 启动前置安全门禁(文件树白名单、脏工作区检查、权限拦截) | `verify_startup_gates` |
|
|
90
92
|
| `startup_interaction.py` | 交互式问答决策引擎,根据终端能力与配置解析交互模式 | `resolve_startup_interaction` |
|
|
91
|
-
| `
|
|
93
|
+
| `verify_loop.py` | 独立验证员盲审输入包构造、Anti-Gaming 校验与报错驱动 PoC 自纠错闭环 | `build_verify_bundle`, `execute_verify_attempt`, `run_verification_loop` |
|
|
94
|
+
| `startup_version_gate.py` | 版本硬门禁校验器,确保运行时版本严格等于 `0.1.2` 绝不漂移 | `assert_version_integrity` |
|
|
92
95
|
| `supervisor_bridge.py` | Supervisor 模块间解耦桥接层,提供轻量化调用门面 | `SupervisorBridge` |
|
|
93
96
|
| `supervisor_coverage.py` | 覆盖率生命周期继承器,支持空闲历史会话继承与动态分发 | `SupervisorCoverageSync` |
|
|
94
97
|
| `supervisor_degraded.py` | 降级容灾与探针就地自愈控制器,无损处理缺失依赖与环境 | `SupervisorDegradedCoordinator` |
|
|
@@ -100,7 +103,7 @@ flowchart TD
|
|
|
100
103
|
|
|
101
104
|
## 3. 核心设计契约与公理 (Design Axioms)
|
|
102
105
|
|
|
103
|
-
1. **版本绝对固化公理**:`startup_version_gate.py` 必须在任何业务逻辑启动前执行,基线版本严格锁定在 `1.
|
|
106
|
+
1. **版本绝对固化公理**:`startup_version_gate.py` 必须在任何业务逻辑启动前执行,基线版本严格锁定在 `0.1.2`,杜绝任何环境版本漂移。
|
|
104
107
|
2. **状态机单向流转与幂等性**:生命周期从 `Pre` $\rightarrow$ `Round` $\rightarrow$ `Worker` $\rightarrow$ `Judge` $\rightarrow$ `Settlement` $\rightarrow$ `Post` 严格单向流动,禁止逆流操作;重试必须走显式的轮次迭代(`advance_round_lifecycle`)。
|
|
105
108
|
3. **证据零伪造公理**:在 `findings_adjudication.py` 与 `candidate_revalidation.py` 中,所有缺陷判定必须有可执行的反事实测试证据,严禁仅凭模型推理文本定性。
|
|
106
109
|
4. **工作树物理安全红线**:`post_dry_run.py` 与 `post_commit.py` 严格遵守工作树保护宪法,未授权时绝对禁止覆盖用户未暂存的修改。
|
|
@@ -21,5 +21,5 @@ from core.launch_phases import run_pre_phase, run_post_phase
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 5. Maintenance & Verification
|
|
24
|
-
-
|
|
24
|
+
- Verification is performed with short-lived tests outside the repository; no persistent `tests/` registry is retained.
|
|
25
25
|
- Changes to exported interfaces must be synchronized via `python3 scripts/gen_interface_spec.py --package core/launch_phases --write`.
|
|
@@ -99,6 +99,25 @@ def is_runtime_started_this_process() -> bool:
|
|
|
99
99
|
return RUNTIME_STARTED_THIS_PROCESS
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
def option_value(args: list[str], option: str) -> str | None:
|
|
103
|
+
"""读取 ``--option value`` 或 ``--option=value`` 的轻量 CLI 参数。"""
|
|
104
|
+
for index, arg in enumerate(args):
|
|
105
|
+
if arg == option:
|
|
106
|
+
return args[index + 1] if index + 1 < len(args) else None
|
|
107
|
+
if arg.startswith(f"{option}="):
|
|
108
|
+
return arg.split("=", 1)[1]
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def sync_codebase_memory_env(profile: dict[str, Any]) -> None:
|
|
113
|
+
"""把 codebase-memory 探针结论同步到当前进程环境变量。"""
|
|
114
|
+
cb_probe = (profile.get("probes") or {}).get("codebase-memory")
|
|
115
|
+
if isinstance(cb_probe, dict):
|
|
116
|
+
os.environ["BUGX_USE_CODEBASE_MEMORY"] = (
|
|
117
|
+
"1" if cb_probe.get("status") == "READY" else "0"
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
|
|
102
121
|
def set_runtime_started_this_process(value: bool = True) -> None:
|
|
103
122
|
_set_runtime_started_for_loaded_modules(value)
|
|
104
123
|
|
|
@@ -559,7 +578,7 @@ del _missing_gate_phases, _extra_gate_phases
|
|
|
559
578
|
# DES-18:仅保留 ``host_registry.SUPPORTED_HOSTS`` 中真实声明且可被识别的宿主。
|
|
560
579
|
# 历史清单混入 ``roo`` / ``windsurf`` / ``cursor`` / ``kline``——四者既不在
|
|
561
580
|
# 宿主声明内,也没有任何适配实现,属于「幽灵宿主名」,会被误当作已支持宿主
|
|
562
|
-
#
|
|
581
|
+
# 展示。一致性契约以本注释为准(HOST_DISPLAY_NAMES 键与宿主声明双向核对)。
|
|
563
582
|
HOST_DISPLAY_NAMES = {
|
|
564
583
|
"opencode": "OpenCode",
|
|
565
584
|
"claude": "Claude Code",
|
|
@@ -878,7 +897,7 @@ def _lifecycle_auto_mode() -> bool:
|
|
|
878
897
|
全部符号(``MODULE_COVERAGE`` / ``COVERAGE_EVIDENCE`` / ``resolve_project_root`` /
|
|
879
898
|
``coverage_manifest_path`` / ``run_child``)本就定义在这里;留在
|
|
880
899
|
``pre_phase`` 会让 ``post_phase`` 反向依赖前置阶段,与
|
|
881
|
-
``docs/02_architecture/
|
|
900
|
+
``docs/02_architecture/01_ARCHITECTURE.md`` 声明的单向流水线矛盾。
|
|
882
901
|
"""
|
|
883
902
|
try:
|
|
884
903
|
manifest = coverage_manifest_path()
|