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,715 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""module_coverage.py — 最小审计单元与跨模块业务链路覆盖门禁。
|
|
3
|
+
|
|
4
|
+
这是「全覆盖宪法」的外部检查器,不相信 agent 口头报告:
|
|
5
|
+
discover 递归发现每个源码文件,生成最小单元清单骨架
|
|
6
|
+
check 校验最小单元、业务链路、阶段顺序、工具与证据
|
|
7
|
+
final-check 要求内部最小单元和跨模块业务链路全部「已覆盖」
|
|
8
|
+
|
|
9
|
+
机械可验证的最小下限是源码文件;一个文件含多个可独立验证的函数、类、路由、
|
|
10
|
+
命令或状态机时,用 ``path/to/file.py::symbol`` 继续拆分。必须先把全部「内部」
|
|
11
|
+
最小单元标为已覆盖,才能开始「业务」阶段的模块间数据流/状态流审计。
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
# DES-07 二期拆分:命令行入口簇(check / final-check / main /
|
|
15
|
+
# suggest_hits / status / ingest_test_coverage_report / _apply_auto_backfill /
|
|
16
|
+
# _row_from_line)下沉为本模块;模块 docstring 即拆分前原文——argparse 以
|
|
17
|
+
# ``description=__doc__`` 生成 ``--help``,任何改写都会改变 CLI 输出。
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
# --- 引擎导入根(直接执行脚本时自举 core.* 命名空间)---
|
|
21
|
+
import sys as _sys
|
|
22
|
+
from pathlib import Path as _Path
|
|
23
|
+
|
|
24
|
+
for _p in _Path(__file__).resolve().parents:
|
|
25
|
+
if (_p / "core" / "bugx.md").is_file():
|
|
26
|
+
if str(_p) not in _sys.path:
|
|
27
|
+
_sys.path.insert(0, str(_p))
|
|
28
|
+
break
|
|
29
|
+
del _p
|
|
30
|
+
|
|
31
|
+
import argparse
|
|
32
|
+
import json
|
|
33
|
+
import os
|
|
34
|
+
import sys
|
|
35
|
+
from dataclasses import replace
|
|
36
|
+
from pathlib import Path
|
|
37
|
+
from typing import Any
|
|
38
|
+
|
|
39
|
+
if str(Path(__file__).resolve().parent.parent) not in sys.path:
|
|
40
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
|
41
|
+
if str(Path(__file__).resolve().parent.parent.parent) not in sys.path:
|
|
42
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent))
|
|
43
|
+
|
|
44
|
+
import core.secure_atomic as secure_atomic
|
|
45
|
+
from core.retrieval import symbol_index
|
|
46
|
+
|
|
47
|
+
from core.coverage.coverage_backfill import auto_backfill_rows
|
|
48
|
+
from core.coverage.coverage_business import business_discovery, business_discovery_rows, coverage_summary
|
|
49
|
+
from core.coverage.coverage_discovery import participant_ids, row_text, coverage_unit_id, discovery_rows
|
|
50
|
+
from core.coverage.coverage_gate import (
|
|
51
|
+
PROJECT_GRAPH_MARKER,
|
|
52
|
+
SYMBOL_INDEX_MARKER,
|
|
53
|
+
manifest_discovery_mode,
|
|
54
|
+
manifest_gate_errors,
|
|
55
|
+
reconcile_discovery_rows,
|
|
56
|
+
status_manifest_errors,
|
|
57
|
+
)
|
|
58
|
+
from core.coverage.coverage_manifest import (
|
|
59
|
+
MANIFEST,
|
|
60
|
+
REPO_ROOT,
|
|
61
|
+
ModuleRow,
|
|
62
|
+
default_manifest_for_root,
|
|
63
|
+
parse_cells,
|
|
64
|
+
parse_manifest,
|
|
65
|
+
)
|
|
66
|
+
from core.coverage.coverage_platform import AUTO_OWNER, missing_plan_field
|
|
67
|
+
from core.coverage.coverage_validate import validate_rows
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def apply_auto_backfill(
|
|
71
|
+
manifest: Path,
|
|
72
|
+
rows: list[ModuleRow],
|
|
73
|
+
root: Path,
|
|
74
|
+
*,
|
|
75
|
+
evidence_manifest: Path | None = None,
|
|
76
|
+
) -> dict[str, int]:
|
|
77
|
+
"""对齐符号集、回填计划字段并补齐业务链路行,返回变更统计。
|
|
78
|
+
|
|
79
|
+
auto 模式的完整顺序:
|
|
80
|
+
1. reconcile:枚举器升级导致符号集漂移时,按字节哈希对齐内部单元
|
|
81
|
+
(编号稳定、未变字节的证据保留),不伪造覆盖;
|
|
82
|
+
2. 回填缺失的计划字段(主工具/负责人/证据指针,全部指向真实文件);
|
|
83
|
+
3. 若清单没有业务链路行,从自动关系图生成并同样回填。
|
|
84
|
+
"""
|
|
85
|
+
stats = {"tool": 0, "owner": 0, "evidence": 0, "business": 0, "changed": 0}
|
|
86
|
+
lines = manifest.read_text(encoding="utf-8").splitlines()
|
|
87
|
+
|
|
88
|
+
reconciled_lines, changes = reconcile_discovery_rows(
|
|
89
|
+
rows, root,
|
|
90
|
+
symbols=manifest_discovery_mode(manifest) not in {"files", "files-only"},
|
|
91
|
+
)
|
|
92
|
+
reconciled_rows = [row_from_line(line) for line in reconciled_lines]
|
|
93
|
+
# L1-ADV-D4:reconcile 确实会把内容变化的单元重置为「未覆盖」,post 需要机读
|
|
94
|
+
# 真相才能把失效单元交回 Supervisor 重新派发。把同一份 changes 落盘为
|
|
95
|
+
# ``inventory-diff.json``(与 bootstrap 同 schema、原子写),让"校验"不再
|
|
96
|
+
# 偷偷改覆盖状态却对外宣称没改。
|
|
97
|
+
invalidated = [
|
|
98
|
+
str(scope) for scope in (changes or {}).get("changed") or ()
|
|
99
|
+
]
|
|
100
|
+
if changes:
|
|
101
|
+
write_inventory_diff(manifest, changes)
|
|
102
|
+
|
|
103
|
+
todo_path = manifest.parent / "audit-todo.md"
|
|
104
|
+
todo_reference = ""
|
|
105
|
+
if todo_path.is_file():
|
|
106
|
+
todo_reference = Path(os.path.relpath(todo_path, root)).as_posix()
|
|
107
|
+
covered: dict[str, str] = {}
|
|
108
|
+
if evidence_manifest is not None and evidence_manifest.is_file():
|
|
109
|
+
try:
|
|
110
|
+
payload = json.loads(evidence_manifest.read_text(encoding="utf-8"))
|
|
111
|
+
for record in payload.get("records") or []:
|
|
112
|
+
unit_id = str(record.get("unit_id") or "")
|
|
113
|
+
artifact = str(record.get("artifact_path") or "")
|
|
114
|
+
if unit_id and artifact:
|
|
115
|
+
covered[unit_id] = artifact
|
|
116
|
+
except (OSError, ValueError):
|
|
117
|
+
pass
|
|
118
|
+
filled_rows, fill_stats = auto_backfill_rows(
|
|
119
|
+
reconciled_rows, root,
|
|
120
|
+
todo_reference=todo_reference, covered_evidence=covered,
|
|
121
|
+
)
|
|
122
|
+
stats["tool"] += fill_stats["tool"]
|
|
123
|
+
stats["owner"] += fill_stats["owner"]
|
|
124
|
+
stats["evidence"] += fill_stats["evidence"]
|
|
125
|
+
|
|
126
|
+
has_business = any(row.phase == "业务" for row in filled_rows)
|
|
127
|
+
business_lines: list[str] = []
|
|
128
|
+
if not has_business:
|
|
129
|
+
seen_participants: set[tuple[str, ...]] = set()
|
|
130
|
+
for line in business_discovery_rows(root, filled_rows):
|
|
131
|
+
if "UNRESOLVED" in line:
|
|
132
|
+
continue
|
|
133
|
+
cells = parse_cells(line)
|
|
134
|
+
if len(cells) < 16:
|
|
135
|
+
continue
|
|
136
|
+
participants = tuple(participant_ids(cells[5]))
|
|
137
|
+
if len(participants) < 2 or participants in seen_participants:
|
|
138
|
+
continue
|
|
139
|
+
seen_participants.add(participants)
|
|
140
|
+
if "待补" in line and todo_reference:
|
|
141
|
+
line = line.replace("待补", todo_reference)
|
|
142
|
+
row = row_from_line(line)
|
|
143
|
+
fill: dict[str, str] = {}
|
|
144
|
+
if missing_plan_field(row.owner):
|
|
145
|
+
fill["owner"] = AUTO_OWNER
|
|
146
|
+
if missing_plan_field(row.tool):
|
|
147
|
+
fill["tool"] = "business-flow-review"
|
|
148
|
+
if missing_plan_field(row.evidence) and todo_reference:
|
|
149
|
+
fill["evidence"] = todo_reference
|
|
150
|
+
if fill:
|
|
151
|
+
row = replace(row, **fill)
|
|
152
|
+
business_lines.append(row_text(row))
|
|
153
|
+
stats["business"] = len(business_lines)
|
|
154
|
+
|
|
155
|
+
header_index = next(
|
|
156
|
+
(i for i, line in enumerate(lines) if "路径/范围" in line and "状态" in line),
|
|
157
|
+
None,
|
|
158
|
+
)
|
|
159
|
+
if header_index is not None:
|
|
160
|
+
separator_index = next(
|
|
161
|
+
(i for i in range(header_index + 1, len(lines)) if "---" in lines[i]),
|
|
162
|
+
header_index + 1,
|
|
163
|
+
)
|
|
164
|
+
data_start = separator_index + 1
|
|
165
|
+
data_end = data_start
|
|
166
|
+
# 表体可能由**多个以空行分隔的连续表行块**组成:coverage bootstrap 会把
|
|
167
|
+
# 自动业务链路/端点行写成紧跟空行之后的独立块。若只替换第一个块,
|
|
168
|
+
# 而 filled_rows 已包含从后续块解析出的业务行,就会把同一批业务行
|
|
169
|
+
# 写进第一个块、同时保留原块 ⇒ 业务行翻倍(实测 64 → 128),
|
|
170
|
+
# 进而触发「清单 # 标识不能为空且不能重复」+「覆盖证据 duplicate」,
|
|
171
|
+
# 使自动续轮永久失败。这里把所有相邻(允许空行分隔)的表行块
|
|
172
|
+
# 一并纳入替换区间,保证 check 幂等。
|
|
173
|
+
while data_end < len(lines):
|
|
174
|
+
if lines[data_end].lstrip().startswith("|"):
|
|
175
|
+
data_end += 1
|
|
176
|
+
continue
|
|
177
|
+
if (lines[data_end].strip() == ""
|
|
178
|
+
and data_end + 1 < len(lines)
|
|
179
|
+
and lines[data_end + 1].lstrip().startswith("|")):
|
|
180
|
+
data_end += 1
|
|
181
|
+
continue
|
|
182
|
+
break
|
|
183
|
+
lines[data_start:data_end] = (
|
|
184
|
+
[row_text(row) for row in filled_rows] + business_lines
|
|
185
|
+
)
|
|
186
|
+
# 原子写:非原子 write_text 会让并发读者读到截断的清单,
|
|
187
|
+
# ``_manifest_units_blob`` 落到「按原始字节缓存」分支后产出一次性假指纹。
|
|
188
|
+
secure_atomic.atomic_write_text(
|
|
189
|
+
manifest, "\n".join(lines) + "\n", mode=0o600, parent_mode=0o700,
|
|
190
|
+
)
|
|
191
|
+
if invalidated:
|
|
192
|
+
stats["invalidated"] = invalidated # type: ignore[assignment]
|
|
193
|
+
if any(stats[key] for key in ("tool", "owner", "evidence", "business")):
|
|
194
|
+
stats["changed"] = 1
|
|
195
|
+
return stats
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def write_inventory_diff(manifest: Path, changes: dict) -> Path:
|
|
199
|
+
"""Persist the rescan result beside the lifecycle manifest (0600, atomic).
|
|
200
|
+
|
|
201
|
+
L1-ADV-D4:``check --auto-backfill`` 的 reconcile 会重置内容变化单元的状态。
|
|
202
|
+
该副作用必须可机读,post 才能把失效单元交回 Supervisor 重新派发。
|
|
203
|
+
"""
|
|
204
|
+
target = manifest.with_name("inventory-diff.json")
|
|
205
|
+
secure_atomic.atomic_write_json(
|
|
206
|
+
target, {"schema_version": 1, "changes": changes},
|
|
207
|
+
mode=0o600, parent_mode=0o700,
|
|
208
|
+
)
|
|
209
|
+
return target
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def row_from_line(line: str) -> ModuleRow:
|
|
213
|
+
cells = parse_cells(line)
|
|
214
|
+
names = ("#", "阶段", "父模块", "模块", "路径/范围", "参与单元", "最小性",
|
|
215
|
+
"难度", "命中", "主工具", "负责任务", "依赖", "状态", "发现数",
|
|
216
|
+
"证据/测试", "备注")
|
|
217
|
+
index = {name: i for i, name in enumerate(names)}
|
|
218
|
+
|
|
219
|
+
def get(key: str) -> str:
|
|
220
|
+
return cells[index[key]] if key in index else ""
|
|
221
|
+
|
|
222
|
+
return ModuleRow(
|
|
223
|
+
number=get("#"), phase=get("阶段"), parent=get("父模块"),
|
|
224
|
+
name=get("模块"), path=get("路径/范围"), participants=get("参与单元"),
|
|
225
|
+
minimality=get("最小性"), difficulty=get("难度"), hit=get("命中"),
|
|
226
|
+
tool=get("主工具"), owner=get("负责任务"), deps=get("依赖"),
|
|
227
|
+
status=get("状态"), findings=get("发现数"), evidence=get("证据/测试"),
|
|
228
|
+
note=get("备注"),
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def check(final: bool = False, root: Path = REPO_ROOT,
|
|
233
|
+
manifest: Path = MANIFEST,
|
|
234
|
+
evidence_manifest: Path | None = None,
|
|
235
|
+
require_evidence: bool = False,
|
|
236
|
+
auto_backfill: bool = False,
|
|
237
|
+
allow_business_partial: bool = False) -> int:
|
|
238
|
+
rows, errors = parse_manifest(manifest)
|
|
239
|
+
errors.extend(manifest_gate_errors(manifest))
|
|
240
|
+
discovery_mode = manifest_discovery_mode(manifest)
|
|
241
|
+
if discovery_mode in {"files", "files-only"}:
|
|
242
|
+
print(
|
|
243
|
+
"[module_coverage] 警告:当前清单是 files-mode/partial,"
|
|
244
|
+
"跳过符号与关系图硬门禁;不可宣称符号级全覆盖。"
|
|
245
|
+
)
|
|
246
|
+
if auto_backfill and not errors:
|
|
247
|
+
stats = apply_auto_backfill(
|
|
248
|
+
manifest, rows, root, evidence_manifest=evidence_manifest,
|
|
249
|
+
)
|
|
250
|
+
if stats.get("changed"):
|
|
251
|
+
print(
|
|
252
|
+
"[module_coverage] auto-backfill(auto 模式,诚实记账): "
|
|
253
|
+
f"主工具 {stats['tool']} 行、负责任务 {stats['owner']} 行、"
|
|
254
|
+
f"证据 {stats['evidence']} 行、业务链路 {stats['business']} 行"
|
|
255
|
+
)
|
|
256
|
+
invalidated = list(stats.get("invalidated") or ())
|
|
257
|
+
if stats.get("changed") or invalidated:
|
|
258
|
+
# 清单已被改写(回填字段 或 内容失效重置),必须重新解析后再判定,
|
|
259
|
+
# 否则门禁读到的是失效前的旧状态(假通过)。
|
|
260
|
+
rows, errors = parse_manifest(manifest)
|
|
261
|
+
errors.extend(manifest_gate_errors(manifest))
|
|
262
|
+
if invalidated:
|
|
263
|
+
print(
|
|
264
|
+
"[module_coverage] 内容已变化,旧证据失效(覆盖状态已重置为未覆盖): "
|
|
265
|
+
f"{len(invalidated)} 项 → " + ", ".join(invalidated[:20])
|
|
266
|
+
+ ";已写入 inventory-diff.json,需重新派发并重新覆盖"
|
|
267
|
+
)
|
|
268
|
+
errors.extend(validate_rows(
|
|
269
|
+
rows, root, final=final,
|
|
270
|
+
require_symbols=True,
|
|
271
|
+
require_graph=True,
|
|
272
|
+
evidence_manifest=evidence_manifest,
|
|
273
|
+
require_evidence=require_evidence,
|
|
274
|
+
discovery_mode=discovery_mode,
|
|
275
|
+
allow_business_partial=bool(allow_business_partial and not final),
|
|
276
|
+
))
|
|
277
|
+
internals = [row for row in rows if row.phase == "内部"]
|
|
278
|
+
business = [row for row in rows if row.phase == "业务"]
|
|
279
|
+
internal_covered = sum(row.status == "已覆盖" for row in internals)
|
|
280
|
+
business_covered = sum(row.status == "已覆盖" for row in business)
|
|
281
|
+
print(
|
|
282
|
+
f"[module_coverage] 内部最小单元: {internal_covered}/{len(internals)} "
|
|
283
|
+
f"({(internal_covered / len(internals) * 100) if internals else 0:.1f}%)"
|
|
284
|
+
)
|
|
285
|
+
print(
|
|
286
|
+
f"[module_coverage] 模块间业务链路: {business_covered}/{len(business)} "
|
|
287
|
+
f"({(business_covered / len(business) * 100) if business else 0:.1f}%)"
|
|
288
|
+
)
|
|
289
|
+
if errors:
|
|
290
|
+
print(f"[module_coverage] 失败({len(errors)} 项):")
|
|
291
|
+
for error in errors:
|
|
292
|
+
print(f" ✗ {error}")
|
|
293
|
+
return 1
|
|
294
|
+
print("[module_coverage] OK: 最小单元、阶段顺序、业务链路、工具与证据均有效")
|
|
295
|
+
return 0
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def status(root: Path = REPO_ROOT, manifest: Path = MANIFEST,
|
|
299
|
+
as_json: bool = False,
|
|
300
|
+
evidence_manifest: Path | None = None) -> int:
|
|
301
|
+
"""只读输出当前覆盖进度;清单无效或为空时失败。"""
|
|
302
|
+
rows, errors = parse_manifest(manifest)
|
|
303
|
+
if manifest.is_file():
|
|
304
|
+
errors.extend(manifest_gate_errors(manifest))
|
|
305
|
+
errors.extend(status_manifest_errors(rows))
|
|
306
|
+
summary = coverage_summary(rows, errors)
|
|
307
|
+
summary["available"] = manifest.is_file()
|
|
308
|
+
summary["gates"] = {
|
|
309
|
+
"symbol_index": True,
|
|
310
|
+
"project_graph": True,
|
|
311
|
+
}
|
|
312
|
+
if as_json:
|
|
313
|
+
print(json.dumps(summary, ensure_ascii=False, indent=2))
|
|
314
|
+
else:
|
|
315
|
+
print(f"[module_coverage] 当前阶段: {summary['phase']}")
|
|
316
|
+
for key, label in (("internal", "内部最小单元"), ("business", "模块间业务链路")):
|
|
317
|
+
item = summary[key]
|
|
318
|
+
print(f" {label}: {item['covered']}/{item['total']} ({item['percent']:.1f}%)")
|
|
319
|
+
if summary["current_units"]:
|
|
320
|
+
current = ", ".join(
|
|
321
|
+
f"#{item['id']} {item['name']}[{item['status']}]"
|
|
322
|
+
for item in summary["current_units"]
|
|
323
|
+
)
|
|
324
|
+
print(f" 当前单元: {current}")
|
|
325
|
+
if errors:
|
|
326
|
+
print(f" 清单提示: {len(errors)} 项(运行 check 查看详情)")
|
|
327
|
+
return 0 if manifest.is_file() and rows and not errors else 1
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
def suggest_hits(root: Path = REPO_ROOT, manifest: Path = MANIFEST,
|
|
331
|
+
findings_payloads: list[dict] | None = None) -> dict:
|
|
332
|
+
"""按实测 findings 产出「命中」列建议值,替代手填优先级数据。
|
|
333
|
+
|
|
334
|
+
统计每条清单路径(含 ``::symbol`` 前缀匹配)对应的非 rejected finding
|
|
335
|
+
数并换算 1-5 档;与当前手填值对照输出漂移清单。只建议、不回写——
|
|
336
|
+
应用与否由 Supervisor 决定,避免自动改写工作清单造成状态混乱。
|
|
337
|
+
"""
|
|
338
|
+
rows, errors = parse_manifest(manifest)
|
|
339
|
+
if errors:
|
|
340
|
+
raise ValueError("; ".join(errors[:5]))
|
|
341
|
+
counts: dict[str, int] = {}
|
|
342
|
+
for payload in findings_payloads or []:
|
|
343
|
+
for finding in (payload or {}).get("findings", []):
|
|
344
|
+
if not isinstance(finding, dict):
|
|
345
|
+
continue
|
|
346
|
+
confirmation = finding.get("confirmation")
|
|
347
|
+
if isinstance(confirmation, dict) and confirmation.get("state") == "rejected":
|
|
348
|
+
continue
|
|
349
|
+
for evidence in finding.get("evidence", []):
|
|
350
|
+
if isinstance(evidence, dict) and isinstance(evidence.get("path"), str):
|
|
351
|
+
normalized = evidence["path"].replace("\\", "/").lstrip("./")
|
|
352
|
+
counts[normalized] = counts.get(normalized, 0) + 1
|
|
353
|
+
|
|
354
|
+
def scale(count: int) -> int:
|
|
355
|
+
if count <= 0:
|
|
356
|
+
return 1
|
|
357
|
+
if count <= 2:
|
|
358
|
+
return 2
|
|
359
|
+
if count <= 5:
|
|
360
|
+
return 3
|
|
361
|
+
if count <= 10:
|
|
362
|
+
return 4
|
|
363
|
+
return 5
|
|
364
|
+
|
|
365
|
+
suggestions: list[dict] = []
|
|
366
|
+
mismatches: list[dict] = []
|
|
367
|
+
for row in rows:
|
|
368
|
+
clean = row.path.strip().strip("`").rstrip("/")
|
|
369
|
+
if "::" in clean:
|
|
370
|
+
clean = clean.split("::", 1)[0]
|
|
371
|
+
clean = clean.replace("\\", "/").lstrip("./")
|
|
372
|
+
observed = 0
|
|
373
|
+
if clean and clean not in {"-", "N/A", "待定"}:
|
|
374
|
+
observed = sum(
|
|
375
|
+
value for path, value in counts.items()
|
|
376
|
+
if path == clean or path.startswith(clean + "/") or clean.startswith(path + "/")
|
|
377
|
+
)
|
|
378
|
+
suggested = scale(observed)
|
|
379
|
+
current = None
|
|
380
|
+
if row.hit.strip().isdigit():
|
|
381
|
+
current = int(row.hit.strip())
|
|
382
|
+
entry = {
|
|
383
|
+
"number": row.number, "module": row.name,
|
|
384
|
+
"path": clean or row.path,
|
|
385
|
+
"observed_findings": observed, "suggested_hit": suggested,
|
|
386
|
+
"current_hit": current,
|
|
387
|
+
}
|
|
388
|
+
suggestions.append(entry)
|
|
389
|
+
if current is not None and current != suggested:
|
|
390
|
+
mismatches.append(entry)
|
|
391
|
+
return {
|
|
392
|
+
"schema_version": 1,
|
|
393
|
+
"rows_total": len(rows),
|
|
394
|
+
"suggestions": suggestions,
|
|
395
|
+
"mismatches": mismatches,
|
|
396
|
+
"note": (
|
|
397
|
+
"命中列应以实测为准更新 module-coverage.md;手填值只是冷启动默认"
|
|
398
|
+
if mismatches else "手填命中与实测一致"
|
|
399
|
+
),
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
def ingest_test_coverage_report(
|
|
404
|
+
root: Path,
|
|
405
|
+
report_path: Path | str,
|
|
406
|
+
*,
|
|
407
|
+
format_hint: str | None = None,
|
|
408
|
+
manifest_path: Path | None = None,
|
|
409
|
+
) -> dict[str, Any]:
|
|
410
|
+
"""读取真实测试覆盖率报告(lcov/cobertura/coveragepy等),反向回填覆盖清单。"""
|
|
411
|
+
from core.coverage import coverage_intelligence
|
|
412
|
+
root = root.resolve()
|
|
413
|
+
rpath = Path(report_path)
|
|
414
|
+
if not rpath.is_absolute():
|
|
415
|
+
rpath = root / rpath
|
|
416
|
+
if not rpath.is_file():
|
|
417
|
+
raise FileNotFoundError(f"覆盖报告文件不存在: {rpath}")
|
|
418
|
+
|
|
419
|
+
fmt = format_hint
|
|
420
|
+
if not fmt:
|
|
421
|
+
suf = rpath.suffix.lower()
|
|
422
|
+
if suf in {".info", ".lcov"}:
|
|
423
|
+
fmt = "lcov"
|
|
424
|
+
elif suf == ".xml":
|
|
425
|
+
fmt = "jacoco"
|
|
426
|
+
elif suf == ".json":
|
|
427
|
+
try:
|
|
428
|
+
data = json.loads(rpath.read_text(encoding="utf-8"))
|
|
429
|
+
if isinstance(data, dict) and "files" in data:
|
|
430
|
+
fmt = "coveragepy"
|
|
431
|
+
else:
|
|
432
|
+
fmt = "generic"
|
|
433
|
+
except Exception:
|
|
434
|
+
fmt = "generic"
|
|
435
|
+
else:
|
|
436
|
+
fmt = "lcov"
|
|
437
|
+
|
|
438
|
+
report = coverage_intelligence.import_report(rpath, fmt, root=root)
|
|
439
|
+
covered_files: dict[str, dict] = {}
|
|
440
|
+
for f in report.get("files", []):
|
|
441
|
+
p = f.get("path", "")
|
|
442
|
+
try:
|
|
443
|
+
rel = str(Path(p).resolve().relative_to(root)).replace("\\", "/")
|
|
444
|
+
except Exception:
|
|
445
|
+
rel = p.replace("\\", "/")
|
|
446
|
+
covered_files[rel] = f
|
|
447
|
+
|
|
448
|
+
mpath = manifest_path or default_manifest_for_root(root)
|
|
449
|
+
if not mpath.is_file():
|
|
450
|
+
return {
|
|
451
|
+
"status": "NO_MANIFEST",
|
|
452
|
+
"report_format": fmt,
|
|
453
|
+
"covered_files_count": len(covered_files),
|
|
454
|
+
"units_updated": 0,
|
|
455
|
+
"detail": f"未找到覆盖清单: {mpath}",
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
rows, manifest_errors = parse_manifest(mpath)
|
|
459
|
+
if manifest_errors:
|
|
460
|
+
return {
|
|
461
|
+
"status": "INVALID_MANIFEST",
|
|
462
|
+
"report_format": fmt,
|
|
463
|
+
"covered_files_count": len(covered_files),
|
|
464
|
+
"units_updated": 0,
|
|
465
|
+
"detail": manifest_errors,
|
|
466
|
+
}
|
|
467
|
+
try:
|
|
468
|
+
lines = mpath.read_text(encoding="utf-8").splitlines()
|
|
469
|
+
except (OSError, UnicodeDecodeError) as exc:
|
|
470
|
+
return {
|
|
471
|
+
"status": "INVALID_MANIFEST",
|
|
472
|
+
"report_format": fmt,
|
|
473
|
+
"covered_files_count": len(covered_files),
|
|
474
|
+
"units_updated": 0,
|
|
475
|
+
"detail": str(exc),
|
|
476
|
+
}
|
|
477
|
+
updated_units = []
|
|
478
|
+
new_rows = []
|
|
479
|
+
|
|
480
|
+
thresholds = coverage_intelligence.DEFAULT_THRESHOLDS
|
|
481
|
+
|
|
482
|
+
def file_meets_thresholds(item: dict) -> bool:
|
|
483
|
+
metrics = item.get("metrics")
|
|
484
|
+
if not isinstance(metrics, dict):
|
|
485
|
+
return False
|
|
486
|
+
for metric, minimum in thresholds.items():
|
|
487
|
+
if minimum <= 0:
|
|
488
|
+
continue
|
|
489
|
+
value = metrics.get(metric)
|
|
490
|
+
if value is None and metric != "statement":
|
|
491
|
+
# Branch/mutation dimensions are optional for execution-only
|
|
492
|
+
# reports; enforce them whenever the producer supplied them.
|
|
493
|
+
continue
|
|
494
|
+
if not isinstance(value, (int, float)) or isinstance(value, bool) or value < minimum:
|
|
495
|
+
return False
|
|
496
|
+
return True
|
|
497
|
+
|
|
498
|
+
for row in rows:
|
|
499
|
+
row_unit = coverage_unit_id(row)
|
|
500
|
+
file_part = row.path.split("::")[0].strip().strip("`").strip()
|
|
501
|
+
matching_file = covered_files.get(file_part)
|
|
502
|
+
# A file report cannot prove an individual symbol or a business flow.
|
|
503
|
+
# Only file-level rows may be promoted, and only when the shared
|
|
504
|
+
# coverage-gaps thresholds are satisfied.
|
|
505
|
+
if (
|
|
506
|
+
matching_file
|
|
507
|
+
and "::" not in row.path
|
|
508
|
+
and row.status != "已覆盖"
|
|
509
|
+
and file_meets_thresholds(matching_file)
|
|
510
|
+
):
|
|
511
|
+
m = matching_file.get("metrics", {})
|
|
512
|
+
stmt_pct = m.get("statement")
|
|
513
|
+
pct_str = f"stmt={stmt_pct}%" if stmt_pct is not None else "covered"
|
|
514
|
+
new_row = replace(
|
|
515
|
+
row,
|
|
516
|
+
status="已覆盖",
|
|
517
|
+
tool="test-suite" if not row.tool or row.tool == "-" else f"{row.tool},test-suite",
|
|
518
|
+
evidence=f"`{rpath.name}` ({pct_str})" if not row.evidence or row.evidence == "-" else row.evidence,
|
|
519
|
+
)
|
|
520
|
+
updated_units.append(row_unit)
|
|
521
|
+
new_rows.append(new_row)
|
|
522
|
+
else:
|
|
523
|
+
new_rows.append(row)
|
|
524
|
+
|
|
525
|
+
if updated_units:
|
|
526
|
+
updated_lines = []
|
|
527
|
+
for line in lines:
|
|
528
|
+
if not line.strip().startswith("|") or "---" in line or "序号" in line or "phase" in line:
|
|
529
|
+
updated_lines.append(line)
|
|
530
|
+
else:
|
|
531
|
+
cells = parse_cells(line)
|
|
532
|
+
if cells and len(cells) >= 11:
|
|
533
|
+
num = cells[0].strip()
|
|
534
|
+
matched_r = next((r for r in new_rows if r.number == num), None)
|
|
535
|
+
if matched_r:
|
|
536
|
+
updated_lines.append(row_text(matched_r))
|
|
537
|
+
else:
|
|
538
|
+
updated_lines.append(line)
|
|
539
|
+
else:
|
|
540
|
+
updated_lines.append(line)
|
|
541
|
+
mpath.write_text("\n".join(updated_lines) + "\n", encoding="utf-8")
|
|
542
|
+
|
|
543
|
+
return {
|
|
544
|
+
"status": "SUCCESS",
|
|
545
|
+
"report_format": fmt,
|
|
546
|
+
"covered_files_count": len(covered_files),
|
|
547
|
+
"units_updated": len(updated_units),
|
|
548
|
+
"updated_unit_ids": updated_units,
|
|
549
|
+
"thresholds": dict(thresholds),
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
def main(argv: list[str] | None = None) -> int:
|
|
554
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
555
|
+
parser.add_argument("command", choices=(
|
|
556
|
+
"discover", "discover-flows", "check", "final-check", "status", "hits",
|
|
557
|
+
"review-packages", "review-apply",
|
|
558
|
+
), nargs="?",
|
|
559
|
+
default="check")
|
|
560
|
+
parser.add_argument("--root", type=Path, default=None)
|
|
561
|
+
parser.add_argument(
|
|
562
|
+
"--manifest", type=Path, default=None,
|
|
563
|
+
help="覆盖清单;省略时使用当前项目活动生命周期的 state/module-coverage.md",
|
|
564
|
+
)
|
|
565
|
+
parser.add_argument(
|
|
566
|
+
"--findings", type=Path, action="append", default=[],
|
|
567
|
+
help="hits 子命令使用:findings JSON(可重复),驱动命中列实测建议",
|
|
568
|
+
)
|
|
569
|
+
parser.add_argument(
|
|
570
|
+
"--verdicts", type=Path, default=None,
|
|
571
|
+
help="review-apply 子命令使用:宿主 AI 目录裁决 JSON",
|
|
572
|
+
)
|
|
573
|
+
parser.add_argument(
|
|
574
|
+
"--reviewed-by", type=str, default=None,
|
|
575
|
+
help="review-apply 子命令使用:宿主 AI 身份(必填,拒绝匿名裁决)",
|
|
576
|
+
)
|
|
577
|
+
parser.add_argument(
|
|
578
|
+
"--evidence", type=Path,
|
|
579
|
+
help="worker 覆盖证据 manifest;提供后启用 artifact/hash/target 严格门禁",
|
|
580
|
+
)
|
|
581
|
+
parser.add_argument(
|
|
582
|
+
"--require-evidence", action="store_true",
|
|
583
|
+
help="要求提供覆盖证据 manifest;正式 launch 门禁使用此选项",
|
|
584
|
+
)
|
|
585
|
+
parser.add_argument(
|
|
586
|
+
"--auto-backfill", action="store_true",
|
|
587
|
+
help="auto 模式:回填缺失的计划字段(主工具/负责人/证据指针)并补齐"
|
|
588
|
+
"自动发现的业务链路行;只填记账元数据,不改写覆盖状态",
|
|
589
|
+
)
|
|
590
|
+
parser.add_argument(
|
|
591
|
+
"--allow-business-partial", action="store_true",
|
|
592
|
+
help="允许风险驱动业务链路在内部覆盖未完成时进入候选队列;不改变覆盖完成判定",
|
|
593
|
+
)
|
|
594
|
+
parser.add_argument("--json", action="store_true")
|
|
595
|
+
args = parser.parse_args(argv)
|
|
596
|
+
args.root = (args.root or Path.cwd()).expanduser().resolve()
|
|
597
|
+
args.manifest = (
|
|
598
|
+
args.manifest.expanduser().resolve()
|
|
599
|
+
if args.manifest is not None
|
|
600
|
+
else default_manifest_for_root(args.root)
|
|
601
|
+
)
|
|
602
|
+
if args.command == "discover":
|
|
603
|
+
try:
|
|
604
|
+
rows = discovery_rows(args.root, symbols=True)
|
|
605
|
+
except symbol_index.SourceDiscoveryError as exc:
|
|
606
|
+
print(f"[module_coverage] ✗ {exc}", file=sys.stderr)
|
|
607
|
+
return 2
|
|
608
|
+
if args.json:
|
|
609
|
+
print(json.dumps({
|
|
610
|
+
"schema_version": 1,
|
|
611
|
+
"symbol_gate": True,
|
|
612
|
+
"project_graph_gate": True,
|
|
613
|
+
"rows": rows,
|
|
614
|
+
}, ensure_ascii=False, indent=2))
|
|
615
|
+
else:
|
|
616
|
+
print(SYMBOL_INDEX_MARKER)
|
|
617
|
+
print(PROJECT_GRAPH_MARKER)
|
|
618
|
+
print("\n".join(rows))
|
|
619
|
+
return 0 if rows else 1
|
|
620
|
+
if args.command == "review-packages":
|
|
621
|
+
from core.coverage import coverage_ai_review
|
|
622
|
+
|
|
623
|
+
packages = coverage_ai_review.candidate_groups(
|
|
624
|
+
args.root,
|
|
625
|
+
source_paths=symbol_index.discover_source_paths(args.root),
|
|
626
|
+
asset_paths=symbol_index.discover_asset_paths(args.root),
|
|
627
|
+
)
|
|
628
|
+
path = coverage_ai_review.write_review_packages(args.root, packages)
|
|
629
|
+
if args.json:
|
|
630
|
+
print(json.dumps({"packages": len(packages), "path": str(path)},
|
|
631
|
+
ensure_ascii=False))
|
|
632
|
+
else:
|
|
633
|
+
print(f"[coverage-review] 候选目录组 {len(packages)} 个,"
|
|
634
|
+
f"复核包已写入: {path}")
|
|
635
|
+
for pkg in packages:
|
|
636
|
+
print(f" - {pkg['top_dir']}(files={pkg['file_count']}"
|
|
637
|
+
f" exts={pkg['extensions']})")
|
|
638
|
+
print("[coverage-review] 宿主 AI 必须逐目录基于证据判定 product/"
|
|
639
|
+
"exclude 并给出理由;裁决只允许移出。完成后执行:")
|
|
640
|
+
print(" bugx coverage review-apply --verdicts <verdicts.json>"
|
|
641
|
+
" --reviewed-by <AI身份>")
|
|
642
|
+
return 0
|
|
643
|
+
if args.command == "review-apply":
|
|
644
|
+
from core.coverage import coverage_ai_review
|
|
645
|
+
|
|
646
|
+
if not args.verdicts:
|
|
647
|
+
print("[coverage-review] ✗ review-apply 需要 --verdicts <file>",
|
|
648
|
+
file=sys.stderr)
|
|
649
|
+
return 2
|
|
650
|
+
try:
|
|
651
|
+
result = coverage_ai_review.apply_verdicts(
|
|
652
|
+
args.root, args.verdicts, args.reviewed_by or "",
|
|
653
|
+
)
|
|
654
|
+
except (OSError, ValueError) as exc:
|
|
655
|
+
print(f"[coverage-review] ✗ {exc}", file=sys.stderr)
|
|
656
|
+
return 2
|
|
657
|
+
print(f"[coverage-review] ✓ 已持久化 {result['applied']} 条目录裁决"
|
|
658
|
+
f"(reviewed_by={result['reviewed_by']})→ {result['path']}")
|
|
659
|
+
return 0
|
|
660
|
+
if args.command == "discover-flows":
|
|
661
|
+
manifest_rows, parse_errors = parse_manifest(args.manifest)
|
|
662
|
+
if parse_errors:
|
|
663
|
+
for error in parse_errors:
|
|
664
|
+
print(f"[module_coverage] ✗ {error}", file=sys.stderr)
|
|
665
|
+
return 2
|
|
666
|
+
payload = business_discovery(args.root, manifest_rows)
|
|
667
|
+
payload["rows"] = business_discovery_rows(args.root, manifest_rows)
|
|
668
|
+
if args.json:
|
|
669
|
+
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
|
670
|
+
else:
|
|
671
|
+
print("\n".join(payload["rows"]))
|
|
672
|
+
return 0 if payload["complete"] else 2
|
|
673
|
+
if args.command == "status":
|
|
674
|
+
return status(
|
|
675
|
+
args.root, args.manifest, as_json=args.json,
|
|
676
|
+
evidence_manifest=args.evidence,
|
|
677
|
+
)
|
|
678
|
+
if args.command == "hits":
|
|
679
|
+
import json as _json
|
|
680
|
+
|
|
681
|
+
payloads: list[dict] = []
|
|
682
|
+
for path in args.findings:
|
|
683
|
+
try:
|
|
684
|
+
payloads.append(_json.loads(path.read_text(encoding="utf-8")))
|
|
685
|
+
except (OSError, _json.JSONDecodeError) as exc:
|
|
686
|
+
print(f"[module_coverage] ✗ 无法读取 findings {path}: {exc}",
|
|
687
|
+
file=sys.stderr)
|
|
688
|
+
return 2
|
|
689
|
+
try:
|
|
690
|
+
result = suggest_hits(args.root, args.manifest, payloads)
|
|
691
|
+
except ValueError as exc:
|
|
692
|
+
print(f"[module_coverage] ✗ {exc}", file=sys.stderr)
|
|
693
|
+
return 2
|
|
694
|
+
if args.json:
|
|
695
|
+
print(_json.dumps(result, ensure_ascii=False, indent=2))
|
|
696
|
+
else:
|
|
697
|
+
print(f"[module_coverage] 清单 {result['rows_total']} 行,"
|
|
698
|
+
f"命中漂移 {len(result['mismatches'])} 行")
|
|
699
|
+
for item in result["mismatches"]:
|
|
700
|
+
print(f" {item['number']} {item['module']}: "
|
|
701
|
+
f"手填={item['current_hit']} 实测建议={item['suggested_hit']}"
|
|
702
|
+
f"({item['observed_findings']} 个 finding)<- {item['path']}")
|
|
703
|
+
print(f"[module_coverage] {result['note']}")
|
|
704
|
+
return 0
|
|
705
|
+
return check(
|
|
706
|
+
args.command == "final-check", args.root, args.manifest,
|
|
707
|
+
evidence_manifest=args.evidence,
|
|
708
|
+
require_evidence=args.require_evidence,
|
|
709
|
+
auto_backfill=args.auto_backfill,
|
|
710
|
+
allow_business_partial=args.allow_business_partial,
|
|
711
|
+
)
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
if __name__ == "__main__":
|
|
715
|
+
sys.exit(main())
|