bugx-cli 0.1.0 → 0.1.1
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 +190 -186
- 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/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/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/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 +25 -6
- package/core/cloud_sync/cloud_onboard.py +42 -1
- package/core/cloud_sync/flywheel_client.py +16 -7
- 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 +591 -419
- 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 +2 -2
- package/core/launch_phases/SPEC.md +1 -1
- package/core/launch_phases/common.py +21 -2
- package/core/launch_phases/finding_confirm_phase.py +5 -1
- 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 +139 -3
- 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 +53 -36
- package/core/launch_phases/pre_state_builder.py +23 -176
- package/core/launch_phases/round_orchestrator.py +15 -32
- 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 +9 -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/worker_barriers.py +15 -5
- package/core/launch_phases/worker_orchestrator.py +105 -25
- package/core/ledger/README.md +1 -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 +44 -8
- 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 +1 -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 +7 -5
- 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/command_routing_en.md +2 -2
- package/core/prompts/command_routing_zh.md +2 -2
- package/core/prompts/stages/stage_repair.md +1 -1
- 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/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 +1 -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/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/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 +190 -186
- 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 +11 -4
- package/interfaces/cli/bugx_cli/commands/advisory.py +1 -1
- package/interfaces/cli/bugx_cli/commands/agent.py +339 -73
- package/interfaces/cli/bugx_cli/commands/audit.py +2 -2
- package/interfaces/cli/bugx_cli/commands/autonomous.py +1 -1
- package/interfaces/cli/bugx_cli/commands/cloud.py +4 -3
- 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 +2 -0
- package/interfaces/cli/bugx_cli/commands/lifecycle.py +3 -3
- package/interfaces/cli/bugx_cli/commands/plugin.py +55 -20
- 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/report.py +2 -6
- package/interfaces/cli/bugx_cli/commands/system.py +11 -11
- package/interfaces/cli/bugx_cli/common.py +15 -7
- 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 +18 -10
- 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 +2 -1
- package/pyproject.toml +20 -8
- package/scripts/ensure-python.mjs +7 -7
- package/scripts/sync-version.mjs +10 -21
- package/scripts/test-npm-wrapper.mjs +1 -1
- 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
|
@@ -210,6 +210,102 @@ def desktop_report(root: Path | str | None = None) -> Report:
|
|
|
210
210
|
return Report("desktop", "READY", tuple(checks), tuple(warnings))
|
|
211
211
|
|
|
212
212
|
|
|
213
|
+
def is_available(root: Path | str | None = None) -> tuple[bool, str]:
|
|
214
|
+
"""降级契约:机械探测桌面审计前置条件(<5ms,零阻塞、零子进程)。
|
|
215
|
+
|
|
216
|
+
desktop_probe 为纯静态只读探针:无外部工具/SDK 依赖,环境层面恒可用;
|
|
217
|
+
若提供 root 则顺带校验目标目录可读性。返回 (available, detail)。
|
|
218
|
+
"""
|
|
219
|
+
detail = "desktop_probe 为纯静态只读探针,无外部工具/SDK 依赖,环境恒可用"
|
|
220
|
+
if root is not None:
|
|
221
|
+
root_path = Path(root)
|
|
222
|
+
if not root_path.is_dir():
|
|
223
|
+
return False, f"目标目录不存在或不可读: {root_path}"
|
|
224
|
+
detail += f";目标目录可读: {root_path}"
|
|
225
|
+
return True, detail
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def run_static_degraded(root: Path | str | None = None) -> dict:
|
|
229
|
+
"""降级路径:受限静态取证(有界文件扫描 + 框架识别 + 打包/更新通道检查)。
|
|
230
|
+
|
|
231
|
+
降级契约:输出与成功路径(desktop_report,status=READY)**可区分**——
|
|
232
|
+
status="degraded" + degraded=True + degraded_reason;框架未识别或工程
|
|
233
|
+
不可读时如实返回 success=False,禁止把未取证写成 PASS。
|
|
234
|
+
"""
|
|
235
|
+
root_path = Path(root or Path.cwd())
|
|
236
|
+
available, availability_detail = is_available(root_path)
|
|
237
|
+
if not available:
|
|
238
|
+
return {
|
|
239
|
+
"platform": "desktop",
|
|
240
|
+
"status": "degraded",
|
|
241
|
+
"degraded": True,
|
|
242
|
+
"degraded_reason": "target_root_not_found",
|
|
243
|
+
"success": False,
|
|
244
|
+
"root": str(root_path),
|
|
245
|
+
"findings": [],
|
|
246
|
+
"warnings": [availability_detail],
|
|
247
|
+
"checks_not_run": ["electron-process-model", "packaging", "update-channel"],
|
|
248
|
+
}
|
|
249
|
+
files = _iter_files(root_path)
|
|
250
|
+
framework, evidence = _detect_framework(files)
|
|
251
|
+
warnings: list[str] = []
|
|
252
|
+
if not framework:
|
|
253
|
+
warnings.append(
|
|
254
|
+
"未识别到 Electron/Tauri/Qt/WPF 桌面框架:桌面取证不适用(非环境缺口,"
|
|
255
|
+
"与 BLOCKED 严格区分);如需桌面审计请先确认项目形态"
|
|
256
|
+
)
|
|
257
|
+
return {
|
|
258
|
+
"platform": "desktop",
|
|
259
|
+
"status": "degraded",
|
|
260
|
+
"degraded": True,
|
|
261
|
+
"degraded_reason": "desktop_framework_not_detected",
|
|
262
|
+
"success": False,
|
|
263
|
+
"root": str(root_path),
|
|
264
|
+
"findings": [],
|
|
265
|
+
"evidence": {"files_scanned": len(files)},
|
|
266
|
+
"warnings": warnings,
|
|
267
|
+
"checks_not_run": ["electron-process-model", "packaging", "update-channel"],
|
|
268
|
+
}
|
|
269
|
+
if framework == "electron":
|
|
270
|
+
process_details, process_warnings = _electron_findings(files)
|
|
271
|
+
packaging_details, packaging_warnings = _packaging_findings(files)
|
|
272
|
+
update_details, update_warnings = _update_findings(files)
|
|
273
|
+
findings = [
|
|
274
|
+
{"area": "process_model", "details": process_details},
|
|
275
|
+
{"area": "packaging", "details": packaging_details},
|
|
276
|
+
{"area": "update_channel", "details": update_details},
|
|
277
|
+
]
|
|
278
|
+
warnings.extend([*process_warnings, *packaging_warnings, *update_warnings])
|
|
279
|
+
else:
|
|
280
|
+
packaging_details, packaging_warnings = _packaging_findings(files)
|
|
281
|
+
findings = [{"area": "packaging", "details": packaging_details}]
|
|
282
|
+
warnings.extend(packaging_warnings)
|
|
283
|
+
warnings.append(
|
|
284
|
+
f"{framework} 的进程模型/更新通道无自动化探针:需宿主 Agent 以现有工具取证"
|
|
285
|
+
)
|
|
286
|
+
warnings.append(
|
|
287
|
+
"降级模式:以上为有界静态扫描结果(≤4000 文件);进程运行时行为、安装与"
|
|
288
|
+
"更新通道真实行为均未验证,禁止声称已完成桌面动态取证"
|
|
289
|
+
)
|
|
290
|
+
return {
|
|
291
|
+
"platform": "desktop",
|
|
292
|
+
"status": "degraded",
|
|
293
|
+
"degraded": True,
|
|
294
|
+
"degraded_reason": "static_mode_forced",
|
|
295
|
+
"success": True,
|
|
296
|
+
"root": str(root_path),
|
|
297
|
+
"findings": findings,
|
|
298
|
+
"evidence": {
|
|
299
|
+
"files_scanned": len(files),
|
|
300
|
+
"framework": framework,
|
|
301
|
+
"framework_evidence": evidence,
|
|
302
|
+
"availability_detail": availability_detail,
|
|
303
|
+
},
|
|
304
|
+
"warnings": warnings,
|
|
305
|
+
"checks_not_run": ["runtime-process-behavior", "installer-verification"],
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
|
|
213
309
|
def print_report(report: Report, *, as_json: bool = False) -> None:
|
|
214
310
|
if as_json:
|
|
215
311
|
print(json.dumps(asdict(report), ensure_ascii=False, indent=2))
|
|
@@ -227,7 +323,15 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
227
323
|
parser.add_argument("command", choices=("check", "status"), nargs="?", default="check")
|
|
228
324
|
parser.add_argument("--root", type=Path, default=Path.cwd())
|
|
229
325
|
parser.add_argument("--json", action="store_true")
|
|
326
|
+
parser.add_argument(
|
|
327
|
+
"--static-degraded", action="store_true",
|
|
328
|
+
help="显式执行降级路径(有界静态取证;输出 status=degraded,"
|
|
329
|
+
"不验证运行时行为)",
|
|
330
|
+
)
|
|
230
331
|
args = parser.parse_args(argv)
|
|
332
|
+
if args.static_degraded:
|
|
333
|
+
print(json.dumps(run_static_degraded(args.root), ensure_ascii=False, indent=2))
|
|
334
|
+
return 0
|
|
231
335
|
report = desktop_report(args.root)
|
|
232
336
|
print_report(report, as_json=args.json)
|
|
233
337
|
# “不适用”不是失败:退出码 0 表示探针结论有效,避免上游把它误判为执行失败。
|
|
@@ -41,20 +41,15 @@ from pathlib import Path
|
|
|
41
41
|
|
|
42
42
|
from core.supervisor.worker_execution import run_bounded
|
|
43
43
|
|
|
44
|
-
# QUA-03:
|
|
45
|
-
# DifferentialError
|
|
46
|
-
from core.fuzzing.fuzz_input import shell_argv as _shell_argv
|
|
44
|
+
# QUA-03:argv lexer 与 shell 运算符校验只保留一份;本模块仅适配
|
|
45
|
+
# DifferentialError 语义,不能复制解析实现。
|
|
46
|
+
from core.fuzzing.fuzz_input import shell_argv as _shell_argv, split_argv as _split_argv_shared
|
|
47
47
|
|
|
48
48
|
DEFAULT_TIMEOUT = 10.0
|
|
49
49
|
DEFAULT_REPEAT = 1
|
|
50
50
|
MAX_INPUTS = 2000
|
|
51
51
|
MAX_CAPTURE = 65536
|
|
52
52
|
MAX_INPUT_BYTES = 16 * 1024 * 1024
|
|
53
|
-
_SHELL_PUNCTUATION = ";&|<>`$()"
|
|
54
|
-
_SHELL_OPERATORS = frozenset({
|
|
55
|
-
";", "&", "&&", "|", "||", "<", ">", ">>", "<<", "<&", ">&",
|
|
56
|
-
"`", "$(", "(", ")",
|
|
57
|
-
})
|
|
58
53
|
|
|
59
54
|
|
|
60
55
|
class DifferentialError(ValueError):
|
|
@@ -62,19 +57,14 @@ class DifferentialError(ValueError):
|
|
|
62
57
|
|
|
63
58
|
|
|
64
59
|
def _split_argv(template: str) -> list[str]:
|
|
65
|
-
"""
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if not argv:
|
|
74
|
-
raise DifferentialError("命令不能为空")
|
|
75
|
-
if any(token in _SHELL_OPERATORS for token in argv):
|
|
76
|
-
raise DifferentialError("命令包含 shell 运算符;如确需使用,请显式传入 --allow-shell")
|
|
77
|
-
return argv
|
|
60
|
+
"""复用全仓 argv 解析器,仅适配本模块的异常契约。"""
|
|
61
|
+
return _split_argv_shared(
|
|
62
|
+
template,
|
|
63
|
+
error_type=DifferentialError,
|
|
64
|
+
parse_error_prefix="命令无法解析",
|
|
65
|
+
empty_message="命令不能为空",
|
|
66
|
+
operator_message="命令包含 shell 运算符;如确需使用,请显式传入 --allow-shell",
|
|
67
|
+
)
|
|
78
68
|
|
|
79
69
|
|
|
80
70
|
def check_readiness() -> dict:
|
|
@@ -352,5 +342,93 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
352
342
|
return 0
|
|
353
343
|
|
|
354
344
|
|
|
345
|
+
def is_available() -> tuple[bool, str]:
|
|
346
|
+
"""降级契约:机械探活差分执行前提,对齐既有 ``check_readiness()`` 先例。
|
|
347
|
+
|
|
348
|
+
只检查受限执行器与 argv 解析器是否已加载(纯属性/可调用性判定,零子进程);
|
|
349
|
+
环境不满足时返回 False,调用方必须走 ``run_static_degraded``,禁止伪装
|
|
350
|
+
双侧执行完成。
|
|
351
|
+
"""
|
|
352
|
+
readiness = check_readiness()
|
|
353
|
+
ok = readiness["status"] == "READY"
|
|
354
|
+
if ok:
|
|
355
|
+
return True, "受限执行器与 argv 解析器就绪"
|
|
356
|
+
failed = ";".join(
|
|
357
|
+
f"{check['name']}: {check['detail']}" for check in readiness["checks"] if not check["ok"]
|
|
358
|
+
)
|
|
359
|
+
return False, f"差分执行前提缺失: {failed}"
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
def run_static_degraded(recorded_cases: list[dict] | None = None) -> dict:
|
|
363
|
+
"""降级契约:不执行目标/参考命令,仅对已记录双侧 outcome 做静态比对。
|
|
364
|
+
|
|
365
|
+
输出与成功路径(``run_comparison`` 的 report.json 摘要,含真实双侧执行
|
|
366
|
+
工件)字段级可区分:``status="degraded"`` + ``degraded=True`` +
|
|
367
|
+
``degraded_reason``;每个 case 显式声明 ``executed=False``,禁止把静态
|
|
368
|
+
比对结论伪装成 ``oracle.tier=differential`` 的真实执行工件。
|
|
369
|
+
"""
|
|
370
|
+
available, availability_detail = is_available()
|
|
371
|
+
degraded_reason = (
|
|
372
|
+
"static_mode_forced" if available else "differential_execution_unavailable"
|
|
373
|
+
)
|
|
374
|
+
cases: list[dict] = []
|
|
375
|
+
divergent = 0
|
|
376
|
+
if recorded_cases:
|
|
377
|
+
for index, case in enumerate(recorded_cases, 1):
|
|
378
|
+
target = case.get("target")
|
|
379
|
+
reference = case.get("reference")
|
|
380
|
+
required_keys = {"exit", "stdout", "stderr"}
|
|
381
|
+
sides_valid = (
|
|
382
|
+
isinstance(target, dict) and isinstance(reference, dict)
|
|
383
|
+
and required_keys.issubset(target) and required_keys.issubset(reference)
|
|
384
|
+
)
|
|
385
|
+
if not sides_valid:
|
|
386
|
+
cases.append({
|
|
387
|
+
"case_id": f"case-{index:04d}",
|
|
388
|
+
"executed": False,
|
|
389
|
+
"skipped_reason": "recorded_side_missing_or_invalid",
|
|
390
|
+
})
|
|
391
|
+
continue
|
|
392
|
+
outcome_pair = (
|
|
393
|
+
_outcome({**target, "stdout": _as_bytes(target["stdout"]), "stderr": _as_bytes(target["stderr"])}),
|
|
394
|
+
_outcome({**reference, "stdout": _as_bytes(reference["stdout"]), "stderr": _as_bytes(reference["stderr"])}),
|
|
395
|
+
)
|
|
396
|
+
kinds = _divergence_kinds(*outcome_pair)
|
|
397
|
+
if kinds:
|
|
398
|
+
divergent += 1
|
|
399
|
+
cases.append({
|
|
400
|
+
"case_id": f"case-{index:04d}",
|
|
401
|
+
"executed": False,
|
|
402
|
+
"target_exit": str(target.get("exit")),
|
|
403
|
+
"reference_exit": str(reference.get("exit")),
|
|
404
|
+
"kinds": kinds,
|
|
405
|
+
"stable": True,
|
|
406
|
+
})
|
|
407
|
+
return {
|
|
408
|
+
"schema_version": 1,
|
|
409
|
+
"success": bool(recorded_cases),
|
|
410
|
+
"status": "degraded",
|
|
411
|
+
"degraded": True,
|
|
412
|
+
"degraded_reason": degraded_reason,
|
|
413
|
+
"probe_mode": "static_degraded",
|
|
414
|
+
"inputs_total": len(cases),
|
|
415
|
+
"divergences": divergent,
|
|
416
|
+
"flaky_divergences": 0,
|
|
417
|
+
"cases": cases,
|
|
418
|
+
"findings": [],
|
|
419
|
+
"evidence": {
|
|
420
|
+
"availability_detail": availability_detail,
|
|
421
|
+
"recorded_cases_present": bool(recorded_cases),
|
|
422
|
+
},
|
|
423
|
+
"metadata": {
|
|
424
|
+
"degraded_mode": "recorded_outcome_static_compare",
|
|
425
|
+
"target_executed": False,
|
|
426
|
+
"oracle_usage": (
|
|
427
|
+
"降级比对不产生 oracle.tier=differential 工件;正式确认仍需真实双侧执行"
|
|
428
|
+
),
|
|
429
|
+
},
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
|
|
355
433
|
if __name__ == "__main__":
|
|
356
434
|
sys.exit(main())
|
|
@@ -164,5 +164,69 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
164
164
|
return 0 if args.allow_degraded else 2
|
|
165
165
|
|
|
166
166
|
|
|
167
|
+
def is_available() -> tuple[bool, str]:
|
|
168
|
+
"""降级契约:机械探活基础效率工具是否在 PATH(零子进程,不跑 --version)。
|
|
169
|
+
|
|
170
|
+
只做 ``shutil.which`` 枚举;版本下限校验(含 ast-grep 身份识别)仍归
|
|
171
|
+
``inspect()`` 的 ``_command``。环境不满足时返回 False,调用方必须走
|
|
172
|
+
``run_static_degraded``,禁止伪装效率工具链就绪。
|
|
173
|
+
"""
|
|
174
|
+
environment = _probe_environment()
|
|
175
|
+
path = environment.get("PATH")
|
|
176
|
+
found: list[str] = []
|
|
177
|
+
missing: list[str] = []
|
|
178
|
+
for names, label in ((("rg",), "ripgrep"), (("ast-grep", "sg"), "ast-grep"), (("jq",), "jq")):
|
|
179
|
+
resolved = None
|
|
180
|
+
for name in names:
|
|
181
|
+
resolved = shutil.which(name, path=path)
|
|
182
|
+
if resolved:
|
|
183
|
+
break
|
|
184
|
+
(found if resolved else missing).append(label)
|
|
185
|
+
if missing:
|
|
186
|
+
return False, f"缺失工具: {', '.join(missing)};回退 Python 标准库 + symbol_index/project_graph"
|
|
187
|
+
return True, f"基础工具就绪: {', '.join(found)}"
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def run_static_degraded(root: Path | None = None) -> dict:
|
|
191
|
+
"""降级契约:效率工具缺失时的降级输出,绝不伪装 READY。
|
|
192
|
+
|
|
193
|
+
输出与成功路径(``inspect()`` 的 READY 报告)字段级可区分:
|
|
194
|
+
``status="degraded"`` + ``degraded=True`` + ``degraded_reason``;只声明
|
|
195
|
+
机械探活事实与回退路径,不执行 ``--version`` 子进程,也不替用户决定安装。
|
|
196
|
+
"""
|
|
197
|
+
available, availability_detail = is_available()
|
|
198
|
+
resolved_root = Path(root).resolve() if root else None
|
|
199
|
+
tools = []
|
|
200
|
+
environment = _probe_environment()
|
|
201
|
+
for names, label in ((("rg",), "ripgrep"), (("ast-grep", "sg"), "ast-grep"), (("jq",), "jq")):
|
|
202
|
+
resolved = None
|
|
203
|
+
for name in names:
|
|
204
|
+
resolved = shutil.which(name, path=environment.get("PATH"))
|
|
205
|
+
if resolved:
|
|
206
|
+
break
|
|
207
|
+
tools.append({"name": label, "ok": bool(resolved), "path": resolved})
|
|
208
|
+
return {
|
|
209
|
+
"schema_version": 1,
|
|
210
|
+
"success": True,
|
|
211
|
+
"status": "degraded",
|
|
212
|
+
"degraded": True,
|
|
213
|
+
"degraded_reason": (
|
|
214
|
+
"static_mode_forced" if available else "efficiency_tools_missing"
|
|
215
|
+
),
|
|
216
|
+
"probe_mode": "static_degraded",
|
|
217
|
+
"required": False,
|
|
218
|
+
"recommended": True,
|
|
219
|
+
"root": str(resolved_root) if resolved_root else None,
|
|
220
|
+
"base_tools": tools,
|
|
221
|
+
"findings": [],
|
|
222
|
+
"evidence": {"availability_detail": availability_detail},
|
|
223
|
+
"fallback": "Python 标准库 + 内置 symbol_index/project_graph + 官方文档搜索",
|
|
224
|
+
"metadata": {
|
|
225
|
+
"degraded_mode": "mechanical_which_only",
|
|
226
|
+
"version_validation": "deferred_to_inspect",
|
|
227
|
+
},
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
167
231
|
if __name__ == "__main__":
|
|
168
232
|
raise SystemExit(main())
|
|
@@ -318,11 +318,105 @@ def check_availability() -> dict:
|
|
|
318
318
|
"status": "READY" if ready else "DEGRADED",
|
|
319
319
|
"checks": checks,
|
|
320
320
|
"capabilities": ["ios_binary_inspection"] if ready else [],
|
|
321
|
-
"fallbacks": {}
|
|
321
|
+
"fallbacks": {} if ready else {
|
|
322
|
+
"audit": "run_static_degraded(仅 Info.plist 静态审计,二进制层检查不执行)",
|
|
323
|
+
},
|
|
322
324
|
"warnings": [],
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
|
|
328
|
+
def is_available() -> tuple[bool, str]:
|
|
329
|
+
"""降级契约:机械探测 iOS 二进制审计前置条件(<5ms,零阻塞、零子进程)。
|
|
330
|
+
|
|
331
|
+
返回 (available, detail):codesign 与 otool 均在 PATH 才视为具备完整
|
|
332
|
+
二进制层审计能力;缺失时 detail 明确列出缺口与降级路径。
|
|
333
|
+
"""
|
|
334
|
+
missing: list[str] = []
|
|
335
|
+
found: list[str] = []
|
|
336
|
+
for name in ("codesign", "otool"):
|
|
337
|
+
path = shutil.which(name)
|
|
338
|
+
if path:
|
|
339
|
+
found.append(f"{name}={path}")
|
|
340
|
+
else:
|
|
341
|
+
missing.append(name)
|
|
342
|
+
if missing:
|
|
343
|
+
return False, (
|
|
344
|
+
f"缺少必需工具 {', '.join(missing)}:Mach-O/签名/entitlements 审计不可用,"
|
|
345
|
+
"降级为 run_static_degraded(仅 Info.plist 静态检查)"
|
|
346
|
+
)
|
|
347
|
+
return True, ";".join(found)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
def run_static_degraded(root: Path | str) -> dict:
|
|
351
|
+
"""降级路径:codesign/otool 缺失时仅做标准库 Info.plist 静态审计。
|
|
352
|
+
|
|
353
|
+
降级契约:输出与成功路径(inspect(),status=READY)**可区分**——
|
|
354
|
+
status="degraded" + degraded=True + degraded_reason + checks_not_run,
|
|
355
|
+
绝不伪造二进制层结论(PIE/栈保护/cryptid/entitlements 一律标注未执行)。
|
|
356
|
+
"""
|
|
357
|
+
root = Path(root)
|
|
358
|
+
report: dict = {
|
|
359
|
+
"name": "ios_binary",
|
|
360
|
+
"status": "degraded",
|
|
361
|
+
"degraded": True,
|
|
362
|
+
"degraded_reason": "codesign/otool 不可用:二进制层检查未执行",
|
|
363
|
+
"target": str(root),
|
|
364
|
+
"success": False,
|
|
365
|
+
"findings": [],
|
|
366
|
+
"facts": {},
|
|
367
|
+
"notes": [],
|
|
368
|
+
"checks_not_run": [
|
|
369
|
+
"codesign-entitlements",
|
|
370
|
+
"otool-macho-header(PIE)",
|
|
371
|
+
"nm-undefined-symbols(stack-canary)",
|
|
372
|
+
"otool-load-commands(cryptid)",
|
|
373
|
+
"otool-linked-libraries(dylib-hijack)",
|
|
374
|
+
],
|
|
375
|
+
}
|
|
376
|
+
available, detail = is_available()
|
|
377
|
+
report["availability"] = {"available": available, "detail": detail}
|
|
378
|
+
if not root.exists():
|
|
379
|
+
report["notes"].append("目标路径不存在")
|
|
380
|
+
report["degraded_reason"] = "target_path_not_found"
|
|
381
|
+
return report
|
|
382
|
+
temp_dir: tempfile.TemporaryDirectory[str] | None = None
|
|
383
|
+
try:
|
|
384
|
+
target = root
|
|
385
|
+
if root.is_file() and root.suffix == ".ipa":
|
|
386
|
+
temp_dir = tempfile.TemporaryDirectory(prefix="bugx-ipa-degraded-")
|
|
387
|
+
with zipfile.ZipFile(root) as archive:
|
|
388
|
+
archive.extractall(temp_dir.name)
|
|
389
|
+
target = Path(temp_dir.name)
|
|
390
|
+
bundle = _find_app_bundle(target) if target.is_dir() else None
|
|
391
|
+
if bundle is None:
|
|
392
|
+
report["notes"].append("未找到 .app 包(需要 .ipa / .app 目录)")
|
|
393
|
+
report["degraded_reason"] = "app_bundle_not_found"
|
|
394
|
+
return report
|
|
395
|
+
info_plist = bundle / "Info.plist"
|
|
396
|
+
if not info_plist.is_file():
|
|
397
|
+
report["notes"].append("缺少 Info.plist:降级模式下无任何可执行检查")
|
|
398
|
+
report["degraded_reason"] = "info_plist_not_found"
|
|
399
|
+
return report
|
|
400
|
+
findings, facts = _info_plist_findings(_read_plist(info_plist), str(info_plist))
|
|
401
|
+
report["findings"].extend(findings)
|
|
402
|
+
report["facts"].update({k: v for k, v in facts.items() if v is not None})
|
|
403
|
+
report["facts"]["binary"] = None
|
|
404
|
+
report["notes"].append(
|
|
405
|
+
"降级模式:仅完成 Info.plist 静态检查;二进制加固属性全部未检查,"
|
|
406
|
+
"禁止据此声称已完成 iOS 二进制层审计"
|
|
407
|
+
)
|
|
408
|
+
report["success"] = True
|
|
409
|
+
return report
|
|
410
|
+
except (OSError, zipfile.BadZipFile, ValueError) as exc:
|
|
411
|
+
report["notes"].append(f"降级审计执行失败: {exc.__class__.__name__}: {exc}")
|
|
412
|
+
report["degraded_reason"] = "degraded_execution_failed"
|
|
413
|
+
report["success"] = False
|
|
414
|
+
return report
|
|
415
|
+
finally:
|
|
416
|
+
if temp_dir is not None:
|
|
417
|
+
temp_dir.cleanup()
|
|
418
|
+
|
|
419
|
+
|
|
326
420
|
def print_report(report: dict, as_json: bool = False) -> None:
|
|
327
421
|
if as_json:
|
|
328
422
|
print(json.dumps(report, ensure_ascii=False, indent=2))
|
|
@@ -350,13 +444,23 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
350
444
|
"--check-availability", action="store_true",
|
|
351
445
|
help="只检查宿主分析工具,不读取 --root 下的目标文件",
|
|
352
446
|
)
|
|
447
|
+
parser.add_argument(
|
|
448
|
+
"--static-degraded", action="store_true",
|
|
449
|
+
help="显式执行降级路径(仅 Info.plist 静态审计;输出 status=degraded,"
|
|
450
|
+
"绝不伪造二进制层结论)",
|
|
451
|
+
)
|
|
353
452
|
args = parser.parse_args(argv)
|
|
354
453
|
report = (
|
|
355
454
|
check_availability()
|
|
356
455
|
if args.check_availability
|
|
456
|
+
else run_static_degraded(Path(args.root).expanduser())
|
|
457
|
+
if args.static_degraded
|
|
357
458
|
else inspect(Path(args.root).expanduser())
|
|
358
459
|
)
|
|
359
460
|
print_report(report, as_json=args.json)
|
|
461
|
+
if args.static_degraded:
|
|
462
|
+
# 调用方显式要求降级模式:本身不是失败,输出已带 degraded 标记。
|
|
463
|
+
return 0
|
|
360
464
|
if report["status"] == "DEGRADED" and not args.allow_fallback:
|
|
361
465
|
return 2
|
|
362
466
|
return 0
|
|
@@ -322,5 +322,71 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
322
322
|
return 0 if all(report.ready for report in reports) else 1
|
|
323
323
|
|
|
324
324
|
|
|
325
|
+
_MEMORY_STACK_TOOLS: dict[str, tuple[str, ...]] = {
|
|
326
|
+
"native": ("clang", "gcc", "cc", "leaks", "heaptrack", "valgrind", "DrMemory", "devenv"),
|
|
327
|
+
"python": ("memray",),
|
|
328
|
+
"jvm": ("java", "jcmd", "jmap", "jfr"),
|
|
329
|
+
"electron": ("node", "npx", "npm"),
|
|
330
|
+
"android": ("adb",),
|
|
331
|
+
"apple": ("instruments", "xcrun", "leaks"),
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def is_available(target: str = "native") -> tuple[bool, str]:
|
|
336
|
+
"""降级契约:机械探活指定内存审计栈关键工具是否在 PATH(零子进程)。
|
|
337
|
+
|
|
338
|
+
只做 ``shutil.which`` 枚举,不启动任何工具子命令;具体栈的完整校验
|
|
339
|
+
(版本、模块可用性)仍归各 ``*_report()``。环境不满足时返回 False,
|
|
340
|
+
调用方必须走 ``run_static_degraded``,禁止伪装 profiling 可用。
|
|
341
|
+
"""
|
|
342
|
+
names = _MEMORY_STACK_TOOLS.get(target)
|
|
343
|
+
if names is None:
|
|
344
|
+
return False, f"未知内存审计栈: {target}"
|
|
345
|
+
host = host_name()
|
|
346
|
+
if target == "native" and host == "unsupported":
|
|
347
|
+
return False, f"当前主机平台不受支持: {sys.platform}"
|
|
348
|
+
found = [name for name in names if _which(name)]
|
|
349
|
+
if not found:
|
|
350
|
+
return False, f"{target} 栈关键工具均未安装(候选: {', '.join(names)})"
|
|
351
|
+
return True, f"{target} 栈可用工具: {', '.join(found)}"
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def run_static_degraded(target: str = "native", *, platform: str | None = None) -> dict:
|
|
355
|
+
"""降级契约:内存 profiling 环境不满足时的降级输出,绝不伪装运行期数据。
|
|
356
|
+
|
|
357
|
+
输出与成功路径(``_finish`` 的 READY Report)字段级可区分:
|
|
358
|
+
``status="degraded"`` + ``degraded=True`` + ``degraded_reason``,只汇总
|
|
359
|
+
静态预检结论(which 级事实)并显式声明运行期 profiling 未执行。
|
|
360
|
+
"""
|
|
361
|
+
available, availability_detail = is_available(target)
|
|
362
|
+
report = reports_for(target, platform=platform)[0]
|
|
363
|
+
failed_required = [
|
|
364
|
+
check.name for check in report.checks if check.required and not check.ok
|
|
365
|
+
]
|
|
366
|
+
return {
|
|
367
|
+
"schema_version": 1,
|
|
368
|
+
"success": True,
|
|
369
|
+
"status": "degraded",
|
|
370
|
+
"degraded": True,
|
|
371
|
+
"degraded_reason": (
|
|
372
|
+
"static_mode_forced" if available else "memory_profiling_unavailable"
|
|
373
|
+
),
|
|
374
|
+
"probe_mode": "static_degraded",
|
|
375
|
+
"target": target,
|
|
376
|
+
"findings": [],
|
|
377
|
+
"evidence": {
|
|
378
|
+
"availability_detail": availability_detail,
|
|
379
|
+
"failed_required_checks": failed_required,
|
|
380
|
+
"checks": [asdict(check) for check in report.checks],
|
|
381
|
+
},
|
|
382
|
+
"warnings": list(report.warnings),
|
|
383
|
+
"metadata": {
|
|
384
|
+
"degraded_mode": "static_precheck_only",
|
|
385
|
+
"runtime_profiling_executed": False,
|
|
386
|
+
"fallback": "运行期数据缺失时以静态证据边界声明替代,禁止把预检结论伪装成 profiling 完成",
|
|
387
|
+
},
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
|
|
325
391
|
if __name__ == "__main__":
|
|
326
392
|
sys.exit(main())
|