bugx-cli 0.1.1__py3-none-any.whl
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.
- bugx_cli/__init__.py +6 -0
- bugx_cli/cli.py +1685 -0
- bugx_cli/commands/__init__.py +1 -0
- bugx_cli/commands/advisory.py +94 -0
- bugx_cli/commands/agent.py +4210 -0
- bugx_cli/commands/audit.py +632 -0
- bugx_cli/commands/autonomous.py +260 -0
- bugx_cli/commands/cloud.py +1371 -0
- bugx_cli/commands/daemon.py +50 -0
- bugx_cli/commands/doctor.py +1590 -0
- bugx_cli/commands/goal.py +107 -0
- bugx_cli/commands/interaction.py +248 -0
- bugx_cli/commands/knowledge.py +619 -0
- bugx_cli/commands/lifecycle.py +2763 -0
- bugx_cli/commands/patch.py +1014 -0
- bugx_cli/commands/plugin.py +2749 -0
- bugx_cli/commands/plugin_claude.py +1446 -0
- bugx_cli/commands/plugin_cline.py +269 -0
- bugx_cli/commands/plugin_codex.py +74 -0
- bugx_cli/commands/plugin_funide.py +729 -0
- bugx_cli/commands/plugin_qoder.py +216 -0
- bugx_cli/commands/plugin_zcode.py +710 -0
- bugx_cli/commands/project.py +670 -0
- bugx_cli/commands/report.py +256 -0
- bugx_cli/commands/skill.py +251 -0
- bugx_cli/commands/stats.py +133 -0
- bugx_cli/commands/system.py +2567 -0
- bugx_cli/common.py +906 -0
- bugx_cli/host_adapters.py +1892 -0
- bugx_cli/hosts/__init__.py +80 -0
- bugx_cli/hosts/base.py +99 -0
- bugx_cli/hosts/registry.py +573 -0
- bugx_cli/hosts/template_engine.py +188 -0
- bugx_cli/infra/__init__.py +209 -0
- bugx_cli/infra/ai_advisor.py +851 -0
- bugx_cli/infra/engine_installer.py +1945 -0
- bugx_cli/infra/host_sync.py +548 -0
- bugx_cli/infra/mcp_advisor.py +826 -0
- bugx_cli/infra/security.py +339 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/bugx-mcp-manifest.json +53 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/CATALOG.json +141 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/README.md +254 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/adapters/README.md +35 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/adapters/android-interaction.json +81 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/adapters/android.json +24 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/adapters/desktop-macos.json +20 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/adapters/ios-interaction.json +34 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/adapters/ios.json +23 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/adapters/memory-macos.json +24 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/README.md +51 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/__init__.py +146 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/agent_artifacts.py +766 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/agent_eval.py +1155 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/agent_execution.py +718 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/agent_orchestrator.py +1351 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/agent_targets.py +877 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/agent_workspace.py +770 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/agent/feature_baseline.py +150 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/README.md +24 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/axe-core/LICENSE-3RD-PARTY.txt +66 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/axe-core/LICENSE.txt +362 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/axe-core/UPSTREAM.md +10 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/axe-core/axe.min.js +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-avatar-1024.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-avatar-512.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-avatar-tight.svg +23 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-avatar.svg +28 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-hero-cn.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-hero-en.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-hero-en.svg +74 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/bugx-hero-zh.svg +74 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/codex.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/dsh.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/project-layout.md +42 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/assets/zcode.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/README.md +37 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/data-audit/manifest.json +94 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/data-audit/stages/00-scope.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/data-audit/stages/10-schema-inventory.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/data-audit/stages/20-query-and-integrity.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/data-audit/stages/80-evidence-regression.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/desktop-audit/manifest.json +123 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/desktop-audit/stages/00-scope.md +15 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/desktop-audit/stages/10-process-model.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/desktop-audit/stages/20-package-integrity.md +15 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/desktop-audit/stages/30-ui-behavior.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/desktop-audit/stages/80-evidence-regression.md +15 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/memory-testing.md +227 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/manifest.json +155 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/modules/android.md +19 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/modules/h5.md +18 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/modules/ios.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/modules/miniprogram.md +26 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/modules/webview.md +18 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/stages/00-scope.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/stages/10-platform-inventory.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/stages/20-masvs-static.md +20 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/stages/30-component-exposure.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/stages/40-device-behavior.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/mobile-audit/stages/80-evidence-regression.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/native-audit/manifest.json +127 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/native-audit/stages/00-scope.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/native-audit/stages/10-static-white-box.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/native-audit/stages/20-memory-concurrency.md +15 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/native-audit/stages/30-behavior-black-box.md +39 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/native-audit/stages/80-evidence-regression.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/platform-testing.md +174 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/manifest.json +191 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/modules/graphql.md +5 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/modules/h5.md +18 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/modules/multi-tenant.md +4 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/modules/oauth.md +4 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/modules/upload.md +4 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/modules/websocket.md +4 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/00-scope.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/10-discovery.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/20-auth-session.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/30-authz-business.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/40-input-output.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/50-state-async.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/60-file-ssrf-deser.md +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/70-config-dependency.md +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/audit_packs/web-audit/stages/80-evidence-regression.md +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/INTERFACE.md +61 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/README.md +58 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/__init__.py +109 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/attack_graph.py +1096 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/attack_graph_store.py +1868 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/audit_campaign.py +1232 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/behavior_graph.py +465 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/ghsa_advisories.py +174 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/models.py +93 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/mutator.py +87 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/patcher.py +126 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/scout.py +278 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/synthesizer.py +207 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/autonomous_cve/verifier.py +103 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/bugx.md +1299 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/bugx_paths.py +1881 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cli-help.txt +66 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/INTERFACE.md +32 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/README.md +62 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/__init__.py +23 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/auto_sync.py +398 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/cloud_client.py +1218 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/cloud_onboard.py +743 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/cloud_schema.py +648 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/consent.py +81 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/device_identity.py +307 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/endpoint_router.py +415 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/flywheel_client.py +769 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/network_transport.py +296 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/onboard_wizard.py +493 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/sensitive_filter.py +285 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/sync_pull.py +695 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/cloud_sync/sync_push.py +723 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/AGENT_GUIDE.md +359 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/README.md +34 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/bugx-blackbox.md +541 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/bugx-opencode.md +469 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/bugx-quick.md +44 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/bugx-runtime-contract.md +353 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/bugx-worker.md +470 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/contracts/engine_gap_contracts.py +473 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/README.md +70 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/__init__.py +106 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_ai_review.py +185 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_backfill.py +54 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_bootstrap.py +713 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_business.py +36 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_cli.py +715 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_discovery.py +1429 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_evidence.py +1024 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_forensics.py +124 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_gate.py +277 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_intelligence.py +734 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_manifest.py +396 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_platform.py +77 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/coverage_validate.py +241 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/coverage/module_coverage.py +157 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/dev_harness/INTERFACE.md +20 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/dev_harness/README.md +21 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/dev_harness/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/dev_harness/__init__.py +5 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/dev_harness/interaction_preset.py +408 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/engine-integrity.json +2797 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/fuzzing/README.md +49 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/fuzzing/__init__.py +82 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/fuzzing/concurrency_fuzzer.py +435 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/fuzzing/differential_oracle.py +1164 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/fuzzing/fuzz_input.py +1291 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/fuzzing/stateful_fuzzer.py +404 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/README.md +61 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/__init__.py +130 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/capacity_planner.py +124 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/dependency_lock.py +317 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/goal_governor.py +754 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/guide_budget.py +458 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/lockdown.sh +50 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/readonly_enforcer.py +154 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/runtime_tool_gate.py +373 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/secret_redactor.py +784 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/governance/token_budget.py +38 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/INTERFACE.md +36 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/README.md +51 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/__init__.py +121 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/base.py +111 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/claude.py +99 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/cline.py +298 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/codex.py +300 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/dsh.py +106 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/opencode.py +209 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/pi.py +94 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_acp/zcode.py +99 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/INTERFACE.md +24 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/README.md +62 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/__init__.py +21 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/adapters.py +412 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/autonomous_runner.py +1152 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/cline.py +448 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/common.py +103 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/free_models.py +786 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/host_bootstrap.py +389 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/host_evaluators.py +761 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/host_probe.py +41 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/host_provider_arbitrator.py +831 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/host_registry.py +662 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/host_usage.py +127 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/mcp_process_tracker.py +509 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/mcp_registry_gate.py +379 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/pi.py +102 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/host_runtime/provider_facts.py +66 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/INTERFACE.md +51 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/README.md +67 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/__init__.py +140 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/_base_usage.py +152 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/_codex_usage.py +297 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/_dsh_usage.py +184 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/_mcp_toml.py +365 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/_zcode_usage.py +269 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/base.py +479 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/claude.py +212 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/cline.py +229 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/codex.py +1006 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/dsh.py +526 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/opencode.py +358 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/pi.py +308 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/hosts/zcode.py +219 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/i18n.py +252 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/infra/README.md +41 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/infra/__init__.py +17 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/infra/build_info.py +105 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/infra/client_metadata.py +185 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/infra/json_utils.py +22 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/infra/python_runtime.py +540 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/infra/safe_xml.py +221 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_bugx.py +118 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/INTERFACE.md +31 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/README.md +106 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/__init__.py +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/candidate_revalidation.py +484 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/common.py +1060 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/finding_confirm_phase.py +391 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/finding_settlement.py +1432 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/findings_adjudication.py +666 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/findings_snapshot.py +357 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/judge_phase.py +848 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/lesson_context.py +536 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/lifecycle_reporter.py +627 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/orchestrator_controls.py +686 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/post_commit.py +567 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/post_coverage_sync.py +598 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/post_dry_run.py +817 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/post_observability.py +367 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/post_phase.py +1223 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/post_receipt.py +373 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/post_round_lifecycle.py +786 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/pre_phase.py +1029 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/pre_recon_scout.py +879 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/pre_state_builder.py +1133 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/report_sharing.py +414 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/round_orchestrator.py +1116 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/session_runtime.py +1670 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/startup_gates.py +1050 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/startup_interaction.py +1003 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/startup_version_gate.py +879 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/supervisor_bridge.py +1253 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/supervisor_coverage.py +423 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/supervisor_degraded.py +1211 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/worker_barriers.py +424 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/worker_orchestrator.py +1246 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/launch_phases/worker_prior.py +749 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/INTERFACE.md +35 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/README.md +160 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/__init__.py +67 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/_facade.py +227 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/archive_ops.py +630 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/auto_materialization.py +459 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/bug-log.md +22 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/cli.py +275 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/export_ops.py +554 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/finding_confirmation.py +1316 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/finding_io.py +299 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/finding_lifecycle.py +730 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/finding_verification.py +405 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/incidents.py +1005 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/lesson-replay-cases.json +20 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/lesson_ledger.py +241 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/lesson_replay.py +272 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/life_ledger.py +668 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/mistake-book.md +130 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/patterns.py +684 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/receipt_contract.py +269 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/schema.py +1192 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/sync_ops.py +940 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/tool_experience.py +683 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/ledger/verify_life.py +1597 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/lesson-ledger.json +275 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/locales/README.md +19 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/locales/en-US.json +462 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/locales/zh-CN.json +462 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/INTERFACE.md +75 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/README.md +62 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/__init__.py +128 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/base.py +717 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/channel_lifecycle.py +751 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/graph_handlers.py +222 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/knowledge_handlers.py +536 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/mining_handlers.py +586 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/resource_prompt_table.py +116 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/retrieval_handlers.py +249 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/rpc_server.py +470 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/supervisor_handlers.py +1461 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/telemetry_handlers.py +227 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_handlers/tool_table.py +1030 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_runtime_support/README.md +21 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_runtime_support/__init__.py +1 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_runtime_support/common.py +363 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_runtime_support/environment.py +567 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/mcp_runtime_support/verifier.py +758 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/metadata.txt +4 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/README.md +157 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/__init__.py +242 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/capability_plan.py +187 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/capability_planner.py +195 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/domain_archetype.py +542 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/domain_router.py +269 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/dynamic_flow_analyzer.py +533 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/impact_pruner.py +435 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/intent_adjudicator.py +175 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/judge_pipeline.py +1246 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/logic_analysis.py +419 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/prompt_harness.py +1704 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/source_inspector.py +267 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/spec_harvester.py +449 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/target_sandbox_manager.py +573 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/test_capability_verifier.py +1364 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/tools-kb.md +38 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/planning/unit_kind.py +122 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/INTERFACE.md +83 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/README.md +51 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/SPEC.md +36 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/__init__.py +76 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/android_probe.py +552 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/base.py +147 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/codebase_memory_probe.py +647 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/desktop_probe.py +342 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/differential_probe.py +434 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/efficiency_probe.py +232 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ios_binary_probe.py +472 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/memory_probe.py +392 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/miniprogram_probe.py +385 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/mobile_probe.py +466 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/native_probe.py +302 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/openwiki_probe.py +263 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/pattern_probe.py +453 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/platform_probe.py +424 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/probe_registry.py +1770 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/sast_fixture_corpus.py +340 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/sast_probe.py +1510 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/sast_rules.py +1481 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/sca_scanner.py +779 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_accessibility.py +149 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_audit.py +513 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_contract.py +273 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_evidence.py +212 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_measurements.py +314 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_repair.py +250 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_review.py +133 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_storybook.py +107 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_tokens.py +185 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/ui_visual_diff.py +131 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/probes/web_probe.py +714 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/INTERFACE.md +62 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/README.md +53 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/SPEC.md +28 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/__init__.py +201 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/arbitrator.py +316 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/constants.py +247 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/detector.py +399 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/extractors.py +836 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/fingerprint.py +116 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/storage.py +258 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/project_profiler/strategy.py +301 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/README.md +35 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/codex_dialog_dispatch.md +9 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/command_routing_en.md +42 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/command_routing_zh.md +42 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/l0_router.md +47 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/rules/anti_patterns.md +16 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/rules/concurrency_rules.md +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/rules/memory_leak_rules.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/rules/prompt_injection_defense.md +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/stages/stage_explore.md +31 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/stages/stage_gate.md +43 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/stages/stage_mutate.md +42 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/prompts/stages/stage_repair.md +85 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/README.md +74 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/__init__.py +169 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/fix_watchlist.py +391 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/l7_dynamic.py +418 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/l7_repair_loop.py +462 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/l7_selfcheck.py +862 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/minimize_repro.py +466 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/patch_synthesizer.py +617 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/regression_pack.py +379 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/rsi_fixer.py +910 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/rsi_loop.py +311 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/rsi_repair.py +348 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/rsi_rounds.py +212 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/rsi_scope.py +281 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/self_heal.py +604 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/test_generator.py +1108 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/test_quality_auditor.py +410 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/repair/test_strategy.py +511 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/INTERFACE.md +59 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/README.md +69 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/SPEC.md +28 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/__init__.py +47 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/attestation.py +228 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/authority.py +255 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/finding_report.py +418 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/formal_report_builder.py +924 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/html_renderers.py +696 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/models.py +759 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/pdf_exporter.py +231 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/projects_assets.py +730 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/report_client.py +743 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/report_data_builder.py +388 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/report_share.py +459 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/sast_bridge.py +116 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/server.py +832 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/visual_report_builder.py +796 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/web-conformance.md +168 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/web_conformance.py +428 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/report_engine/workbench_assets.py +484 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/INTERFACE.md +20 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/README.md +161 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/__init__.py +3 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/code_analyzer.py +1720 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/codebase_memory_bridge.py +337 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/context_assembler.py +240 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/corpus_fetch.py +369 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/graph_ego.py +597 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/knowledge_auto.py +662 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/knowledge_sources.py +168 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/knowledge_sync.py +1003 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/memory_store.py +480 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/query_planner.py +1020 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/rrf_engine.py +137 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/slice_extractor.py +1209 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/slice_normalizer.py +373 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/slice_spec.py +357 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/symbol_index.py +1151 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/universal_code_matcher.py +622 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/xerj_bridge.py +476 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/retrieval/xerj_supervisor.py +362 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/README.md +33 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/ios/PROVENANCE.json +30 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/ios/crypto.yaml +36 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/ios/network.yaml +20 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/ios/resilience.yaml +47 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/ios/storage.yaml +48 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/LICENSE +173 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/PROVENANCE.json +270 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-asymmetric-key-pair-used-for-multiple-purposes.yml +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-backup-manifest.yml +24 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-biometric-event-bound.yml +49 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-biometric-invalidated-enrollment.yml +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-biometric-no-confirmation-required.yml +10 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-biometric-validity-duration.yml +24 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-broken-encryption-algorithms.yaml +9 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-broken-encryption-modes.yaml +13 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-content-provider-exported.yml +35 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-custom-deeplink-scheme.yml +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-dangerous-app-permissions.yaml +65 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-data-unencrypted-shared-storage-no-user-interaction-apis.yml +36 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-data-unencrypted-shared-storage-no-user-interaction-manifest.yml +15 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-debuggable-flag.yml +10 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-debugger-checks.yml +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-deeplink-autoverify-missing.yml +33 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-deeplink-unvalidated-parameter.yml +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-device-passcode-present.yml +17 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-fileprovider-broad-scope.yml +46 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-hardcoded-crypto-keys-usage.yml +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-hardcoded-security-provider.yaml +18 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-implicit-intent-internal-communication.yml +30 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-implicit-intent-leaking-extras.yml +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-input-field-usage.yml +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-key-generation-with-insufficient-key-length.yml +21 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-keyboard-cache-input-types.yml +10 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-local-storage-input-validation.yml +48 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-native-debugger-checks.yml +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-network-checkservertrusted.yml +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-network-hostname-verification.yml +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-network-insecure-trust-anchors.yml +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-network-onreceivedsslerror.yml +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-non-random-use.yml +16 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-object-deserialization.yml +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-overlay-protection.yml +68 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-pendingintent-mutable.yml +39 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-random-apis-insufficient-entropy.yml +17 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-root-detection.yaml +59 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-sdk-version.yml +10 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-sensitive-data-in-notifications-manifest.yml +17 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-sensitive-data-in-notifications.yml +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-sensitive-data-in-screenshot.yml +18 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-sql-injection-contentprovider.yml +17 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-ssl-socket-hostnameverifier.yml +15 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-strictmode.yml +10 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-system-alert-window.yml +9 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-webview-allow-local-access.yml +15 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-webview-bridges.yml +28 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-webview-safebrowsing.yml +20 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mastg/mastg-android-webview-url-handlers.yml +41 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/miniprogram/PROVENANCE.json +26 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/miniprogram/network.yaml +37 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/miniprogram/platform.yaml +36 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/miniprogram/storage.yaml +48 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/LICENSE +165 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/PROVENANCE.json +58 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/auth.yaml +59 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/crypto.yaml +66 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/jailbreak.yaml +14 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/keyboard.yaml +34 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/logging.yaml +23 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/network.yaml +55 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/resilience.yaml +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/secrets.yaml +33 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/storage.yaml +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/rules/mobsfscan-swift/webview.yaml +32 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/README.md +198 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/__init__.py +3 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/bugx_logging.py +1464 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/daemon_runner.py +623 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/fixture_solidify.py +444 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/global_telemetry.py +549 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/incident_eval.py +148 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/interaction.py +605 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/interaction_store.py +435 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/interactive_menu.py +95 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/log_analytics.py +922 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/mining_quality_framework.py +1387 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/model_runner.py +732 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/platform_adapter.py +579 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/prep_validate.py +478 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/project_graph.py +827 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/project_init.py +481 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/project_profile.py +224 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/project_settings.py +964 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/provider_window.py +97 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/resume_ticket.py +115 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/scenario_eval.py +856 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/seed_drill.py +549 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/self_audit.py +550 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/session_profile.py +205 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/setup_ui_env.py +229 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/startup_environment.py +859 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/sync_store.py +1421 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/runtime/tool_install_targets.py +18 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/schemas/README.md +35 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/schemas/agent-graph.schema.json +368 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/schemas/attack-graph.schema.json +88 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/schemas/evidence-bundle.schema.json +33 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/schemas/skill-pack.schema.json +230 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/schemas/worker-checkpoint.schema.json +119 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/secure_atomic.py +289 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/README.md +55 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/c.txt +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/cpp.txt +32 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/css.txt +70 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/go.txt +46 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/java.txt +30 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/javascript.txt +55 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/kotlin.txt +28 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/python.txt +71 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/rust.txt +53 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/swift.txt +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/seed_corpus/typescript.txt +29 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/README.md +53 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/__init__.py +189 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/bugx_docs_mcp_server.py +418 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/bugx_mcp_server.py +1161 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/mcp_runtime.py +968 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/mcp_session_proof.py +605 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/mobile_ui_inspector.py +405 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/skill_pack.py +1214 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/skill_synthesizer.py +1153 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/skills/tools_kb.py +313 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/INTERFACE.md +121 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/README.md +209 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/SPEC.md +25 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/__init__.py +175 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/audit_supervisor.py +1015 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/budget_governor.py +1254 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/checkpoint_handler.py +368 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/checkpoint_pipeline.py +1564 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/checkpoint_sync.py +653 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/claim_events.py +74 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/claim_sync.py +590 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/cli.py +812 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/context_sync.py +55 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/coverage_sync.py +115 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/finding_commit.py +470 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/finding_sync.py +688 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/finding_workflow.py +676 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/finish_policy.py +224 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/finish_sync.py +185 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/graph_sync.py +669 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/lease_manager.py +788 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/lifecycle_blocks.py +129 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/next_round_sync.py +126 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/observability.py +140 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/recovery_sync.py +165 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/rejection_remedies.py +355 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/round_governor.py +306 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/serial_authorization.py +544 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/start_sync.py +87 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/state_store.py +249 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/supervisor_host.py +511 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/supervisor_models.py +1143 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/systemic_failure.py +104 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/task_scheduler.py +1640 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/worker_checkpoint.py +230 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/worker_execution.py +265 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/worker_handoff.py +192 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/worker_lifecycle.py +396 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/worker_runtime.py +1005 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor/worker_sync.py +89 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor_types/README.md +36 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor_types/__init__.py +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor_types/exceptions.py +52 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor_types/graph_models.py +357 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor_types/path_containment.py +151 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor_types/target_fingerprint.py +310 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/supervisor_types/worker_claim.py +411 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/INTERFACE.md +50 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/README.md +57 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/SPEC.md +26 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/__init__.py +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/__init__.py +27 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/base.py +87 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/bugx.py +102 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/claude.py +222 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/cline.py +407 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/codex.py +260 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/dsh.py +177 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/opencode.py +218 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/pi.py +272 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/registry.py +100 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/adapters/zcode.py +312 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/api_routes_post.py +668 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/dispatcher.py +1376 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/docs_session_service.py +473 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/handler.py +674 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/ide_cloud_service.py +526 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/mcp_inspector.py +1747 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/00-base.css +1060 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/01-monitoring.css +802 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/02-header-actions.css +321 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/03-trigger-popover.css +697 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/04-composer.css +628 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/05-skills-center.css +878 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/06-mcp-center.css +623 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/07-skill-detail.css +265 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/08-files-management.css +167 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/09-files-center.css +386 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/10-icons.css +105 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/11-project-options.css +185 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/12-profile-tab.css +383 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/index-CXAsl8mr.js +333 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/index-DHQUtWtx.css +1 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-400-normal-B8Z6Jvzv.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-400-normal-C44pakCn.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-500-normal-Bb4u56_6.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-500-normal-BdVUvljg.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-ext-400-normal-CWV284fw.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-ext-400-normal-DLkyKLvH.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-ext-500-normal-8-8HP2PF.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-cyrillic-ext-500-normal-DaDZE_Na.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-greek-400-normal-BccYJ-vZ.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-greek-400-normal-Cw5-AHNN.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-greek-500-normal-By8GFJzz.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-greek-500-normal-z-Q6FFuG.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-400-normal-DJ5YJwmz.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-400-normal-Dn3IlU-Z.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-500-normal-CUHe9xxf.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-500-normal-DVVamBqs.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-ext-400-normal-CEpydyUl.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-ext-400-normal-Cp7z-ARB.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-ext-500-normal-BYjRCDVy.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-latin-ext-500-normal-D-qasQTj.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-vietnamese-400-normal-BbG3LG1A.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-vietnamese-400-normal-DR1UuFon.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-vietnamese-500-normal-8N8MYVKB.woff +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/assets/source-serif-4-vietnamese-500-normal-Bi3OSTTW.woff2 +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/design-tokens.css +113 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/favicon.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/icon-192.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/index.html +55 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/manifest.webmanifest +19 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/project-settings.js +9602 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/static/sw.js +8 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/core/webui/workspace_service.py +218 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/agents/bugx.md +27 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/dsh-patch.yml +18 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/mcp/cordis.patch.yml +4 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/mcp/index.js +219 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/mcp/package.json +28 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/skills/bugx/SKILL.md +70 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/skills/bugx-dsh/SKILL.md +229 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/ui/client.js +87 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/ui/cordis.patch.yml +4 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/ui/index.js +7 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/dsh/ui/package.json +27 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/mcp-lock.json +3075 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/opencode.json +129 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/pi/extensions/bugx/README.md +12 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/pi/extensions/bugx/index.ts +299 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/pi/extensions/bugx/manifest.json +11 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/pi/skills/bugx/SKILL.md +69 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/plugins/bugx/skills/bugx-claude/SKILL.md +326 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/plugins/bugx/skills/bugx-opencode/SKILL.md +129 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/plugins/bugx/skills/bugx-zcode/SKILL.md +459 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/workbuddy/connector-meta.json +19 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/workbuddy/icon.png +0 -0
- bugx_cli-0.1.1.data/data/share/bugx-agent/workbuddy/skills/bugx/SKILL.md +70 -0
- bugx_cli-0.1.1.dist-info/METADATA +335 -0
- bugx_cli-0.1.1.dist-info/RECORD +762 -0
- bugx_cli-0.1.1.dist-info/WHEEL +5 -0
- bugx_cli-0.1.1.dist-info/entry_points.txt +2 -0
- bugx_cli-0.1.1.dist-info/licenses/LICENSE +55 -0
- bugx_cli-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
from .. import __version__
|
|
11
|
+
from ..common import _ensure_core_importable
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _render_bar(pct: float, width: int = 20) -> str:
|
|
15
|
+
filled = int(round(pct / 100.0 * width))
|
|
16
|
+
filled = min(width, max(0, filled))
|
|
17
|
+
return "█" * filled + "░" * (width - filled)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _rebind_project_identity(
|
|
21
|
+
root: Path, args: argparse.Namespace, as_json: bool,
|
|
22
|
+
) -> int:
|
|
23
|
+
"""``bugx project rebind``:把 .bugx 的项目身份迁到当前路径。
|
|
24
|
+
|
|
25
|
+
场景:项目目录被搬移/改名(或从另一台机器恢复备份)后,``.bugx`` 里存的是
|
|
26
|
+
旧路径的 ``project_id``,``require()`` 会 fail-closed 报「不属于当前项目」,
|
|
27
|
+
而历史实现给出的唯一出路是 ``rm -rf .bugx`` —— 账本、知识库、报告全丢。
|
|
28
|
+
|
|
29
|
+
``--migrate`` 是**唯一**放行搬移的方式,且显式表达语义:布局本来就属于
|
|
30
|
+
这些内容,只是根变了,因此把 ``project_id`` 重写为新根指纹并保留
|
|
31
|
+
``project_uid``(身份不因路径变化而改变)。不给 ``--migrate`` 时只做诊断。
|
|
32
|
+
"""
|
|
33
|
+
import core.bugx_paths as bugx_paths
|
|
34
|
+
|
|
35
|
+
base = root / ".bugx"
|
|
36
|
+
manifest_path = base / "manifest.json"
|
|
37
|
+
if not manifest_path.is_file():
|
|
38
|
+
message = f"缺少 {manifest_path};请先运行 bugx init"
|
|
39
|
+
if as_json:
|
|
40
|
+
print(json.dumps({"status": "error", "error": message}, ensure_ascii=False, indent=2))
|
|
41
|
+
else:
|
|
42
|
+
print(f"[bugx project] ✗ {message}")
|
|
43
|
+
return 1
|
|
44
|
+
|
|
45
|
+
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
46
|
+
stored = str(manifest.get("project_id") or "")
|
|
47
|
+
expected = bugx_paths._path_fingerprint(root)
|
|
48
|
+
uid = str(manifest.get(bugx_paths.PROJECT_UID_KEY) or "")
|
|
49
|
+
matches = stored == expected
|
|
50
|
+
|
|
51
|
+
if not getattr(args, "migrate", False):
|
|
52
|
+
detail = {
|
|
53
|
+
"status": "ok" if matches else "mismatch",
|
|
54
|
+
"root": str(root),
|
|
55
|
+
"stored_project_id": stored,
|
|
56
|
+
"expected_project_id": expected,
|
|
57
|
+
"project_uid": uid or None,
|
|
58
|
+
"portable": bool(uid),
|
|
59
|
+
"hint": (
|
|
60
|
+
"身份已与路径解绑(project_uid 持久化),无需处理。"
|
|
61
|
+
if matches and uid else
|
|
62
|
+
"路径已变更:确认这是搬移而非误用他人布局后,运行 "
|
|
63
|
+
"bugx project rebind --migrate 保留现有账本并重绑身份。"
|
|
64
|
+
),
|
|
65
|
+
}
|
|
66
|
+
if as_json:
|
|
67
|
+
print(json.dumps(detail, ensure_ascii=False, indent=2))
|
|
68
|
+
else:
|
|
69
|
+
print(f"[bugx project] 根: {root}")
|
|
70
|
+
print(f" 盘上 project_id : {stored or '(缺失)'}")
|
|
71
|
+
print(f" 当前路径指纹 : {expected}")
|
|
72
|
+
print(f" 持久化 uid : {uid or '(旧布局,无 uid)'}")
|
|
73
|
+
print(f" {detail['hint']}")
|
|
74
|
+
return 0 if matches else 2
|
|
75
|
+
|
|
76
|
+
if matches and uid:
|
|
77
|
+
if as_json:
|
|
78
|
+
print(json.dumps({"status": "ok", "changed": False, "root": str(root)},
|
|
79
|
+
ensure_ascii=False, indent=2))
|
|
80
|
+
else:
|
|
81
|
+
print("[bugx project] 身份已匹配,无需迁移。")
|
|
82
|
+
return 0
|
|
83
|
+
|
|
84
|
+
manifest["project_id"] = expected
|
|
85
|
+
manifest.setdefault(bugx_paths.PROJECT_UID_KEY, bugx_paths._new_project_uid(root))
|
|
86
|
+
bugx_paths._atomic_json(manifest_path, manifest)
|
|
87
|
+
try:
|
|
88
|
+
bugx_paths.clear_require_cache(root)
|
|
89
|
+
except Exception: # pragma: no cover - 缓存清理失败不影响正确性
|
|
90
|
+
pass
|
|
91
|
+
payload = {
|
|
92
|
+
"status": "ok", "changed": True, "root": str(root),
|
|
93
|
+
"previous_project_id": stored, "project_id": expected,
|
|
94
|
+
"project_uid": manifest[bugx_paths.PROJECT_UID_KEY],
|
|
95
|
+
}
|
|
96
|
+
if as_json:
|
|
97
|
+
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
|
98
|
+
else:
|
|
99
|
+
print(f"[bugx project] ✓ 已把 {base} 的项目身份重绑到当前路径")
|
|
100
|
+
print(f" project_id: {stored or '(缺失)'} → {expected}")
|
|
101
|
+
print(f" project_uid 保留: {payload['project_uid']}")
|
|
102
|
+
return 0
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def command_project(args: argparse.Namespace) -> int:
|
|
106
|
+
"""bugx project:工程代码体量、技术栈画像与规模估模分析。"""
|
|
107
|
+
action = getattr(args, "project_action", "analyze") or "analyze"
|
|
108
|
+
root = Path(getattr(args, "root", Path.cwd()) or Path.cwd()).resolve()
|
|
109
|
+
as_json = bool(getattr(args, "json", False))
|
|
110
|
+
|
|
111
|
+
try:
|
|
112
|
+
_ensure_core_importable()
|
|
113
|
+
import core.bugx_paths as bugx_paths
|
|
114
|
+
from core.runtime import project_profile
|
|
115
|
+
ledger_path = bugx_paths.project_knowledge_root(root) / "lesson-ledger.json"
|
|
116
|
+
except Exception as exc:
|
|
117
|
+
if as_json:
|
|
118
|
+
print(json.dumps({"status": "error", "error": f"无法加载核心分析引擎: {exc}"}, ensure_ascii=False, indent=2))
|
|
119
|
+
else:
|
|
120
|
+
print(f"[bugx project] ✗ 无法加载核心分析引擎: {exc}")
|
|
121
|
+
return 1
|
|
122
|
+
|
|
123
|
+
if action == "show":
|
|
124
|
+
cached = None
|
|
125
|
+
if ledger_path.is_file():
|
|
126
|
+
try:
|
|
127
|
+
cached = project_profile.load_project_profile(ledger_path)
|
|
128
|
+
except Exception:
|
|
129
|
+
cached = None
|
|
130
|
+
|
|
131
|
+
if cached is None:
|
|
132
|
+
# 就地自愈:画像未持久化时自动执行首次全景分析并持久化,开箱即用直接展示
|
|
133
|
+
try:
|
|
134
|
+
print(f"[bugx project] 首次运行,正在自动分析并生成项目画像...", file=sys.stderr)
|
|
135
|
+
cached = project_profile.detect_project_profile(root)
|
|
136
|
+
cached = project_profile.save_project_profile(
|
|
137
|
+
ledger_path, cached, producer_version=__version__,
|
|
138
|
+
)
|
|
139
|
+
except Exception as exc:
|
|
140
|
+
if as_json:
|
|
141
|
+
print(json.dumps({"status": "not_found", "message": f"未找到本地画像且自动生成失败: {exc}"}, ensure_ascii=False, indent=2))
|
|
142
|
+
else:
|
|
143
|
+
print(f"[bugx project] ✗ 自动生成项目画像失败: {exc}")
|
|
144
|
+
return 1
|
|
145
|
+
|
|
146
|
+
profile = cached
|
|
147
|
+
|
|
148
|
+
elif action == "analyze":
|
|
149
|
+
try:
|
|
150
|
+
profile = project_profile.detect_project_profile(root)
|
|
151
|
+
profile = project_profile.save_project_profile(
|
|
152
|
+
ledger_path, profile, producer_version=__version__,
|
|
153
|
+
)
|
|
154
|
+
except Exception as exc:
|
|
155
|
+
if as_json:
|
|
156
|
+
print(json.dumps({"status": "error", "error": f"项目代码分析失败: {exc}"}, ensure_ascii=False, indent=2))
|
|
157
|
+
else:
|
|
158
|
+
print(f"[bugx project] ✗ 项目代码分析失败: {exc}")
|
|
159
|
+
return 1
|
|
160
|
+
|
|
161
|
+
elif action == "sync":
|
|
162
|
+
try:
|
|
163
|
+
profile = project_profile.detect_project_profile(root)
|
|
164
|
+
from core.cloud_sync import cloud_client
|
|
165
|
+
client = cloud_client.CloudClient()
|
|
166
|
+
if not client or not client.is_authenticated():
|
|
167
|
+
if as_json:
|
|
168
|
+
print(json.dumps({"status": "unauthenticated", "error": "未登录云端,请先运行 bugx auth login"}, ensure_ascii=False, indent=2))
|
|
169
|
+
return 1
|
|
170
|
+
else:
|
|
171
|
+
# 严禁假性报错阻断!直接跳转登录界面(打开浏览器授权并登记设备)
|
|
172
|
+
print("[bugx project] 当前未登录云端,正在打开浏览器完成登录授权…")
|
|
173
|
+
try:
|
|
174
|
+
login_res = client.login(name="bugx-cli")
|
|
175
|
+
if not getattr(login_res, "ok", False):
|
|
176
|
+
print(f"[bugx project] ✗ 登录未完成: {getattr(login_res, 'error', '未知错误')}")
|
|
177
|
+
return 1
|
|
178
|
+
client.register_device(name="bugx-cli")
|
|
179
|
+
except Exception as exc:
|
|
180
|
+
print(f"[bugx project] ✗ 登录或设备登记失败: {exc}")
|
|
181
|
+
return 1
|
|
182
|
+
|
|
183
|
+
# Project identity is repository state, not a mutable source
|
|
184
|
+
# snapshot. Using ``source_fingerprint`` here created a new
|
|
185
|
+
# cloud project whenever the source tree changed.
|
|
186
|
+
from core.cloud_sync.cloud_onboard import get_account_id, _save_project_binding
|
|
187
|
+
from core.cloud_sync.onboard_wizard import ensure_project_identity
|
|
188
|
+
identity = ensure_project_identity(root, root.name)
|
|
189
|
+
account_id = get_account_id(client)
|
|
190
|
+
bound_account = identity.get("account_id", "")
|
|
191
|
+
if bound_account and bound_account != account_id:
|
|
192
|
+
raise ValueError("本地项目绑定账号与当前云端账号不一致")
|
|
193
|
+
reg = client.register_project(
|
|
194
|
+
slug=identity["slug"], name=root.name,
|
|
195
|
+
project_key=identity["project_key"],
|
|
196
|
+
)
|
|
197
|
+
pid = client.project_id(reg)
|
|
198
|
+
if not pid:
|
|
199
|
+
raise ValueError("云端未能返回有效的 project_id")
|
|
200
|
+
remote_key = client.project_key(reg)
|
|
201
|
+
if remote_key != identity["project_key"]:
|
|
202
|
+
raise ValueError("云端返回 project_key 不一致,拒绝错误绑定")
|
|
203
|
+
_save_project_binding(
|
|
204
|
+
root, pid, identity["slug"], identity["project_key"], account_id,
|
|
205
|
+
)
|
|
206
|
+
# DOC-057 设计项 4:云端只接收紧凑投影,完整 profile 留在本地。
|
|
207
|
+
res = client.put_project_profile(pid, project_profile.wire_project_profile(profile))
|
|
208
|
+
if as_json:
|
|
209
|
+
print(json.dumps({"status": "ok", "project_id": pid, "synced": True, "result": res.data}, ensure_ascii=False, indent=2))
|
|
210
|
+
else:
|
|
211
|
+
print(f"[bugx project] ✓ 已成功同步项目画像至云端 (Project ID: {pid})!")
|
|
212
|
+
return 0
|
|
213
|
+
except Exception as exc:
|
|
214
|
+
if as_json:
|
|
215
|
+
print(json.dumps({"status": "error", "error": f"同步云端失败: {exc}"}, ensure_ascii=False, indent=2))
|
|
216
|
+
else:
|
|
217
|
+
print(f"[bugx project] ✗ 同步云端失败: {exc}")
|
|
218
|
+
return 1
|
|
219
|
+
|
|
220
|
+
elif action in ("list", "refresh"):
|
|
221
|
+
try:
|
|
222
|
+
projects = bugx_paths.sync_global_projects(workspace=root)
|
|
223
|
+
if as_json:
|
|
224
|
+
print(json.dumps({"status": "ok", "total": len(projects), "projects": projects}, ensure_ascii=False, indent=2))
|
|
225
|
+
else:
|
|
226
|
+
title = "已全量刷新并对齐" if action == "refresh" else "当前登记"
|
|
227
|
+
print(f"[bugx project] ✓ {title}全局受管项目列表 (~/.bugx/projects.json),共 {len(projects)} 个项目:")
|
|
228
|
+
print("=" * 72)
|
|
229
|
+
for idx, p in enumerate(projects, 1):
|
|
230
|
+
is_active = (Path(p["working_dir"]).resolve() == root.resolve())
|
|
231
|
+
tag = " [当前工作区]" if is_active else ""
|
|
232
|
+
cloud_tag = f" (云端 ID: {p['cloud_project_id']})" if p.get("cloud_project_id") else ""
|
|
233
|
+
sessions = p.get("session_count", 1)
|
|
234
|
+
print(f" {idx:2d}. {p['name']:<22} {p['working_dir']}{tag}")
|
|
235
|
+
print(f" 会话: {sessions} 轮{cloud_tag} | Hash: {p['hash']}")
|
|
236
|
+
print("=" * 72)
|
|
237
|
+
return 0
|
|
238
|
+
except Exception as exc:
|
|
239
|
+
if as_json:
|
|
240
|
+
print(json.dumps({"status": "error", "error": f"刷新全局项目失败: {exc}"}, ensure_ascii=False, indent=2))
|
|
241
|
+
else:
|
|
242
|
+
print(f"[bugx project] ✗ 刷新全局项目失败: {exc}")
|
|
243
|
+
return 1
|
|
244
|
+
|
|
245
|
+
elif action == "rebind":
|
|
246
|
+
return _rebind_project_identity(root, args, as_json)
|
|
247
|
+
|
|
248
|
+
elif action == "settings":
|
|
249
|
+
try:
|
|
250
|
+
try:
|
|
251
|
+
from core.runtime import project_settings
|
|
252
|
+
except ImportError:
|
|
253
|
+
from core.runtime import project_settings as project_settings
|
|
254
|
+
|
|
255
|
+
target_val = getattr(args, "target", None)
|
|
256
|
+
target_path = root
|
|
257
|
+
if target_val:
|
|
258
|
+
t_cand = Path(target_val).expanduser().resolve()
|
|
259
|
+
if t_cand.is_dir():
|
|
260
|
+
target_path = t_cand
|
|
261
|
+
else:
|
|
262
|
+
by_hash = project_settings.resolve_project_dir_by_hash(target_val)
|
|
263
|
+
if by_hash:
|
|
264
|
+
target_path = by_hash
|
|
265
|
+
else:
|
|
266
|
+
raise ValueError(f"无法定位目标项目路径或 Hash: {target_val}")
|
|
267
|
+
|
|
268
|
+
updates = {}
|
|
269
|
+
if getattr(args, "set_cloud_sync", None):
|
|
270
|
+
updates["cloud_sync_enabled"] = (args.set_cloud_sync == "on")
|
|
271
|
+
if getattr(args, "set_review", None):
|
|
272
|
+
updates["review_mode"] = args.set_review
|
|
273
|
+
if getattr(args, "set_polling", None):
|
|
274
|
+
updates["polling_policy"] = args.set_polling
|
|
275
|
+
if getattr(args, "set_auto_fix", None):
|
|
276
|
+
v = args.set_auto_fix
|
|
277
|
+
updates["fix_mode"] = "auto" if v == "on" else ("confirm" if v == "confirm" else "off")
|
|
278
|
+
if getattr(args, "set_commit", None):
|
|
279
|
+
updates["commit_policy"] = args.set_commit
|
|
280
|
+
|
|
281
|
+
if updates:
|
|
282
|
+
info = project_settings.update_project_settings(target_path, updates)
|
|
283
|
+
updated_flag = True
|
|
284
|
+
else:
|
|
285
|
+
info = project_settings.get_project_settings(target_path)
|
|
286
|
+
updated_flag = False
|
|
287
|
+
|
|
288
|
+
if as_json:
|
|
289
|
+
print(json.dumps({"status": "ok", "settings": info}, ensure_ascii=False, indent=2))
|
|
290
|
+
return 0
|
|
291
|
+
|
|
292
|
+
# 终端高颜值看板渲染
|
|
293
|
+
gates = info["gates"]
|
|
294
|
+
mining = info["mining"]
|
|
295
|
+
mcps = info["mcps"]
|
|
296
|
+
skills = info["skills"]
|
|
297
|
+
|
|
298
|
+
print("=" * 72)
|
|
299
|
+
print(f" BugX 工程门禁配置与全景透视看板: {info['name']}")
|
|
300
|
+
print("=" * 72)
|
|
301
|
+
print(f"项目物理路径: {info['working_dir']}")
|
|
302
|
+
print(f"项目 Hash 码: {info['project_hash']}")
|
|
303
|
+
if updated_flag:
|
|
304
|
+
print("⚡ [提示] 门禁配置已成功更新并原子落盘至 .bugx/config.json!")
|
|
305
|
+
print()
|
|
306
|
+
|
|
307
|
+
print("【1. 五大核心自愈与安全门禁 (Gates & Safeguards)】")
|
|
308
|
+
cloud_str = f"🟢 开启 (绑定 Project ID: {gates['cloud_project_id']})" if gates["cloud_sync_enabled"] else "⚪ 未开启 (纯本地模式)"
|
|
309
|
+
review_str = "🟢 全自动深入审查 (auto)" if gates["review_mode"] == "auto" else (
|
|
310
|
+
"🟡 交互式逐步确认 (interactive)" if gates["review_mode"] == "interactive" else "🔴 关闭审查 (off)"
|
|
311
|
+
)
|
|
312
|
+
polling_str = "🟢 持续自治轮询 (auto)" if gates["polling_policy"] == "auto" else (
|
|
313
|
+
"🟡 单轮手动触发 (manual)" if gates["polling_policy"] == "manual" else "🔴 关闭轮询 (off)"
|
|
314
|
+
)
|
|
315
|
+
auto_fix_str = "🟢 开启 (发现漏洞自动合入补丁)" if gates["auto_fix_code"] else (
|
|
316
|
+
"🟡 需确认 (生成补丁待用户批准)" if gates["fix_mode"] == "confirm" else "🔴 关闭 (仅报告不出补丁)"
|
|
317
|
+
)
|
|
318
|
+
commit_str = "🟢 每轮自动提交 (round)" if gates["commit_policy"] == "round" else (
|
|
319
|
+
"🟡 按任务提交 (task)" if gates["commit_policy"] == "task" else "🔴 关闭自动提交 (off)"
|
|
320
|
+
)
|
|
321
|
+
print(f" 1. 云端同步门禁 : {cloud_str}")
|
|
322
|
+
print(f" 2. 审查方式门禁 : {review_str}")
|
|
323
|
+
print(f" 3. 轮询策略门禁 : {polling_str}")
|
|
324
|
+
print(f" 4. 修复模式门禁 : {auto_fix_str}")
|
|
325
|
+
print(f" 5. 提交策略门禁 : {commit_str}")
|
|
326
|
+
print(f" * 修复前物理备份: {'✓ 强制开启 (带外沙箱镜像)' if gates['backup_before_fix'] else '✗ 已关闭'}")
|
|
327
|
+
print()
|
|
328
|
+
|
|
329
|
+
# 1.5 项目定位与体量属性画像
|
|
330
|
+
prof = info.get("profile", {})
|
|
331
|
+
pos = prof.get("positioning", {})
|
|
332
|
+
met = prof.get("metrics", {})
|
|
333
|
+
econ = prof.get("engineering_economics", {})
|
|
334
|
+
qnr = prof.get("quality_and_risk", {})
|
|
335
|
+
print("【1.5 项目定位与体量属性画像 (Positioning & Attributes Profile)】")
|
|
336
|
+
forms_str = ", ".join(f.upper() for f in pos.get("forms", [])) or "通用工程"
|
|
337
|
+
print(f" - 工程定位形态 : [{forms_str}] | 规模级别: {pos.get('scale_level', 'medium').upper()} | 主语言: {pos.get('primary_language', 'unknown').capitalize()}")
|
|
338
|
+
print(f" - 代码规模净量 : 有效代码 {met.get('code_lines', 0):,} 行 (SLOC) | 总行数 {met.get('total_lines', 0):,} 行 | 文件数 {met.get('total_files', 0):,} 个 | 单测比 {met.get('test_to_code_ratio', 0.0) * 100:.1f}%")
|
|
339
|
+
print(f" - 软件工程经济 : 预估研发 {econ.get('effort_person_months', 0.0)} 人月 (周期: {econ.get('estimated_schedule_months', 0.0)} 个月) | 技术债务: {econ.get('tech_debt_days', 0.0)} 天 ({econ.get('tech_debt_ratio_pct', 0.0)}%)")
|
|
340
|
+
print(f" - 质量与脆弱性 : 评级 Grade {qnr.get('health_grade', 'B')} | 可维护性 {qnr.get('maintainability_index', 0.0)}/100 | 敏感沉入点: {qnr.get('sensitive_sinks', 0)} 处 | 污染流: {qnr.get('taint_flows', 0)} 条 | 秘密残留: {qnr.get('hardcoded_secrets', 0)} 处")
|
|
341
|
+
print()
|
|
342
|
+
|
|
343
|
+
print("【2. 挖掘策略、进度与轮次全景 (Mining Strategy, Progress & Rounds)】")
|
|
344
|
+
cur_p = mining.get("current_polling_id")
|
|
345
|
+
cur_p_no = mining.get("current_polling_no", 1)
|
|
346
|
+
prog = mining.get("progress", {})
|
|
347
|
+
strat = mining.get("strategy", {})
|
|
348
|
+
print(f" - 挖掘轮次状态 : 当前活跃轮次 {cur_p or '尚未启动'} (第 {cur_p_no} 轮) | 累计完成 {mining.get('total_rounds', 0)} 轮")
|
|
349
|
+
print(f" - 挖掘执行进度 : [{prog.get('status', 'IDLE').upper()}] {prog.get('current_phase', '就绪')}")
|
|
350
|
+
cov_tot = prog.get('coverage_total', 0)
|
|
351
|
+
cov_cov = prog.get('coverage_covered', 0)
|
|
352
|
+
cov_pct = prog.get('coverage_pct', 0.0)
|
|
353
|
+
print(f" - 单元覆盖进度 : {cov_cov} / {cov_tot} ({cov_pct}%) | 耗时: {prog.get('elapsed_display', '0s')}")
|
|
354
|
+
langs = ", ".join(strat.get("languages", []))
|
|
355
|
+
surfs = ", ".join(strat.get("surfaces", []))
|
|
356
|
+
print(f" - 靶向攻防策略 : 语言: [{langs}] | 暴露面: [{surfs}]")
|
|
357
|
+
print(f" - 调度建议基线 : 评级 Grade {strat.get('health_grade', 'B')} | 推荐 {strat.get('recommended_concurrency', 4)} 并发 / {strat.get('recommended_rounds', 5)} 轮次")
|
|
358
|
+
findings = mining.get("findings", {})
|
|
359
|
+
print(f" - 累计发现漏洞 : 共 {findings.get('total', 0)} 个 (严重: {findings.get('critical', 0)}, 高危: {findings.get('high', 0)}, 中危: {findings.get('medium', 0)}, 低危: {findings.get('low', 0)})")
|
|
360
|
+
print(f" - 积累防御经验 : {mining.get('lessons_learned', 0)} 条 (错题集知识库)")
|
|
361
|
+
rounds_list = mining.get("rounds_history", [])
|
|
362
|
+
if rounds_list:
|
|
363
|
+
print(" - 历史各轮流水 :")
|
|
364
|
+
for r in rounds_list[:4]:
|
|
365
|
+
print(f" * #{r['polling_no']:<2} {r['polling_id']:<16} [{r['state'].upper():<9}] 耗时 {r['elapsed_display']:<7} | 漏洞: {r['findings_count']} 个 | {r['created_at']}")
|
|
366
|
+
print()
|
|
367
|
+
|
|
368
|
+
print(f"【3. 挂载的 MCP 服务器与工具 ({mcps['total_servers']} 个服务, 共 {mcps['total_tools']} 个工具)】")
|
|
369
|
+
for s in mcps["servers"]:
|
|
370
|
+
src = f" [来源: {s.get('source')}]" if s.get("source") else ""
|
|
371
|
+
print(f" - {s['name']:<22} {s.get('tools', 0):>2} 工具 | 状态: {s.get('status', 'connected')}{src}")
|
|
372
|
+
if s.get("command"):
|
|
373
|
+
print(f" 命令: {s['command']}")
|
|
374
|
+
print()
|
|
375
|
+
|
|
376
|
+
print(f"【4. 可用与激活的 Skill 技能集 ({skills['total_skills']} 个技能)】")
|
|
377
|
+
for sk in skills["skills"]:
|
|
378
|
+
tag = f"[{sk.get('type', 'core').upper()}]"
|
|
379
|
+
print(f" - {sk['command']:<10} {tag:<8} {sk.get('description', '')}")
|
|
380
|
+
print("=" * 72)
|
|
381
|
+
return 0
|
|
382
|
+
except Exception as exc:
|
|
383
|
+
if as_json:
|
|
384
|
+
print(json.dumps({"status": "error", "error": f"获取项目配置失败: {exc}"}, ensure_ascii=False, indent=2))
|
|
385
|
+
else:
|
|
386
|
+
print(f"[bugx project settings] ✗ 获取项目配置失败: {exc}")
|
|
387
|
+
return 1
|
|
388
|
+
|
|
389
|
+
else:
|
|
390
|
+
print(f"[bugx project] 未知子操作: {action}", file=sys.stderr)
|
|
391
|
+
return 1
|
|
392
|
+
|
|
393
|
+
if as_json:
|
|
394
|
+
payload = {
|
|
395
|
+
"status": "ok",
|
|
396
|
+
"root": str(root),
|
|
397
|
+
"profile": profile,
|
|
398
|
+
}
|
|
399
|
+
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
|
400
|
+
return 0
|
|
401
|
+
|
|
402
|
+
# 终端看板渲染
|
|
403
|
+
metrics = profile.get("code_metrics", {})
|
|
404
|
+
scale = profile.get("scale_estimation", {})
|
|
405
|
+
languages = profile.get("code_languages", [])
|
|
406
|
+
modules = profile.get("code_modules", [])
|
|
407
|
+
forms = profile.get("forms", [])
|
|
408
|
+
|
|
409
|
+
print("=" * 72)
|
|
410
|
+
print(" BugX 工程体量与技术栈代码分析看板")
|
|
411
|
+
print("=" * 72)
|
|
412
|
+
print(f"工程路径: {root}")
|
|
413
|
+
print(f"工程形态: {', '.join(forms) if forms else '通用代码库'}")
|
|
414
|
+
print(f"主编程语言: {scale.get('primary_language', 'unknown').capitalize()}")
|
|
415
|
+
print()
|
|
416
|
+
|
|
417
|
+
print("【代码规模指标】")
|
|
418
|
+
tot_files = metrics.get("total_files", 0)
|
|
419
|
+
tot_lines = metrics.get("total_lines", 0)
|
|
420
|
+
sloc = metrics.get("code_lines", 0)
|
|
421
|
+
doc_config = metrics.get("doc_and_config_lines", 0)
|
|
422
|
+
com = metrics.get("comment_lines", 0)
|
|
423
|
+
doc = metrics.get("docstring_lines", 0)
|
|
424
|
+
blk = metrics.get("blank_lines", 0)
|
|
425
|
+
print(f" - 源码文件总数: {tot_files:,} 个")
|
|
426
|
+
print(f" - 物理总行数 : {tot_lines:,} 行")
|
|
427
|
+
print(f" - 有效代码行数: {sloc:,} 行 (SLOC, 编程语言净代码)")
|
|
428
|
+
if doc_config > 0:
|
|
429
|
+
print(f" - 文档与配置 : {doc_config:,} 行 (Markdown, JSON, YAML 等)")
|
|
430
|
+
print(f" - 注释与文档 : {com + doc:,} 行 (注释: {com:,}, Docstring: {doc:,})")
|
|
431
|
+
print(f" - 空白行数 : {blk:,} 行")
|
|
432
|
+
print()
|
|
433
|
+
|
|
434
|
+
print("【质量与自动化测试基线】")
|
|
435
|
+
prod_sloc = metrics.get("production_code_lines", 0)
|
|
436
|
+
test_sloc = metrics.get("test_code_lines", 0)
|
|
437
|
+
prod_files = metrics.get("production_files", 0)
|
|
438
|
+
test_files = metrics.get("test_files", 0)
|
|
439
|
+
ratio = metrics.get("test_to_code_ratio", 0.0)
|
|
440
|
+
print(f" - 生产代码体量: {prod_sloc:,} 行 ({prod_files:,} 个文件)")
|
|
441
|
+
print(f" - 自动化测试 : {test_sloc:,} 行 ({test_files:,} 个测试文件)")
|
|
442
|
+
print(f" - 测试/生产比 : {ratio:.1%} (Test-to-Code Ratio)")
|
|
443
|
+
if ratio < 0.15:
|
|
444
|
+
print(" - 质量预警 : ⚠️ 自动化测试代码占比较低 (<15%),建议补充回归用例")
|
|
445
|
+
elif ratio >= 0.5:
|
|
446
|
+
print(" - 质量评级 : 🟢 自动化测试完备度极高 (≥50%),具备扎实的回归与变异基准")
|
|
447
|
+
else:
|
|
448
|
+
print(" - 质量评级 : 🔵 自动化测试覆盖基线良好")
|
|
449
|
+
print()
|
|
450
|
+
|
|
451
|
+
econ = profile.get("engineering_economics", {})
|
|
452
|
+
if econ:
|
|
453
|
+
effort = econ.get("effort_person_months", 0.0)
|
|
454
|
+
sched = econ.get("estimated_schedule_months", 0.0)
|
|
455
|
+
debt = econ.get("tech_debt_days", 0.0)
|
|
456
|
+
debt_pct = econ.get("tech_debt_ratio_pct", 0.0)
|
|
457
|
+
print("【软件工程经济学估算 (COCOMO II 基线)】")
|
|
458
|
+
print(f" - 基准研发工作量: ~{effort:.1f} 人月 (Person-Months)")
|
|
459
|
+
print(f" - 理论开发周期 : ~{sched:.1f} 个月 (标准团队规模基线)")
|
|
460
|
+
print(f" - 技术债务存量 : ~{debt:.1f} 人天 (待治理技术债工时估算)")
|
|
461
|
+
print(f" - 技术债务比率 : ~{debt_pct:.1f}% (Debt Ratio)")
|
|
462
|
+
print()
|
|
463
|
+
|
|
464
|
+
maint = profile.get("maintainability", {})
|
|
465
|
+
dup = profile.get("duplication", {})
|
|
466
|
+
if maint:
|
|
467
|
+
mi = maint.get("maintainability_index", 100.0)
|
|
468
|
+
mi_grade = maint.get("maintainability_grade", "🟢 良好")
|
|
469
|
+
avg_cog = maint.get("avg_cognitive_complexity", 0.0)
|
|
470
|
+
max_cog = maint.get("max_cognitive_complexity", 0)
|
|
471
|
+
dup_pct = dup.get("duplication_percentage", 0.0)
|
|
472
|
+
dup_lines = dup.get("duplicated_lines", 0)
|
|
473
|
+
|
|
474
|
+
print("【代码可维护性与认知负荷】")
|
|
475
|
+
print(f" - 可维护性指数 : {mi:.1f} / 100 ({mi_grade})")
|
|
476
|
+
print(f" - 认知复杂度基准: 平均 {avg_cog:.1f} (单文件峰值: {max_cog})")
|
|
477
|
+
print(f" - 代码克隆重复率: {dup_pct:.1f}% ({dup_lines:,} 行重复代码)")
|
|
478
|
+
print()
|
|
479
|
+
|
|
480
|
+
topo = profile.get("architecture_topology", {})
|
|
481
|
+
if topo:
|
|
482
|
+
tot_cycles = topo.get("total_cycles", 0)
|
|
483
|
+
cycles = topo.get("cycles", [])
|
|
484
|
+
unstable = topo.get("unstable_modules", [])
|
|
485
|
+
|
|
486
|
+
print("【架构拓扑与耦合稳定性】")
|
|
487
|
+
if tot_cycles > 0:
|
|
488
|
+
print(f" - 模块循环依赖环: ⚠️ 探测到 {tot_cycles} 个循环依赖链条")
|
|
489
|
+
for c in cycles[:2]:
|
|
490
|
+
chain_str = " ⇄ ".join(c[:3])
|
|
491
|
+
print(f" • {chain_str}")
|
|
492
|
+
else:
|
|
493
|
+
print(" - 模块循环依赖环: 🟢 0 处循环导入 (拓扑结构无环健康)")
|
|
494
|
+
|
|
495
|
+
if unstable:
|
|
496
|
+
top_u = unstable[0]
|
|
497
|
+
print(f" - 架构不稳定靶点: {top_u['file']} (不稳定度: {top_u['instability']}, Fan-out: {top_u['fan_out']})")
|
|
498
|
+
print()
|
|
499
|
+
|
|
500
|
+
risk = profile.get("risk_metrics", {})
|
|
501
|
+
if risk:
|
|
502
|
+
health_grade = risk.get("health_grade", "N/A")
|
|
503
|
+
grade_icons = {"A": "🟢 A (优秀)", "B": "🔵 B (良好)", "C": "🟡 C (关注)", "D": "🔴 D (高危)"}
|
|
504
|
+
grade_desc = grade_icons.get(health_grade, health_grade)
|
|
505
|
+
avg_cc = risk.get("avg_cyclomatic_complexity", 0.0)
|
|
506
|
+
max_cc = risk.get("max_cyclomatic_complexity", 0)
|
|
507
|
+
funcs = risk.get("total_functions", 0)
|
|
508
|
+
classes = risk.get("total_classes", 0)
|
|
509
|
+
god_mods = risk.get("god_modules_count", 0)
|
|
510
|
+
god_funcs = risk.get("god_functions_count", 0)
|
|
511
|
+
sinks = risk.get("total_sensitive_sinks", 0)
|
|
512
|
+
taints = risk.get("total_taint_flows", 0)
|
|
513
|
+
secrets = risk.get("total_hardcoded_secrets", 0)
|
|
514
|
+
hotspots = risk.get("top_risk_hotspots", [])
|
|
515
|
+
|
|
516
|
+
print("【代码复杂度与内在风险画像】")
|
|
517
|
+
print(f" - 代码健康评级 : {grade_desc}")
|
|
518
|
+
print(f" - 圈复杂度基准 : 平均 {avg_cc:.1f} (单文件峰值: {max_cc})")
|
|
519
|
+
print(f" - 代码结构要素 : {funcs:,} 个函数/方法, {classes:,} 个类结构")
|
|
520
|
+
print(f" - 架构异味探测 : {god_mods} 个巨石模块 (God Module), {god_funcs} 个神仙函数 (God Function)")
|
|
521
|
+
print(f" - 敏感高危槽位 : {sinks} 处潜在敏感调用 (命令执行/代码解析/反序列化/动态SQL等)")
|
|
522
|
+
if taints > 0:
|
|
523
|
+
print(f" - 关键污点流向 : ⚠️ {taints} 条入参直通敏感 Sink 路径 (Taint Flow)")
|
|
524
|
+
if secrets > 0:
|
|
525
|
+
print(f" - 硬编码机密泄露: ⚠️ {secrets} 处高熵敏感密钥 (Shannon Entropy)")
|
|
526
|
+
print()
|
|
527
|
+
|
|
528
|
+
if hotspots:
|
|
529
|
+
print("【TOP 风险热点关注 (前 5 个高危靶点)】")
|
|
530
|
+
for h in hotspots[:5]:
|
|
531
|
+
file_rel = h.get("file", "")
|
|
532
|
+
if len(file_rel) > 34:
|
|
533
|
+
file_rel = "..." + file_rel[-31:]
|
|
534
|
+
r_score = h.get("risk_score", 0)
|
|
535
|
+
cc = h.get("cyclomatic_complexity", 0)
|
|
536
|
+
cog = h.get("cognitive_complexity", 0)
|
|
537
|
+
s_count = h.get("sensitive_sinks", 0)
|
|
538
|
+
tags = " ".join(h.get("tags", []))
|
|
539
|
+
print(f" • {file_rel:<34} 风险分: {r_score:>2} | CC:{cc:>2} | Cog:{cog:>2} | Sinks:{s_count:>2} {tags}")
|
|
540
|
+
print()
|
|
541
|
+
|
|
542
|
+
print("【工程体量与审计估模推荐】")
|
|
543
|
+
level = scale.get("scale_level", "unknown").upper()
|
|
544
|
+
conc = scale.get("recommended_concurrency", 1)
|
|
545
|
+
rounds = scale.get("recommended_rounds", 1)
|
|
546
|
+
budget = scale.get("recommended_token_budget", 50000)
|
|
547
|
+
print(f" - 工程规模分级: [{level}] 规模项目")
|
|
548
|
+
print(f" - 建议并发度 : {conc} Workers 并发执行")
|
|
549
|
+
print(f" - 建议审计轮次: {rounds} 轮 (建议 Token 预算: ~{budget:,} Tokens)")
|
|
550
|
+
print()
|
|
551
|
+
|
|
552
|
+
code_langs = [l for l in languages if l.get("is_code", True)]
|
|
553
|
+
non_code_langs = [l for l in languages if not l.get("is_code", True)]
|
|
554
|
+
|
|
555
|
+
if code_langs:
|
|
556
|
+
print("【主要编程语言分布】")
|
|
557
|
+
for l in code_langs[:6]:
|
|
558
|
+
lang_name = l["language"].capitalize()
|
|
559
|
+
l_code = l["code_lines"]
|
|
560
|
+
pct = l["percentage"]
|
|
561
|
+
bar = _render_bar(pct, width=18)
|
|
562
|
+
print(f" {lang_name:<14} {bar} {pct:>5.1f}% ({l_code:>6,} SLOC, {l['files']} 文件)")
|
|
563
|
+
print()
|
|
564
|
+
|
|
565
|
+
if non_code_langs:
|
|
566
|
+
print("【文档与配置资源分布】")
|
|
567
|
+
for l in non_code_langs[:4]:
|
|
568
|
+
lang_name = l["language"].capitalize()
|
|
569
|
+
l_code = l["code_lines"]
|
|
570
|
+
pct = l["percentage"]
|
|
571
|
+
bar = _render_bar(pct, width=18)
|
|
572
|
+
print(f" {lang_name:<14} {bar} {pct:>5.1f}% ({l_code:>6,} 行, {l['files']} 文件)")
|
|
573
|
+
print()
|
|
574
|
+
|
|
575
|
+
if modules:
|
|
576
|
+
print("【核心模块/目录分布】")
|
|
577
|
+
for m in modules[:8]:
|
|
578
|
+
m_name = m["module"]
|
|
579
|
+
if len(m_name) > 16:
|
|
580
|
+
m_name = m_name[:13] + "..."
|
|
581
|
+
m_code = m["code_lines"]
|
|
582
|
+
pct = m["percentage"]
|
|
583
|
+
bar = _render_bar(pct, width=14)
|
|
584
|
+
print(f" {m_name:<16} {bar} {pct:>5.1f}% ({m_code:>6,} SLOC)")
|
|
585
|
+
print()
|
|
586
|
+
|
|
587
|
+
print("=" * 72)
|
|
588
|
+
print("提示:执行 'bugx cloud sync' 可将此项目画像与代码指标同步至云端看板。")
|
|
589
|
+
return 0
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
def _parse_line_range(raw: str | None) -> tuple[int, int | None]:
|
|
593
|
+
"""解析 42:90、42-90 或 42 格式的行范围字符串。"""
|
|
594
|
+
if not raw:
|
|
595
|
+
return 1, 200
|
|
596
|
+
cleaned = raw.strip()
|
|
597
|
+
if ":" in cleaned:
|
|
598
|
+
parts = cleaned.split(":", 1)
|
|
599
|
+
elif "-" in cleaned and not cleaned.startswith("-"):
|
|
600
|
+
parts = cleaned.split("-", 1)
|
|
601
|
+
else:
|
|
602
|
+
try:
|
|
603
|
+
val = int(cleaned)
|
|
604
|
+
return val, val
|
|
605
|
+
except ValueError:
|
|
606
|
+
return 1, 200
|
|
607
|
+
|
|
608
|
+
try:
|
|
609
|
+
start = int(parts[0].strip()) if parts[0].strip() else 1
|
|
610
|
+
except ValueError:
|
|
611
|
+
start = 1
|
|
612
|
+
try:
|
|
613
|
+
end = int(parts[1].strip()) if parts[1].strip() else None
|
|
614
|
+
except ValueError:
|
|
615
|
+
end = None
|
|
616
|
+
return start, end
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
def command_view(args: argparse.Namespace) -> int:
|
|
620
|
+
"""bugx view:安全查看源文件切片与视窗(具越界自愈与沙箱隔离)。"""
|
|
621
|
+
path_str = getattr(args, "path", "")
|
|
622
|
+
lines_arg = getattr(args, "lines", "1:200")
|
|
623
|
+
numbered = not bool(getattr(args, "no_numbers", False))
|
|
624
|
+
as_json = bool(getattr(args, "json", False))
|
|
625
|
+
max_lines = int(getattr(args, "max_lines", 500) or 500)
|
|
626
|
+
root = getattr(args, "root", None)
|
|
627
|
+
|
|
628
|
+
try:
|
|
629
|
+
_ensure_core_importable()
|
|
630
|
+
from core.planning import source_inspector
|
|
631
|
+
except Exception as exc:
|
|
632
|
+
if as_json:
|
|
633
|
+
print(json.dumps({"status": "error", "error": f"无法加载核心查看引擎: {exc}"}, ensure_ascii=False, indent=2))
|
|
634
|
+
else:
|
|
635
|
+
print(f"[bugx view] ✗ 无法加载核心查看引擎: {exc}", file=sys.stderr)
|
|
636
|
+
return 1
|
|
637
|
+
|
|
638
|
+
start_line, end_line = _parse_line_range(lines_arg)
|
|
639
|
+
|
|
640
|
+
try:
|
|
641
|
+
result = source_inspector.inspect_source(
|
|
642
|
+
path=path_str,
|
|
643
|
+
start_line=start_line,
|
|
644
|
+
end_line=end_line,
|
|
645
|
+
numbered=numbered,
|
|
646
|
+
max_lines=max_lines,
|
|
647
|
+
root=root,
|
|
648
|
+
)
|
|
649
|
+
except Exception as exc:
|
|
650
|
+
if as_json:
|
|
651
|
+
print(json.dumps({"status": "error", "error": str(exc)}, ensure_ascii=False, indent=2))
|
|
652
|
+
else:
|
|
653
|
+
print(f"[bugx view] ✗ {exc}", file=sys.stderr)
|
|
654
|
+
return 1
|
|
655
|
+
|
|
656
|
+
if as_json:
|
|
657
|
+
payload = {"status": "ok", **result.to_dict()}
|
|
658
|
+
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
|
659
|
+
else:
|
|
660
|
+
if result.warning:
|
|
661
|
+
print(f"[bugx view] 提示: {result.warning}", file=sys.stderr)
|
|
662
|
+
if result.content:
|
|
663
|
+
print(result.content)
|
|
664
|
+
elif result.total_lines > 0:
|
|
665
|
+
print(f"[bugx view] (所请求范围 {start_line}:{end_line} 无内容,文件总行数: {result.total_lines})")
|
|
666
|
+
else:
|
|
667
|
+
print("[bugx view] (文件为空)")
|
|
668
|
+
|
|
669
|
+
return 0
|
|
670
|
+
|