bugx-cli 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +55 -0
- package/README.md +284 -2
- package/core/CATALOG.json +141 -0
- package/core/README.md +254 -0
- package/core/adapters/README.md +35 -0
- package/core/adapters/android-interaction.json +81 -0
- package/core/adapters/android.json +24 -0
- package/core/adapters/desktop-macos.json +20 -0
- package/core/adapters/ios-interaction.json +34 -0
- package/core/adapters/ios.json +23 -0
- package/core/adapters/memory-macos.json +24 -0
- package/core/agent/README.md +51 -0
- package/core/agent/__init__.py +146 -0
- package/core/agent/agent_artifacts.py +766 -0
- package/core/agent/agent_eval.py +1155 -0
- package/core/agent/agent_execution.py +718 -0
- package/core/agent/agent_orchestrator.py +1351 -0
- package/core/agent/agent_targets.py +877 -0
- package/core/agent/agent_workspace.py +770 -0
- package/core/agent/feature_baseline.py +150 -0
- package/core/assets/README.md +24 -0
- package/core/assets/axe-core/LICENSE-3RD-PARTY.txt +66 -0
- package/core/assets/axe-core/LICENSE.txt +362 -0
- package/core/assets/axe-core/UPSTREAM.md +10 -0
- package/core/assets/axe-core/axe.min.js +12 -0
- package/core/assets/bugx-avatar-1024.png +0 -0
- package/core/assets/bugx-avatar-512.png +0 -0
- package/core/assets/bugx-avatar-tight.svg +23 -0
- package/core/assets/bugx-avatar.svg +28 -0
- package/core/assets/bugx-hero-cn.png +0 -0
- package/core/assets/bugx-hero-en.png +0 -0
- package/core/assets/bugx-hero-en.svg +74 -0
- package/core/assets/bugx-hero-zh.svg +74 -0
- package/core/assets/codex.png +0 -0
- package/core/assets/dsh.png +0 -0
- package/core/assets/project-layout.md +42 -0
- package/core/assets/webui-chatgpt.jpg +0 -0
- package/core/assets/webui-session.jpg +0 -0
- package/core/assets/webui-skills.jpg +0 -0
- package/core/assets/webui-studio.jpg +0 -0
- package/core/assets/webui-zcode.jpg +0 -0
- package/core/assets/zcode.png +0 -0
- package/core/audit_packs/README.md +37 -0
- package/core/audit_packs/data-audit/manifest.json +94 -0
- package/core/audit_packs/data-audit/stages/00-scope.md +14 -0
- package/core/audit_packs/data-audit/stages/10-schema-inventory.md +14 -0
- package/core/audit_packs/data-audit/stages/20-query-and-integrity.md +14 -0
- package/core/audit_packs/data-audit/stages/80-evidence-regression.md +14 -0
- package/core/audit_packs/desktop-audit/manifest.json +123 -0
- package/core/audit_packs/desktop-audit/stages/00-scope.md +15 -0
- package/core/audit_packs/desktop-audit/stages/10-process-model.md +14 -0
- package/core/audit_packs/desktop-audit/stages/20-package-integrity.md +15 -0
- package/core/audit_packs/desktop-audit/stages/30-ui-behavior.md +14 -0
- package/core/audit_packs/desktop-audit/stages/80-evidence-regression.md +15 -0
- package/core/audit_packs/memory-testing.md +227 -0
- package/core/audit_packs/mobile-audit/manifest.json +155 -0
- package/core/audit_packs/mobile-audit/modules/android.md +19 -0
- package/core/audit_packs/mobile-audit/modules/h5.md +18 -0
- package/core/audit_packs/mobile-audit/modules/ios.md +25 -0
- package/core/audit_packs/mobile-audit/modules/miniprogram.md +26 -0
- package/core/audit_packs/mobile-audit/modules/webview.md +18 -0
- package/core/audit_packs/mobile-audit/stages/00-scope.md +14 -0
- package/core/audit_packs/mobile-audit/stages/10-platform-inventory.md +14 -0
- package/core/audit_packs/mobile-audit/stages/20-masvs-static.md +20 -0
- package/core/audit_packs/mobile-audit/stages/30-component-exposure.md +14 -0
- package/core/audit_packs/mobile-audit/stages/40-device-behavior.md +14 -0
- package/core/audit_packs/mobile-audit/stages/80-evidence-regression.md +13 -0
- package/core/audit_packs/native-audit/manifest.json +127 -0
- package/core/audit_packs/native-audit/stages/00-scope.md +14 -0
- package/core/audit_packs/native-audit/stages/10-static-white-box.md +14 -0
- package/core/audit_packs/native-audit/stages/20-memory-concurrency.md +15 -0
- package/core/audit_packs/native-audit/stages/30-behavior-black-box.md +39 -0
- package/core/audit_packs/native-audit/stages/80-evidence-regression.md +14 -0
- package/core/audit_packs/platform-testing.md +174 -0
- package/core/audit_packs/web-audit/manifest.json +191 -0
- package/core/audit_packs/web-audit/modules/graphql.md +5 -0
- package/core/audit_packs/web-audit/modules/h5.md +18 -0
- package/core/audit_packs/web-audit/modules/multi-tenant.md +4 -0
- package/core/audit_packs/web-audit/modules/oauth.md +4 -0
- package/core/audit_packs/web-audit/modules/upload.md +4 -0
- package/core/audit_packs/web-audit/modules/websocket.md +4 -0
- package/core/audit_packs/web-audit/stages/00-scope.md +13 -0
- package/core/audit_packs/web-audit/stages/10-discovery.md +13 -0
- package/core/audit_packs/web-audit/stages/20-auth-session.md +13 -0
- package/core/audit_packs/web-audit/stages/30-authz-business.md +13 -0
- package/core/audit_packs/web-audit/stages/40-input-output.md +13 -0
- package/core/audit_packs/web-audit/stages/50-state-async.md +13 -0
- package/core/audit_packs/web-audit/stages/60-file-ssrf-deser.md +12 -0
- package/core/audit_packs/web-audit/stages/70-config-dependency.md +12 -0
- package/core/audit_packs/web-audit/stages/80-evidence-regression.md +12 -0
- package/core/autonomous_cve/INTERFACE.md +61 -0
- package/core/autonomous_cve/README.md +58 -0
- package/core/autonomous_cve/SPEC.md +25 -0
- package/core/autonomous_cve/__init__.py +109 -0
- package/core/autonomous_cve/attack_graph.py +1096 -0
- package/core/autonomous_cve/attack_graph_store.py +1868 -0
- package/core/autonomous_cve/audit_campaign.py +1232 -0
- package/core/autonomous_cve/behavior_graph.py +465 -0
- package/core/autonomous_cve/ghsa_advisories.py +174 -0
- package/core/autonomous_cve/models.py +93 -0
- package/core/autonomous_cve/mutator.py +87 -0
- package/core/autonomous_cve/patcher.py +126 -0
- package/core/autonomous_cve/scout.py +278 -0
- package/core/autonomous_cve/synthesizer.py +207 -0
- package/core/autonomous_cve/verifier.py +103 -0
- package/core/bugx.md +1299 -0
- package/core/bugx_paths.py +1881 -0
- package/core/cli-help.txt +66 -0
- package/core/cloud_sync/INTERFACE.md +32 -0
- package/core/cloud_sync/README.md +62 -0
- package/core/cloud_sync/SPEC.md +25 -0
- package/core/cloud_sync/__init__.py +23 -0
- package/core/cloud_sync/auto_sync.py +398 -0
- package/core/cloud_sync/cloud_client.py +1218 -0
- package/core/cloud_sync/cloud_onboard.py +743 -0
- package/core/cloud_sync/cloud_schema.py +648 -0
- package/core/cloud_sync/consent.py +81 -0
- package/core/cloud_sync/device_identity.py +307 -0
- package/core/cloud_sync/endpoint_router.py +415 -0
- package/core/cloud_sync/flywheel_client.py +769 -0
- package/core/cloud_sync/network_transport.py +296 -0
- package/core/cloud_sync/onboard_wizard.py +493 -0
- package/core/cloud_sync/sensitive_filter.py +285 -0
- package/core/cloud_sync/sync_pull.py +695 -0
- package/core/cloud_sync/sync_push.py +723 -0
- package/core/contracts/AGENT_GUIDE.md +359 -0
- package/core/contracts/README.md +34 -0
- package/core/contracts/bugx-blackbox.md +541 -0
- package/core/contracts/bugx-opencode.md +469 -0
- package/core/contracts/bugx-quick.md +44 -0
- package/core/contracts/bugx-runtime-contract.md +353 -0
- package/core/contracts/bugx-worker.md +470 -0
- package/core/contracts/engine_gap_contracts.py +473 -0
- package/core/coverage/README.md +70 -0
- package/core/coverage/__init__.py +106 -0
- package/core/coverage/coverage_ai_review.py +185 -0
- package/core/coverage/coverage_backfill.py +54 -0
- package/core/coverage/coverage_bootstrap.py +713 -0
- package/core/coverage/coverage_business.py +36 -0
- package/core/coverage/coverage_cli.py +715 -0
- package/core/coverage/coverage_discovery.py +1429 -0
- package/core/coverage/coverage_evidence.py +1024 -0
- package/core/coverage/coverage_forensics.py +124 -0
- package/core/coverage/coverage_gate.py +277 -0
- package/core/coverage/coverage_intelligence.py +734 -0
- package/core/coverage/coverage_manifest.py +396 -0
- package/core/coverage/coverage_platform.py +77 -0
- package/core/coverage/coverage_validate.py +241 -0
- package/core/coverage/module_coverage.py +157 -0
- package/core/dev_harness/INTERFACE.md +20 -0
- package/core/dev_harness/README.md +21 -0
- package/core/dev_harness/SPEC.md +25 -0
- package/core/dev_harness/__init__.py +5 -0
- package/core/dev_harness/interaction_preset.py +408 -0
- package/core/engine-integrity.json +2797 -0
- package/core/fuzzing/README.md +49 -0
- package/core/fuzzing/__init__.py +82 -0
- package/core/fuzzing/concurrency_fuzzer.py +435 -0
- package/core/fuzzing/differential_oracle.py +1164 -0
- package/core/fuzzing/fuzz_input.py +1291 -0
- package/core/fuzzing/stateful_fuzzer.py +404 -0
- package/core/governance/README.md +61 -0
- package/core/governance/__init__.py +130 -0
- package/core/governance/capacity_planner.py +124 -0
- package/core/governance/dependency_lock.py +317 -0
- package/core/governance/goal_governor.py +754 -0
- package/core/governance/guide_budget.py +458 -0
- package/core/governance/lockdown.sh +50 -0
- package/core/governance/readonly_enforcer.py +154 -0
- package/core/governance/runtime_tool_gate.py +373 -0
- package/core/governance/secret_redactor.py +784 -0
- package/core/governance/token_budget.py +38 -0
- package/core/host_acp/INTERFACE.md +36 -0
- package/core/host_acp/README.md +51 -0
- package/core/host_acp/SPEC.md +25 -0
- package/core/host_acp/__init__.py +121 -0
- package/core/host_acp/base.py +111 -0
- package/core/host_acp/claude.py +99 -0
- package/core/host_acp/cline.py +298 -0
- package/core/host_acp/codex.py +300 -0
- package/core/host_acp/dsh.py +106 -0
- package/core/host_acp/opencode.py +209 -0
- package/core/host_acp/pi.py +94 -0
- package/core/host_acp/zcode.py +99 -0
- package/core/host_runtime/INTERFACE.md +24 -0
- package/core/host_runtime/README.md +62 -0
- package/core/host_runtime/SPEC.md +25 -0
- package/core/host_runtime/__init__.py +21 -0
- package/core/host_runtime/adapters.py +412 -0
- package/core/host_runtime/autonomous_runner.py +1152 -0
- package/core/host_runtime/cline.py +448 -0
- package/core/host_runtime/common.py +103 -0
- package/core/host_runtime/free_models.py +786 -0
- package/core/host_runtime/host_bootstrap.py +389 -0
- package/core/host_runtime/host_evaluators.py +761 -0
- package/core/host_runtime/host_probe.py +41 -0
- package/core/host_runtime/host_provider_arbitrator.py +831 -0
- package/core/host_runtime/host_registry.py +662 -0
- package/core/host_runtime/host_usage.py +127 -0
- package/core/host_runtime/mcp_process_tracker.py +509 -0
- package/core/host_runtime/mcp_registry_gate.py +379 -0
- package/core/host_runtime/pi.py +102 -0
- package/core/host_runtime/provider_facts.py +66 -0
- package/core/hosts/INTERFACE.md +51 -0
- package/core/hosts/README.md +67 -0
- package/core/hosts/SPEC.md +25 -0
- package/core/hosts/__init__.py +140 -0
- package/core/hosts/_base_usage.py +152 -0
- package/core/hosts/_codex_usage.py +297 -0
- package/core/hosts/_dsh_usage.py +184 -0
- package/core/hosts/_mcp_toml.py +365 -0
- package/core/hosts/_zcode_usage.py +269 -0
- package/core/hosts/base.py +479 -0
- package/core/hosts/claude.py +212 -0
- package/core/hosts/cline.py +229 -0
- package/core/hosts/codex.py +1006 -0
- package/core/hosts/dsh.py +526 -0
- package/core/hosts/opencode.py +358 -0
- package/core/hosts/pi.py +308 -0
- package/core/hosts/zcode.py +219 -0
- package/core/i18n.py +252 -0
- package/core/infra/README.md +41 -0
- package/core/infra/__init__.py +17 -0
- package/core/infra/build_info.py +105 -0
- package/core/infra/client_metadata.py +185 -0
- package/core/infra/json_utils.py +22 -0
- package/core/infra/python_runtime.py +540 -0
- package/core/infra/safe_xml.py +221 -0
- package/core/launch_bugx.py +118 -0
- package/core/launch_phases/INTERFACE.md +31 -0
- package/core/launch_phases/README.md +106 -0
- package/core/launch_phases/SPEC.md +25 -0
- package/core/launch_phases/__init__.py +29 -0
- package/core/launch_phases/candidate_revalidation.py +484 -0
- package/core/launch_phases/common.py +1060 -0
- package/core/launch_phases/finding_confirm_phase.py +391 -0
- package/core/launch_phases/finding_settlement.py +1432 -0
- package/core/launch_phases/findings_adjudication.py +666 -0
- package/core/launch_phases/findings_snapshot.py +357 -0
- package/core/launch_phases/judge_phase.py +848 -0
- package/core/launch_phases/lesson_context.py +536 -0
- package/core/launch_phases/lifecycle_reporter.py +627 -0
- package/core/launch_phases/orchestrator_controls.py +686 -0
- package/core/launch_phases/post_commit.py +567 -0
- package/core/launch_phases/post_coverage_sync.py +598 -0
- package/core/launch_phases/post_dry_run.py +817 -0
- package/core/launch_phases/post_observability.py +367 -0
- package/core/launch_phases/post_phase.py +1223 -0
- package/core/launch_phases/post_receipt.py +373 -0
- package/core/launch_phases/post_round_lifecycle.py +786 -0
- package/core/launch_phases/pre_phase.py +1029 -0
- package/core/launch_phases/pre_recon_scout.py +879 -0
- package/core/launch_phases/pre_state_builder.py +1133 -0
- package/core/launch_phases/report_sharing.py +414 -0
- package/core/launch_phases/round_orchestrator.py +1116 -0
- package/core/launch_phases/session_runtime.py +1670 -0
- package/core/launch_phases/startup_gates.py +1050 -0
- package/core/launch_phases/startup_interaction.py +1003 -0
- package/core/launch_phases/startup_version_gate.py +879 -0
- package/core/launch_phases/supervisor_bridge.py +1253 -0
- package/core/launch_phases/supervisor_coverage.py +423 -0
- package/core/launch_phases/supervisor_degraded.py +1211 -0
- package/core/launch_phases/worker_barriers.py +424 -0
- package/core/launch_phases/worker_orchestrator.py +1246 -0
- package/core/launch_phases/worker_prior.py +749 -0
- package/core/ledger/INTERFACE.md +35 -0
- package/core/ledger/README.md +160 -0
- package/core/ledger/SPEC.md +25 -0
- package/core/ledger/__init__.py +67 -0
- package/core/ledger/_facade.py +227 -0
- package/core/ledger/archive_ops.py +630 -0
- package/core/ledger/auto_materialization.py +459 -0
- package/core/ledger/bug-log.md +22 -0
- package/core/ledger/cli.py +275 -0
- package/core/ledger/export_ops.py +554 -0
- package/core/ledger/finding_confirmation.py +1316 -0
- package/core/ledger/finding_io.py +299 -0
- package/core/ledger/finding_lifecycle.py +730 -0
- package/core/ledger/finding_verification.py +405 -0
- package/core/ledger/incidents.py +1005 -0
- package/core/ledger/lesson-replay-cases.json +20 -0
- package/core/ledger/lesson_ledger.py +241 -0
- package/core/ledger/lesson_replay.py +272 -0
- package/core/ledger/life_ledger.py +668 -0
- package/core/ledger/mistake-book.md +130 -0
- package/core/ledger/patterns.py +684 -0
- package/core/ledger/receipt_contract.py +269 -0
- package/core/ledger/schema.py +1192 -0
- package/core/ledger/sync_ops.py +940 -0
- package/core/ledger/tool_experience.py +683 -0
- package/core/ledger/verify_life.py +1597 -0
- package/core/lesson-ledger.json +275 -0
- package/core/locales/README.md +19 -0
- package/core/locales/en-US.json +462 -0
- package/core/locales/zh-CN.json +462 -0
- package/core/mcp_handlers/INTERFACE.md +75 -0
- package/core/mcp_handlers/README.md +62 -0
- package/core/mcp_handlers/SPEC.md +25 -0
- package/core/mcp_handlers/__init__.py +128 -0
- package/core/mcp_handlers/base.py +717 -0
- package/core/mcp_handlers/channel_lifecycle.py +751 -0
- package/core/mcp_handlers/graph_handlers.py +222 -0
- package/core/mcp_handlers/knowledge_handlers.py +536 -0
- package/core/mcp_handlers/mining_handlers.py +586 -0
- package/core/mcp_handlers/resource_prompt_table.py +116 -0
- package/core/mcp_handlers/retrieval_handlers.py +249 -0
- package/core/mcp_handlers/rpc_server.py +470 -0
- package/core/mcp_handlers/supervisor_handlers.py +1461 -0
- package/core/mcp_handlers/telemetry_handlers.py +227 -0
- package/core/mcp_handlers/tool_table.py +1030 -0
- package/core/mcp_runtime_support/README.md +21 -0
- package/core/mcp_runtime_support/__init__.py +1 -0
- package/core/mcp_runtime_support/common.py +363 -0
- package/core/mcp_runtime_support/environment.py +567 -0
- package/core/mcp_runtime_support/verifier.py +758 -0
- package/core/metadata.txt +4 -0
- package/core/planning/README.md +157 -0
- package/core/planning/__init__.py +242 -0
- package/core/planning/capability_plan.py +187 -0
- package/core/planning/capability_planner.py +195 -0
- package/core/planning/domain_archetype.py +542 -0
- package/core/planning/domain_router.py +269 -0
- package/core/planning/dynamic_flow_analyzer.py +533 -0
- package/core/planning/impact_pruner.py +435 -0
- package/core/planning/intent_adjudicator.py +175 -0
- package/core/planning/judge_pipeline.py +1246 -0
- package/core/planning/logic_analysis.py +419 -0
- package/core/planning/prompt_harness.py +1704 -0
- package/core/planning/source_inspector.py +267 -0
- package/core/planning/spec_harvester.py +449 -0
- package/core/planning/target_sandbox_manager.py +573 -0
- package/core/planning/test_capability_verifier.py +1364 -0
- package/core/planning/tools-kb.md +38 -0
- package/core/planning/unit_kind.py +122 -0
- package/core/probes/INTERFACE.md +83 -0
- package/core/probes/README.md +51 -0
- package/core/probes/SPEC.md +36 -0
- package/core/probes/__init__.py +76 -0
- package/core/probes/android_probe.py +552 -0
- package/core/probes/base.py +147 -0
- package/core/probes/codebase_memory_probe.py +647 -0
- package/core/probes/desktop_probe.py +342 -0
- package/core/probes/differential_probe.py +434 -0
- package/core/probes/efficiency_probe.py +232 -0
- package/core/probes/ios_binary_probe.py +472 -0
- package/core/probes/memory_probe.py +392 -0
- package/core/probes/miniprogram_probe.py +385 -0
- package/core/probes/mobile_probe.py +466 -0
- package/core/probes/native_probe.py +302 -0
- package/core/probes/openwiki_probe.py +263 -0
- package/core/probes/pattern_probe.py +453 -0
- package/core/probes/platform_probe.py +424 -0
- package/core/probes/probe_registry.py +1770 -0
- package/core/probes/sast_fixture_corpus.py +340 -0
- package/core/probes/sast_probe.py +1510 -0
- package/core/probes/sast_rules.py +1481 -0
- package/core/probes/sca_scanner.py +779 -0
- package/core/probes/ui_accessibility.py +149 -0
- package/core/probes/ui_audit.py +513 -0
- package/core/probes/ui_contract.py +273 -0
- package/core/probes/ui_evidence.py +212 -0
- package/core/probes/ui_measurements.py +314 -0
- package/core/probes/ui_repair.py +250 -0
- package/core/probes/ui_review.py +133 -0
- package/core/probes/ui_storybook.py +107 -0
- package/core/probes/ui_tokens.py +185 -0
- package/core/probes/ui_visual_diff.py +131 -0
- package/core/probes/web_probe.py +714 -0
- package/core/project_profiler/INTERFACE.md +62 -0
- package/core/project_profiler/README.md +53 -0
- package/core/project_profiler/SPEC.md +28 -0
- package/core/project_profiler/__init__.py +201 -0
- package/core/project_profiler/arbitrator.py +316 -0
- package/core/project_profiler/constants.py +247 -0
- package/core/project_profiler/detector.py +399 -0
- package/core/project_profiler/extractors.py +836 -0
- package/core/project_profiler/fingerprint.py +116 -0
- package/core/project_profiler/storage.py +258 -0
- package/core/project_profiler/strategy.py +301 -0
- package/core/prompts/README.md +35 -0
- package/core/prompts/codex_dialog_dispatch.md +9 -0
- package/core/prompts/command_routing_en.md +42 -0
- package/core/prompts/command_routing_zh.md +42 -0
- package/core/prompts/l0_router.md +47 -0
- package/core/prompts/rules/anti_patterns.md +16 -0
- package/core/prompts/rules/concurrency_rules.md +14 -0
- package/core/prompts/rules/memory_leak_rules.md +13 -0
- package/core/prompts/rules/prompt_injection_defense.md +13 -0
- package/core/prompts/stages/stage_explore.md +31 -0
- package/core/prompts/stages/stage_gate.md +43 -0
- package/core/prompts/stages/stage_mutate.md +42 -0
- package/core/prompts/stages/stage_repair.md +85 -0
- package/core/repair/README.md +74 -0
- package/core/repair/__init__.py +169 -0
- package/core/repair/fix_watchlist.py +391 -0
- package/core/repair/l7_dynamic.py +418 -0
- package/core/repair/l7_repair_loop.py +462 -0
- package/core/repair/l7_selfcheck.py +862 -0
- package/core/repair/minimize_repro.py +466 -0
- package/core/repair/patch_synthesizer.py +617 -0
- package/core/repair/regression_pack.py +379 -0
- package/core/repair/rsi_fixer.py +910 -0
- package/core/repair/rsi_loop.py +311 -0
- package/core/repair/rsi_repair.py +348 -0
- package/core/repair/rsi_rounds.py +212 -0
- package/core/repair/rsi_scope.py +281 -0
- package/core/repair/self_heal.py +604 -0
- package/core/repair/test_generator.py +1108 -0
- package/core/repair/test_quality_auditor.py +410 -0
- package/core/repair/test_strategy.py +511 -0
- package/core/report_engine/INTERFACE.md +59 -0
- package/core/report_engine/README.md +69 -0
- package/core/report_engine/SPEC.md +28 -0
- package/core/report_engine/__init__.py +47 -0
- package/core/report_engine/attestation.py +228 -0
- package/core/report_engine/authority.py +255 -0
- package/core/report_engine/finding_report.py +418 -0
- package/core/report_engine/formal_report_builder.py +924 -0
- package/core/report_engine/html_renderers.py +696 -0
- package/core/report_engine/models.py +759 -0
- package/core/report_engine/pdf_exporter.py +231 -0
- package/core/report_engine/projects_assets.py +730 -0
- package/core/report_engine/report_client.py +743 -0
- package/core/report_engine/report_data_builder.py +388 -0
- package/core/report_engine/report_share.py +459 -0
- package/core/report_engine/sast_bridge.py +116 -0
- package/core/report_engine/server.py +832 -0
- package/core/report_engine/visual_report_builder.py +796 -0
- package/core/report_engine/web-conformance.md +168 -0
- package/core/report_engine/web_conformance.py +428 -0
- package/core/report_engine/workbench_assets.py +484 -0
- package/core/retrieval/INTERFACE.md +20 -0
- package/core/retrieval/README.md +161 -0
- package/core/retrieval/SPEC.md +25 -0
- package/core/retrieval/__init__.py +3 -0
- package/core/retrieval/code_analyzer.py +1720 -0
- package/core/retrieval/codebase_memory_bridge.py +337 -0
- package/core/retrieval/context_assembler.py +240 -0
- package/core/retrieval/corpus_fetch.py +369 -0
- package/core/retrieval/graph_ego.py +597 -0
- package/core/retrieval/knowledge_auto.py +662 -0
- package/core/retrieval/knowledge_sources.py +168 -0
- package/core/retrieval/knowledge_sync.py +1003 -0
- package/core/retrieval/memory_store.py +480 -0
- package/core/retrieval/query_planner.py +1020 -0
- package/core/retrieval/rrf_engine.py +137 -0
- package/core/retrieval/slice_extractor.py +1209 -0
- package/core/retrieval/slice_normalizer.py +373 -0
- package/core/retrieval/slice_spec.py +357 -0
- package/core/retrieval/symbol_index.py +1151 -0
- package/core/retrieval/universal_code_matcher.py +622 -0
- package/core/retrieval/xerj_bridge.py +476 -0
- package/core/retrieval/xerj_supervisor.py +362 -0
- package/core/rules/README.md +33 -0
- package/core/rules/ios/PROVENANCE.json +30 -0
- package/core/rules/ios/crypto.yaml +36 -0
- package/core/rules/ios/network.yaml +20 -0
- package/core/rules/ios/resilience.yaml +47 -0
- package/core/rules/ios/storage.yaml +48 -0
- package/core/rules/mastg/LICENSE +173 -0
- package/core/rules/mastg/PROVENANCE.json +270 -0
- package/core/rules/mastg/mastg-android-asymmetric-key-pair-used-for-multiple-purposes.yml +13 -0
- package/core/rules/mastg/mastg-android-backup-manifest.yml +24 -0
- package/core/rules/mastg/mastg-android-biometric-event-bound.yml +49 -0
- package/core/rules/mastg/mastg-android-biometric-invalidated-enrollment.yml +11 -0
- package/core/rules/mastg/mastg-android-biometric-no-confirmation-required.yml +10 -0
- package/core/rules/mastg/mastg-android-biometric-validity-duration.yml +24 -0
- package/core/rules/mastg/mastg-android-broken-encryption-algorithms.yaml +9 -0
- package/core/rules/mastg/mastg-android-broken-encryption-modes.yaml +13 -0
- package/core/rules/mastg/mastg-android-content-provider-exported.yml +35 -0
- package/core/rules/mastg/mastg-android-custom-deeplink-scheme.yml +29 -0
- package/core/rules/mastg/mastg-android-dangerous-app-permissions.yaml +65 -0
- package/core/rules/mastg/mastg-android-data-unencrypted-shared-storage-no-user-interaction-apis.yml +36 -0
- package/core/rules/mastg/mastg-android-data-unencrypted-shared-storage-no-user-interaction-manifest.yml +15 -0
- package/core/rules/mastg/mastg-android-debuggable-flag.yml +10 -0
- package/core/rules/mastg/mastg-android-debugger-checks.yml +12 -0
- package/core/rules/mastg/mastg-android-deeplink-autoverify-missing.yml +33 -0
- package/core/rules/mastg/mastg-android-deeplink-unvalidated-parameter.yml +11 -0
- package/core/rules/mastg/mastg-android-device-passcode-present.yml +17 -0
- package/core/rules/mastg/mastg-android-fileprovider-broad-scope.yml +46 -0
- package/core/rules/mastg/mastg-android-hardcoded-crypto-keys-usage.yml +14 -0
- package/core/rules/mastg/mastg-android-hardcoded-security-provider.yaml +18 -0
- package/core/rules/mastg/mastg-android-implicit-intent-internal-communication.yml +30 -0
- package/core/rules/mastg/mastg-android-implicit-intent-leaking-extras.yml +29 -0
- package/core/rules/mastg/mastg-android-input-field-usage.yml +11 -0
- package/core/rules/mastg/mastg-android-key-generation-with-insufficient-key-length.yml +21 -0
- package/core/rules/mastg/mastg-android-keyboard-cache-input-types.yml +10 -0
- package/core/rules/mastg/mastg-android-local-storage-input-validation.yml +48 -0
- package/core/rules/mastg/mastg-android-native-debugger-checks.yml +12 -0
- package/core/rules/mastg/mastg-android-network-checkservertrusted.yml +12 -0
- package/core/rules/mastg/mastg-android-network-hostname-verification.yml +11 -0
- package/core/rules/mastg/mastg-android-network-insecure-trust-anchors.yml +11 -0
- package/core/rules/mastg/mastg-android-network-onreceivedsslerror.yml +12 -0
- package/core/rules/mastg/mastg-android-non-random-use.yml +16 -0
- package/core/rules/mastg/mastg-android-object-deserialization.yml +14 -0
- package/core/rules/mastg/mastg-android-overlay-protection.yml +68 -0
- package/core/rules/mastg/mastg-android-pendingintent-mutable.yml +39 -0
- package/core/rules/mastg/mastg-android-random-apis-insufficient-entropy.yml +17 -0
- package/core/rules/mastg/mastg-android-root-detection.yaml +59 -0
- package/core/rules/mastg/mastg-android-sdk-version.yml +10 -0
- package/core/rules/mastg/mastg-android-sensitive-data-in-notifications-manifest.yml +17 -0
- package/core/rules/mastg/mastg-android-sensitive-data-in-notifications.yml +11 -0
- package/core/rules/mastg/mastg-android-sensitive-data-in-screenshot.yml +18 -0
- package/core/rules/mastg/mastg-android-sql-injection-contentprovider.yml +17 -0
- package/core/rules/mastg/mastg-android-ssl-socket-hostnameverifier.yml +15 -0
- package/core/rules/mastg/mastg-android-strictmode.yml +10 -0
- package/core/rules/mastg/mastg-android-system-alert-window.yml +9 -0
- package/core/rules/mastg/mastg-android-webview-allow-local-access.yml +15 -0
- package/core/rules/mastg/mastg-android-webview-bridges.yml +28 -0
- package/core/rules/mastg/mastg-android-webview-safebrowsing.yml +20 -0
- package/core/rules/mastg/mastg-android-webview-url-handlers.yml +41 -0
- package/core/rules/miniprogram/PROVENANCE.json +26 -0
- package/core/rules/miniprogram/network.yaml +37 -0
- package/core/rules/miniprogram/platform.yaml +36 -0
- package/core/rules/miniprogram/storage.yaml +48 -0
- package/core/rules/mobsfscan-swift/LICENSE +165 -0
- package/core/rules/mobsfscan-swift/PROVENANCE.json +58 -0
- package/core/rules/mobsfscan-swift/auth.yaml +59 -0
- package/core/rules/mobsfscan-swift/crypto.yaml +66 -0
- package/core/rules/mobsfscan-swift/jailbreak.yaml +14 -0
- package/core/rules/mobsfscan-swift/keyboard.yaml +34 -0
- package/core/rules/mobsfscan-swift/logging.yaml +23 -0
- package/core/rules/mobsfscan-swift/network.yaml +55 -0
- package/core/rules/mobsfscan-swift/resilience.yaml +29 -0
- package/core/rules/mobsfscan-swift/secrets.yaml +33 -0
- package/core/rules/mobsfscan-swift/storage.yaml +29 -0
- package/core/rules/mobsfscan-swift/webview.yaml +32 -0
- package/core/runtime/README.md +198 -0
- package/core/runtime/__init__.py +3 -0
- package/core/runtime/bugx_logging.py +1464 -0
- package/core/runtime/daemon_runner.py +623 -0
- package/core/runtime/fixture_solidify.py +444 -0
- package/core/runtime/global_telemetry.py +549 -0
- package/core/runtime/incident_eval.py +148 -0
- package/core/runtime/interaction.py +605 -0
- package/core/runtime/interaction_store.py +435 -0
- package/core/runtime/interactive_menu.py +95 -0
- package/core/runtime/log_analytics.py +922 -0
- package/core/runtime/mining_quality_framework.py +1387 -0
- package/core/runtime/model_runner.py +732 -0
- package/core/runtime/platform_adapter.py +579 -0
- package/core/runtime/prep_validate.py +478 -0
- package/core/runtime/project_graph.py +827 -0
- package/core/runtime/project_init.py +481 -0
- package/core/runtime/project_profile.py +224 -0
- package/core/runtime/project_settings.py +964 -0
- package/core/runtime/provider_window.py +97 -0
- package/core/runtime/resume_ticket.py +115 -0
- package/core/runtime/scenario_eval.py +856 -0
- package/core/runtime/seed_drill.py +549 -0
- package/core/runtime/self_audit.py +550 -0
- package/core/runtime/session_profile.py +205 -0
- package/core/runtime/setup_ui_env.py +229 -0
- package/core/runtime/startup_environment.py +859 -0
- package/core/runtime/sync_store.py +1421 -0
- package/core/runtime/tool_install_targets.py +18 -0
- package/core/schemas/README.md +35 -0
- package/core/schemas/agent-graph.schema.json +368 -0
- package/core/schemas/attack-graph.schema.json +88 -0
- package/core/schemas/evidence-bundle.schema.json +33 -0
- package/core/schemas/skill-pack.schema.json +230 -0
- package/core/schemas/worker-checkpoint.schema.json +119 -0
- package/core/secure_atomic.py +289 -0
- package/core/seed_corpus/README.md +55 -0
- package/core/seed_corpus/c.txt +29 -0
- package/core/seed_corpus/cpp.txt +32 -0
- package/core/seed_corpus/css.txt +70 -0
- package/core/seed_corpus/go.txt +46 -0
- package/core/seed_corpus/java.txt +30 -0
- package/core/seed_corpus/javascript.txt +55 -0
- package/core/seed_corpus/kotlin.txt +28 -0
- package/core/seed_corpus/python.txt +71 -0
- package/core/seed_corpus/rust.txt +53 -0
- package/core/seed_corpus/swift.txt +29 -0
- package/core/seed_corpus/typescript.txt +29 -0
- package/core/skills/README.md +53 -0
- package/core/skills/__init__.py +189 -0
- package/core/skills/bugx_docs_mcp_server.py +418 -0
- package/core/skills/bugx_mcp_server.py +1161 -0
- package/core/skills/mcp_runtime.py +968 -0
- package/core/skills/mcp_session_proof.py +605 -0
- package/core/skills/mobile_ui_inspector.py +405 -0
- package/core/skills/skill_pack.py +1214 -0
- package/core/skills/skill_synthesizer.py +1153 -0
- package/core/skills/tools_kb.py +313 -0
- package/core/supervisor/INTERFACE.md +121 -0
- package/core/supervisor/README.md +209 -0
- package/core/supervisor/SPEC.md +25 -0
- package/core/supervisor/__init__.py +175 -0
- package/core/supervisor/audit_supervisor.py +1015 -0
- package/core/supervisor/budget_governor.py +1254 -0
- package/core/supervisor/checkpoint_handler.py +368 -0
- package/core/supervisor/checkpoint_pipeline.py +1564 -0
- package/core/supervisor/checkpoint_sync.py +653 -0
- package/core/supervisor/claim_events.py +74 -0
- package/core/supervisor/claim_sync.py +590 -0
- package/core/supervisor/cli.py +812 -0
- package/core/supervisor/context_sync.py +55 -0
- package/core/supervisor/coverage_sync.py +115 -0
- package/core/supervisor/finding_commit.py +470 -0
- package/core/supervisor/finding_sync.py +688 -0
- package/core/supervisor/finding_workflow.py +676 -0
- package/core/supervisor/finish_policy.py +224 -0
- package/core/supervisor/finish_sync.py +185 -0
- package/core/supervisor/graph_sync.py +669 -0
- package/core/supervisor/lease_manager.py +788 -0
- package/core/supervisor/lifecycle_blocks.py +129 -0
- package/core/supervisor/next_round_sync.py +126 -0
- package/core/supervisor/observability.py +140 -0
- package/core/supervisor/recovery_sync.py +165 -0
- package/core/supervisor/rejection_remedies.py +355 -0
- package/core/supervisor/round_governor.py +306 -0
- package/core/supervisor/serial_authorization.py +544 -0
- package/core/supervisor/start_sync.py +87 -0
- package/core/supervisor/state_store.py +249 -0
- package/core/supervisor/supervisor_host.py +511 -0
- package/core/supervisor/supervisor_models.py +1143 -0
- package/core/supervisor/systemic_failure.py +104 -0
- package/core/supervisor/task_scheduler.py +1640 -0
- package/core/supervisor/worker_checkpoint.py +230 -0
- package/core/supervisor/worker_execution.py +265 -0
- package/core/supervisor/worker_handoff.py +192 -0
- package/core/supervisor/worker_lifecycle.py +396 -0
- package/core/supervisor/worker_runtime.py +1005 -0
- package/core/supervisor/worker_sync.py +89 -0
- package/core/supervisor_types/README.md +36 -0
- package/core/supervisor_types/__init__.py +0 -0
- package/core/supervisor_types/exceptions.py +52 -0
- package/core/supervisor_types/graph_models.py +357 -0
- package/core/supervisor_types/path_containment.py +151 -0
- package/core/supervisor_types/target_fingerprint.py +310 -0
- package/core/supervisor_types/worker_claim.py +411 -0
- package/core/webui/INTERFACE.md +50 -0
- package/core/webui/README.md +57 -0
- package/core/webui/SPEC.md +26 -0
- package/core/webui/__init__.py +11 -0
- package/core/webui/adapters/__init__.py +27 -0
- package/core/webui/adapters/base.py +87 -0
- package/core/webui/adapters/bugx.py +102 -0
- package/core/webui/adapters/claude.py +222 -0
- package/core/webui/adapters/cline.py +407 -0
- package/core/webui/adapters/codex.py +260 -0
- package/core/webui/adapters/dsh.py +177 -0
- package/core/webui/adapters/opencode.py +218 -0
- package/core/webui/adapters/pi.py +272 -0
- package/core/webui/adapters/registry.py +100 -0
- package/core/webui/adapters/zcode.py +312 -0
- package/core/webui/api_routes_post.py +668 -0
- package/core/webui/dispatcher.py +1376 -0
- package/core/webui/docs_session_service.py +473 -0
- package/core/webui/handler.py +674 -0
- package/core/webui/ide_cloud_service.py +526 -0
- package/core/webui/mcp_inspector.py +1747 -0
- package/core/webui/static/00-base.css +1060 -0
- package/core/webui/static/01-monitoring.css +802 -0
- package/core/webui/static/02-header-actions.css +321 -0
- package/core/webui/static/03-trigger-popover.css +697 -0
- package/core/webui/static/04-composer.css +628 -0
- package/core/webui/static/05-skills-center.css +878 -0
- package/core/webui/static/06-mcp-center.css +623 -0
- package/core/webui/static/07-skill-detail.css +265 -0
- package/core/webui/static/08-files-management.css +167 -0
- package/core/webui/static/09-files-center.css +386 -0
- package/core/webui/static/10-icons.css +105 -0
- package/core/webui/static/11-project-options.css +185 -0
- package/core/webui/static/12-profile-tab.css +383 -0
- package/core/webui/static/assets/index-CXAsl8mr.js +333 -0
- package/core/webui/static/assets/index-DHQUtWtx.css +1 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-400-normal-B8Z6Jvzv.woff +0 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-400-normal-C44pakCn.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-500-normal-Bb4u56_6.woff +0 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-500-normal-BdVUvljg.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-ext-400-normal-CWV284fw.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-ext-400-normal-DLkyKLvH.woff +0 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-ext-500-normal-8-8HP2PF.woff +0 -0
- package/core/webui/static/assets/source-serif-4-cyrillic-ext-500-normal-DaDZE_Na.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-greek-400-normal-BccYJ-vZ.woff +0 -0
- package/core/webui/static/assets/source-serif-4-greek-400-normal-Cw5-AHNN.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-greek-500-normal-By8GFJzz.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-greek-500-normal-z-Q6FFuG.woff +0 -0
- package/core/webui/static/assets/source-serif-4-latin-400-normal-DJ5YJwmz.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-latin-400-normal-Dn3IlU-Z.woff +0 -0
- package/core/webui/static/assets/source-serif-4-latin-500-normal-CUHe9xxf.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-latin-500-normal-DVVamBqs.woff +0 -0
- package/core/webui/static/assets/source-serif-4-latin-ext-400-normal-CEpydyUl.woff +0 -0
- package/core/webui/static/assets/source-serif-4-latin-ext-400-normal-Cp7z-ARB.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-latin-ext-500-normal-BYjRCDVy.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-latin-ext-500-normal-D-qasQTj.woff +0 -0
- package/core/webui/static/assets/source-serif-4-vietnamese-400-normal-BbG3LG1A.woff2 +0 -0
- package/core/webui/static/assets/source-serif-4-vietnamese-400-normal-DR1UuFon.woff +0 -0
- package/core/webui/static/assets/source-serif-4-vietnamese-500-normal-8N8MYVKB.woff +0 -0
- package/core/webui/static/assets/source-serif-4-vietnamese-500-normal-Bi3OSTTW.woff2 +0 -0
- package/core/webui/static/design-tokens.css +113 -0
- package/core/webui/static/favicon.png +0 -0
- package/core/webui/static/icon-192.png +0 -0
- package/core/webui/static/index.html +55 -0
- package/core/webui/static/manifest.webmanifest +19 -0
- package/core/webui/static/project-settings.js +9602 -0
- package/core/webui/static/sw.js +8 -0
- package/core/webui/workspace_service.py +218 -0
- package/docs/07_distribution/01_README_NPM.md +285 -0
- package/ecosystem/README.md +129 -0
- package/ecosystem/integrations/README.md +38 -0
- package/ecosystem/integrations/cline/skills/bugx/SKILL.md +69 -0
- package/ecosystem/integrations/dsh/agents/bugx.md +27 -0
- package/ecosystem/integrations/dsh/dsh-patch.yml +18 -0
- package/ecosystem/integrations/dsh/mcp/cordis.patch.yml +4 -0
- package/ecosystem/integrations/dsh/mcp/index.js +219 -0
- package/ecosystem/integrations/dsh/mcp/package.json +28 -0
- package/ecosystem/integrations/dsh/skills/bugx/SKILL.md +70 -0
- package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +229 -0
- package/ecosystem/integrations/dsh/ui/client.js +87 -0
- package/ecosystem/integrations/dsh/ui/cordis.patch.yml +4 -0
- package/ecosystem/integrations/dsh/ui/index.js +7 -0
- package/ecosystem/integrations/dsh/ui/package.json +27 -0
- package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +53 -0
- package/ecosystem/integrations/opencode/mcp-lock.json +3075 -0
- package/ecosystem/integrations/opencode/opencode.json +129 -0
- package/ecosystem/integrations/pi/extensions/bugx/README.md +12 -0
- package/ecosystem/integrations/pi/extensions/bugx/index.ts +299 -0
- package/ecosystem/integrations/pi/extensions/bugx/manifest.json +11 -0
- package/ecosystem/integrations/pi/skills/bugx/SKILL.md +69 -0
- package/ecosystem/integrations/qoder/CONNECTORS.md +54 -0
- package/ecosystem/integrations/qoder/connector-meta.json +21 -0
- package/ecosystem/integrations/workbuddy/connector-meta.json +19 -0
- package/ecosystem/integrations/workbuddy/icon.png +0 -0
- package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +70 -0
- package/ecosystem/plugins/README.md +37 -0
- package/ecosystem/plugins/bugx/.claude-plugin/marketplace.json +17 -0
- package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +16 -0
- package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +41 -0
- package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +19 -0
- package/ecosystem/plugins/bugx/agents/bugx-judge.md +71 -0
- package/ecosystem/plugins/bugx/agents/bugx-worker.md +31 -0
- package/ecosystem/plugins/bugx/agents/bugx.md +74 -0
- package/ecosystem/plugins/bugx/assets/bugx-avatar-512.png +0 -0
- package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +118 -0
- package/ecosystem/plugins/bugx/skills/bugx-claude/SKILL.md +326 -0
- package/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +229 -0
- package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +129 -0
- package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +459 -0
- package/interfaces/bin/bugx.js +117 -0
- package/interfaces/cli/bugx_cli/__init__.py +6 -0
- package/interfaces/cli/bugx_cli/cli.py +1685 -0
- package/interfaces/cli/bugx_cli/commands/__init__.py +1 -0
- package/interfaces/cli/bugx_cli/commands/advisory.py +94 -0
- package/interfaces/cli/bugx_cli/commands/agent.py +4210 -0
- package/interfaces/cli/bugx_cli/commands/audit.py +632 -0
- package/interfaces/cli/bugx_cli/commands/autonomous.py +260 -0
- package/interfaces/cli/bugx_cli/commands/cloud.py +1371 -0
- package/interfaces/cli/bugx_cli/commands/daemon.py +50 -0
- package/interfaces/cli/bugx_cli/commands/doctor.py +1590 -0
- package/interfaces/cli/bugx_cli/commands/goal.py +107 -0
- package/interfaces/cli/bugx_cli/commands/interaction.py +248 -0
- package/interfaces/cli/bugx_cli/commands/knowledge.py +619 -0
- package/interfaces/cli/bugx_cli/commands/lifecycle.py +2763 -0
- package/interfaces/cli/bugx_cli/commands/patch.py +1014 -0
- package/interfaces/cli/bugx_cli/commands/plugin.py +2749 -0
- package/interfaces/cli/bugx_cli/commands/plugin_claude.py +1446 -0
- package/interfaces/cli/bugx_cli/commands/plugin_cline.py +269 -0
- package/interfaces/cli/bugx_cli/commands/plugin_codex.py +74 -0
- package/interfaces/cli/bugx_cli/commands/plugin_funide.py +729 -0
- package/interfaces/cli/bugx_cli/commands/plugin_qoder.py +216 -0
- package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +710 -0
- package/interfaces/cli/bugx_cli/commands/project.py +670 -0
- package/interfaces/cli/bugx_cli/commands/report.py +256 -0
- package/interfaces/cli/bugx_cli/commands/skill.py +251 -0
- package/interfaces/cli/bugx_cli/commands/stats.py +133 -0
- package/interfaces/cli/bugx_cli/commands/system.py +2567 -0
- package/interfaces/cli/bugx_cli/common.py +906 -0
- package/interfaces/cli/bugx_cli/host_adapters.py +1892 -0
- package/interfaces/cli/bugx_cli/hosts/__init__.py +80 -0
- package/interfaces/cli/bugx_cli/hosts/base.py +99 -0
- package/interfaces/cli/bugx_cli/hosts/registry.py +573 -0
- package/interfaces/cli/bugx_cli/hosts/template_engine.py +188 -0
- package/interfaces/cli/bugx_cli/infra/__init__.py +209 -0
- package/interfaces/cli/bugx_cli/infra/ai_advisor.py +851 -0
- package/interfaces/cli/bugx_cli/infra/engine_installer.py +1945 -0
- package/interfaces/cli/bugx_cli/infra/host_sync.py +548 -0
- package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +826 -0
- package/interfaces/cli/bugx_cli/infra/security.py +339 -0
- package/package.json +99 -4
- package/pyproject.toml +258 -0
- package/scripts/ensure-python.mjs +97 -0
- package/scripts/isolate-npm-readme.mjs +40 -0
- package/scripts/runtime.lock.json +31 -0
- package/scripts/sync-version.mjs +26 -0
- package/scripts/test-npm-wrapper.mjs +265 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# 工具知识库
|
|
2
|
+
|
|
3
|
+
这是公开 BugX 的通用工具目录。它只记录适用于源码、API、CLI、TUI、Web UI、
|
|
4
|
+
桌面/移动应用和运行时质量验证的工具。目标专用工具应在对应扩展中登记。
|
|
5
|
+
|
|
6
|
+
## 30 天有效目录
|
|
7
|
+
|
|
8
|
+
| 工具 | 用途 | 来源 | 验证版本 | 验证日期 |
|
|
9
|
+
|------|------|------|----------|----------|
|
|
10
|
+
| ripgrep | 文本、错误消息和配置值搜索 | https://github.com/BurntSushi/ripgrep | 15.2.0 | 2026-10-16 |
|
|
11
|
+
| ast-grep | AST 结构搜索与局部模式核对 | https://github.com/ast-grep/ast-grep | 0.45.3 | 2026-10-16 |
|
|
12
|
+
| jq | JSON/SARIF 输出筛选 | https://github.com/jqlang/jq | 1.8.2 | 2026-10-16 |
|
|
13
|
+
| Playwright | Web UI 快照、交互、网络和截图证据 | https://playwright.dev | 0.0.79(仓库锁定) | 2026-09-23 |
|
|
14
|
+
| postmcp | API 契约、状态码和响应断言 | https://github.com/Bencibr/postmcp | 1.0.3(仓库锁定) | 2026-09-23 |
|
|
15
|
+
| Schemathesis | OpenAPI 属性与有状态 API 测试 | https://github.com/schemathesis/schemathesis | 4.27.1 | 2026-10-16 |
|
|
16
|
+
| RESTler | OpenAPI 驱动的 REST 状态序列测试 | https://github.com/microsoft/restler-fuzzer | 9.3.1 | 2026-10-16 |
|
|
17
|
+
| k6 | 授权测试环境的限速并发和幂等验证 | https://github.com/grafana/k6 | 2.2.0 | 2026-10-16 |
|
|
18
|
+
| Vegeta | 有上限的 HTTP 速率验证 | https://github.com/tsenart/vegeta | 12.13.0 | 2026-10-16 |
|
|
19
|
+
| codebase-memory-mcp | 持久化符号、调用和架构关系图 | https://github.com/DeusData/codebase-memory-mcp | 固定规格见 `core/runtime/tool_install_targets.py` | 2026-10-30 |
|
|
20
|
+
| Semgrep | 规则驱动 SAST:已知漏洞模式扫描(SQLi/XSS/SSRF/RCE) | https://github.com/semgrep/semgrep | 1.80.0 | 2026-09-27 |
|
|
21
|
+
| CodeQL | 语义级污点分析与变体分析(Source→Sink 数据流) | https://github.com/github/codeql | 2.18.0 | 2026-09-27 |
|
|
22
|
+
| Trivy | 依赖包漏洞(SCA)与容器配置扫描 | https://github.com/aquasecurity/trivy | 0.54.0 | 2026-09-27 |
|
|
23
|
+
| Bandit | Python 轻量 SAST(安全反模式检测) | https://github.com/PyCQA/bandit | 1.8.6 | 2026-09-27 |
|
|
24
|
+
| BugX Web Conformance | 内置 HTML/ARIA 静态基线与浏览器动态合规清单 | 本地 `web_conformance.py` | 0.6.46 | 2026-09-27 |
|
|
25
|
+
| Maestro | 移动端声明式 E2E:YAML 弹窗/滚动/长文本遍历(Tier-2) | https://github.com/mobile-dev-inc/maestro | 1.40.0 | 2026-09-27 |
|
|
26
|
+
| Appium | 跨平台设备驱动 REST:`/source`、`/element/{id}/click` 透传(Tier-3) | https://github.com/appium/appium | 2.12.0 | 2026-09-27 |
|
|
27
|
+
| uiautomator2 | Android 免权限 UI 树快速提取(Tier-1 备选,**不在 mobile_probe.py 探测范围**;需用时手动 `pip install` 并记录版本) | https://github.com/openatx/uiautomator2 | 待验证 | 2026-09-27 |
|
|
28
|
+
| mitmproxy | 移动端 API 流量抓包与并发 Fuzzing(网络轨,**不在 mobile_probe.py 探测范围**;需用时手动安装并记录版本) | https://github.com/mitmproxy/mitmproxy | 待验证 | 2026-09-27 |
|
|
29
|
+
## 使用规则
|
|
30
|
+
|
|
31
|
+
- 先查本地目录;验证日期超过 30 天必须重新核对来源和版本。
|
|
32
|
+
- 工具不存在、版本不兼容或输出解析失败时标记 `DEGRADED/BLOCKED`,不能伪造 PASS。
|
|
33
|
+
- 必备 MCP(Playwright、postmcp)使用仓库锁定版本;codebase-memory-mcp 的安装与探针只读取
|
|
34
|
+
`core/runtime/tool_install_targets.py` 中的固定规格,不得另设版本来源。启动记录仍保存实际解析到的版本,便于复盘。
|
|
35
|
+
- 只选当前目标需要的工具,不为“工具齐全”自动安装全部依赖。
|
|
36
|
+
- 主动请求、生产写入和外部服务访问必须由目标所有者明确授权,并记录白名单、速率、
|
|
37
|
+
并发、总量、时长和停止条件。
|
|
38
|
+
- 私有专项插件有自己的工具知识库和准备门禁;核心 Agent 不跨边界复用其结论。
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""core/unit_kind.py - coverage unit 类型前缀的单一来源(DES-05)。
|
|
3
|
+
|
|
4
|
+
审计发现 ``"内部:"`` / ``"业务:"`` 两个字面量散落在 6+ 模块的十余处
|
|
5
|
+
``startswith`` 判断中,而阶段名的唯一常量 ``VALID_PHASES`` 只在
|
|
6
|
+
``module_coverage`` 内定义。新增单元类型时必须同步改动所有位置,**漏掉任何
|
|
7
|
+
一处都会导致静默误分类**——例如新类型被当作 business 处理,从而绕过
|
|
8
|
+
「内部优先」这一阶段级硬边界(``task_scheduler`` 里价值 1000 分的绝对优先级)。
|
|
9
|
+
|
|
10
|
+
本模块把前缀定义、解析与格式化收敛为单点 API:
|
|
11
|
+
|
|
12
|
+
* 判断类型一律走 :func:`is_internal` / :func:`is_business`;
|
|
13
|
+
* 剥离前缀走 :func:`parse_unit_id` / :func:`strip_unit_prefix`;
|
|
14
|
+
* 构造 ID 走 :func:`format_unit_id`;
|
|
15
|
+
* 需要遍历全部前缀时用 :data:`PREFIXES`,不要重新写字面量元组。
|
|
16
|
+
|
|
17
|
+
``VALID_PHASES`` 在此重新导出,供 ``module_coverage`` 复用,避免阶段名集合
|
|
18
|
+
与前缀定义再次漂移。
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
from enum import Enum
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class UnitKind(str, Enum):
|
|
27
|
+
"""coverage unit 的阶段类型。
|
|
28
|
+
|
|
29
|
+
继承 ``str`` 以便与既有字符串比较、序列化和 JSON 落盘保持兼容
|
|
30
|
+
(``UnitKind.INTERNAL == "内部"`` 成立)。
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
INTERNAL = "内部"
|
|
34
|
+
BUSINESS = "业务"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
#: 单元 ID 中类型前缀与正文之间的分隔符。
|
|
38
|
+
SEPARATOR = ":"
|
|
39
|
+
|
|
40
|
+
#: 全部已知前缀(含分隔符),顺序即「内部优先」的优先级顺序。
|
|
41
|
+
PREFIXES: tuple[str, ...] = tuple(f"{kind.value}{SEPARATOR}" for kind in UnitKind)
|
|
42
|
+
|
|
43
|
+
#: 阶段名集合。与 :data:`PREFIXES` 同源,供 ``module_coverage`` 复用。
|
|
44
|
+
VALID_PHASES = frozenset(kind.value for kind in UnitKind)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _as_text(unit_id: object) -> str:
|
|
48
|
+
"""把入参归一化为 ``str``;``None`` 视为空串,避免调用方到处判空。"""
|
|
49
|
+
return "" if unit_id is None else str(unit_id)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def unit_kind(unit_id: object) -> UnitKind | None:
|
|
53
|
+
"""返回单元 ID 的类型;前缀未知或缺失时返回 ``None``。
|
|
54
|
+
|
|
55
|
+
``None`` 表示「未知类型」而非「业务类型」——调用方若需要旧代码
|
|
56
|
+
``not unit_id.startswith("业务:")`` 的「非业务即内部」语义,应显式写成
|
|
57
|
+
``not is_business(unit_id)``,以免未知前缀被静默归入内部。
|
|
58
|
+
"""
|
|
59
|
+
text = _as_text(unit_id)
|
|
60
|
+
for kind in UnitKind:
|
|
61
|
+
if text.startswith(f"{kind.value}{SEPARATOR}"):
|
|
62
|
+
return kind
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def is_internal(unit_id: object) -> bool:
|
|
67
|
+
"""单元是否带 ``内部:`` 前缀。"""
|
|
68
|
+
return _as_text(unit_id).startswith(PREFIXES[0])
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def is_business(unit_id: object) -> bool:
|
|
72
|
+
"""单元是否带 ``业务:`` 前缀。"""
|
|
73
|
+
return _as_text(unit_id).startswith(PREFIXES[1])
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def strip_unit_prefix(unit_id: object) -> str:
|
|
77
|
+
"""剥离已知类型前缀;无已知前缀时原样返回(仅去首尾空白)。"""
|
|
78
|
+
text = _as_text(unit_id).strip()
|
|
79
|
+
for prefix in PREFIXES:
|
|
80
|
+
if text.startswith(prefix):
|
|
81
|
+
return text[len(prefix):]
|
|
82
|
+
return text
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def parse_unit_id(unit_id: object) -> tuple[UnitKind | None, str]:
|
|
86
|
+
"""拆出 ``(类型, 去前缀正文)``。
|
|
87
|
+
|
|
88
|
+
未知前缀时类型为 ``None`` 且正文为原文本,调用方据此决定是拒绝还是
|
|
89
|
+
按「未知类型」处理,不再依赖隐式的 ``startswith`` 兜底。
|
|
90
|
+
"""
|
|
91
|
+
text = _as_text(unit_id).strip()
|
|
92
|
+
kind = unit_kind(text)
|
|
93
|
+
if kind is None:
|
|
94
|
+
return None, text
|
|
95
|
+
return kind, strip_unit_prefix(text)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def format_unit_id(kind: UnitKind | str, body: object) -> str:
|
|
99
|
+
"""按统一格式构造单元 ID。
|
|
100
|
+
|
|
101
|
+
``kind`` 可传 :class:`UnitKind` 或等价字符串;非法类型直接报错,避免
|
|
102
|
+
拼出 ``"未知:xxx"`` 这类会被下游静默误分类的 ID。
|
|
103
|
+
"""
|
|
104
|
+
resolved = kind if isinstance(kind, UnitKind) else UnitKind(str(kind))
|
|
105
|
+
text = _as_text(body).strip()
|
|
106
|
+
if not text:
|
|
107
|
+
raise ValueError("单元正文不能为空")
|
|
108
|
+
return f"{resolved.value}{SEPARATOR}{text}"
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
__all__ = [
|
|
112
|
+
"UnitKind",
|
|
113
|
+
"SEPARATOR",
|
|
114
|
+
"PREFIXES",
|
|
115
|
+
"VALID_PHASES",
|
|
116
|
+
"unit_kind",
|
|
117
|
+
"is_internal",
|
|
118
|
+
"is_business",
|
|
119
|
+
"strip_unit_prefix",
|
|
120
|
+
"parse_unit_id",
|
|
121
|
+
"format_unit_id",
|
|
122
|
+
]
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# probes - Interface & API Contract
|
|
2
|
+
|
|
3
|
+
## 1. Domain Overview & Invariants
|
|
4
|
+
- **Package Path**: `core/probes`
|
|
5
|
+
- **Scope**: Public API and contracts for the `probes` domain.
|
|
6
|
+
- **Contract Boundary**: All external consumers must depend ONLY on symbols declared in this specification.
|
|
7
|
+
|
|
8
|
+
## 2. API Contract Specification
|
|
9
|
+
|
|
10
|
+
<!-- generated:begin -->
|
|
11
|
+
### Exported Public Interface (Auto-generated by `scripts/gen_interface_spec.py`)
|
|
12
|
+
|
|
13
|
+
> **Notice**: Do NOT edit this section manually. Any drift will be rejected by `test_spec_consistency`.
|
|
14
|
+
|
|
15
|
+
#### `class AndroidProbe(BaseProbe)` - Android 专属黑盒与静态结构降级探针。
|
|
16
|
+
- **Public Methods**:
|
|
17
|
+
- `adb_send_intent(self, device_id: str | None = None, action: str | None = None, component: str | None = None, data_uri: str | None = None, extras: Mapping[str, Any] | None = None, timeout: float = 10.0) -> dict[str, Any]`
|
|
18
|
+
- `get_device_lock(cls, device_id: str | None) -> threading.Lock`
|
|
19
|
+
- `is_available(self) -> bool`
|
|
20
|
+
- `parse_manifest(self, manifest_input: str | Path | bytes) -> dict[str, Any]`
|
|
21
|
+
- `probe_name(self) -> str`
|
|
22
|
+
- `run_dynamic(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
23
|
+
- `run_static_degraded(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
24
|
+
|
|
25
|
+
#### `class BaseProbe(abc.ABC)` - 领域形态专属黑盒探针抽象基类。
|
|
26
|
+
- **Public Methods**:
|
|
27
|
+
- `execute_probe(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, force_mode: str | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
28
|
+
- `is_available(self) -> bool`
|
|
29
|
+
- `probe_name(self) -> str`
|
|
30
|
+
- `run_dynamic(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
31
|
+
- `run_static_degraded(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
32
|
+
|
|
33
|
+
#### `class MiniProgramProbe(BaseProbe)` - 微信/支付宝小程序专属黑盒与静态降级探针。
|
|
34
|
+
- **Public Methods**:
|
|
35
|
+
- `is_available(self) -> bool`
|
|
36
|
+
- `parse_app_json(self, app_json_input: str | Path | dict[str, Any]) -> dict[str, Any]`
|
|
37
|
+
- `probe_cloud_functions(self, cloud_functions_dir: str | Path) -> dict[str, Any]`
|
|
38
|
+
- `probe_name(self) -> str`
|
|
39
|
+
- `run_dynamic(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
40
|
+
- `run_static_degraded(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
41
|
+
|
|
42
|
+
#### `class WebDynamicProbe(BaseProbe)` - Web 专属黑盒动态探针,支持 HTTP 原始发包与 Playwright 无头浏览器探针。
|
|
43
|
+
- **Public Methods**:
|
|
44
|
+
- `browser_slot(cls, timeout: float = 2.0)`
|
|
45
|
+
- `capture_browser_page(page: Any, url: str, *, browser_version: str, actions: Sequence[dict[str, Any]] | None = None, timeout: float = 10.0, screenshot_path: str | Path | None = None, screenshot_full_page: bool = True, screenshot_masks: Sequence[str] = (), wait_until: str = 'load', after_navigation: Callable[[Any], None] | None = None, inspect_page: Callable[[Any], Mapping[str, Any] | None] | None = None) -> dict[str, Any]`
|
|
46
|
+
- `classify_http_response(cls, response_data: Mapping[str, Any], baseline_data: Mapping[str, Any] | None = None) -> dict[str, Any]`
|
|
47
|
+
- `get_active_instances(cls) -> int`
|
|
48
|
+
- `headless_browser_action(self, url: str, actions: Sequence[dict[str, Any]] | None = None, timeout: float = 10.0, *, screenshot_path: str | Path | None = None, viewport: Mapping[str, int] | None = None) -> dict[str, Any]`
|
|
49
|
+
- `http_raw_request(self, url: str, method: str = 'GET', headers: Mapping[str, str] | None = None, data: bytes | str | None = None, timeout: float = 10.0) -> dict[str, Any]`
|
|
50
|
+
- `is_available(self) -> bool`
|
|
51
|
+
- `probe_name(self) -> str`
|
|
52
|
+
- `run_dynamic(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
53
|
+
- `run_static_degraded(self, target: str | Path, *, payload: dict[str, Any] | None = None, context: dict[str, Any] | None = None, **kwargs: Any) -> dict[str, Any]`
|
|
54
|
+
|
|
55
|
+
- **`module codebase_memory_probe`** - 探测 codebase-memory-mcp 安装、版本和当前仓库索引状态。
|
|
56
|
+
- **`module desktop_probe`** - 桌面应用项目预检(项目级、只读;不安装、不运行、不修改工程)。
|
|
57
|
+
- **`module differential_probe`** - differential_probe.py — 同一语料差分对照目标实现与参考实现。
|
|
58
|
+
- **`module efficiency_probe`** - 探测通用效率工具和文档 MCP;降级必须由调用方明确放行。
|
|
59
|
+
- **`module ios_binary_probe`** - iOS 二进制层探针:Mach-O / 代码签名 / entitlements / 加固属性。
|
|
60
|
+
- **`module memory_probe`** - 应用内存审计环境预检(只读,不安装工具、不修改目标或设备)。
|
|
61
|
+
- **`module mobile_probe`** - 移动端 UI 自动化驱动探针(DOC-015):三通道递进探测,READY/DEGRADED 退出语义。
|
|
62
|
+
- **`module native_probe`** - 原生/嵌入式项目预检(项目级、只读;不构建、不修改工程)。
|
|
63
|
+
- **`module openwiki_probe`** - OpenWiki 探针:探测目标仓库的 wiki 叙述层可用性与新鲜度(DOC-032)。
|
|
64
|
+
- **`module pattern_probe`** - pattern_probe.py — 把错题模式的「同类排查点」编译成可执行扫描。
|
|
65
|
+
- **`module platform_probe`** - 桌面端与移动端测试环境预检(只读,不自动安装或修改设备)。
|
|
66
|
+
- **`module probe_registry`** - BugX 探针插件注册中心(Probe Registry)。
|
|
67
|
+
- **`module sast_probe`** - 探测并执行 SAST 静态分析与轻量 SCA 依赖安全扫描 (DOC-061)。
|
|
68
|
+
- **`module sast_rules`** - core/sast_rules.py — 跨语言声明式安全规则库与 Schema 定义 (DOC-061)。
|
|
69
|
+
- **`module sca_scanner`** - core/sca_scanner.py — 零依赖全主流语言依赖包供应链安全扫描器 (DOC-061 / DOC-062)。
|
|
70
|
+
|
|
71
|
+
<!-- generated:end -->
|
|
72
|
+
|
|
73
|
+
## 3. Usage Examples & Defensive Patterns
|
|
74
|
+
The CLI registry exposes `bugx probe ui` through `ui_audit.py:main`. Rules are loaded by
|
|
75
|
+
`ui_contract.py`. `ui_accessibility.py` runs axe-core and keyboard steps,
|
|
76
|
+
`ui_evidence.py` verifies receipts, and `ui_visual_diff.py` compares reference captures.
|
|
77
|
+
`ui_storybook.py` resolves a deployed index and preview, and `ui_tokens.py` loads mapped
|
|
78
|
+
CSS values from project token JSON.
|
|
79
|
+
Browser measurements, model review and token repair remain internal to the CLI
|
|
80
|
+
implementation. Input, receipt and exit contracts are specified in
|
|
81
|
+
`core/report_engine/web-conformance.md`.
|
|
82
|
+
|
|
83
|
+
Refer to `SPEC.md` for architectural context, event topologies, and failure domain mappings.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# BugX Runtime Probes (多形态目标运行时探针)
|
|
2
|
+
|
|
3
|
+
`core/probes/` 为 BugX 提供了深入运行中应用内部的主动探针能力,支持对 Android 进程、微信小程序沙箱以及 Web 浏览器的运行态上下文、日志、网络请求与 DOM/视图树进行实时探测。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 架构拓扑 (Probe Matrix)
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart TD
|
|
11
|
+
BP["base.py<br/>BaseRuntimeProbe 抽象基类<br/>统一探针连接/心跳/指标拉取"]
|
|
12
|
+
BP --> AP["android_probe.py<br/>Android ADB / Logcat / dumpsys 运行时探针"]
|
|
13
|
+
BP --> MP["miniprogram_probe.py<br/>微信小程序开发者工具 / CLI 运行时探针"]
|
|
14
|
+
BP --> WP["web_probe.py<br/>CDP / Chrome DevTools 协议浏览器探针"]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 2. 模块文件物理索引与职责清单 (File Inventory)
|
|
20
|
+
|
|
21
|
+
| 文件名 | 职责与功能定位 | 关键类 / 函数 |
|
|
22
|
+
| :--- | :--- | :--- |
|
|
23
|
+
| `__init__.py` | Python 包初始化与核心模块符号导出 | `__all__` |
|
|
24
|
+
| `android_probe.py` | Android 真实设备或模拟器探针,提取 Logcat 崩溃栈、当前顶层 Activity 与 IPC 交互 | `AndroidRuntimeProbe` |
|
|
25
|
+
| `base.py` | 运行时探针统一抽象基类,规范探针连接、数据流监听与平稳断开逻辑 | `BaseRuntimeProbe` |
|
|
26
|
+
| `codebase_memory_probe.py` | Codebase Memory MCP 知识图谱与语义索引探针 | `CodebaseMemoryProbe` |
|
|
27
|
+
| `desktop_probe.py` | 桌面端应用(Electron/Qt/Native)运行环境与安全配置探针 | `DesktopProbe` |
|
|
28
|
+
| `differential_probe.py` | 差分黑盒执行探针,对比不同版本或环境的行为差异 | `DifferentialProbe` |
|
|
29
|
+
| `efficiency_probe.py` | 系统基准算力与环境执行效率评测探针 | `EfficiencyProbe` |
|
|
30
|
+
| `INTERFACE.md` | 探针对外暴露的事件与指标契约规范文档 | 探针接口定义 |
|
|
31
|
+
| `ios_binary_probe.py` | iOS 二进制包(IPA/Mach-O)安全特征与签名结构探针 | `IOSBinaryProbe` |
|
|
32
|
+
| `memory_probe.py` | 运行时内存画像、泄漏检测与对象分布探针 | `MemoryProbe` |
|
|
33
|
+
| `miniprogram_probe.py` | 微信小程序专用探针,读取编译态产物、配置、路由表以及运行时网络请求 | `MiniProgramRuntimeProbe` |
|
|
34
|
+
| `mobile_probe.py` | 移动端(Android/iOS)自动化测试环境与设备可用性探针 | `MobileProbe` |
|
|
35
|
+
| `native_probe.py` | 原生 C/C++/Rust 工程编译工具链与 Sanitizer 能力探针 | `NativeProbe` |
|
|
36
|
+
| `openwiki_probe.py` | 开源知识库与外部漏洞情报检索探针 | `OpenWikiProbe` |
|
|
37
|
+
| `pattern_probe.py` | 历史高频缺陷模式与规则违规特征扫描探针 | `PatternProbe` |
|
|
38
|
+
| `platform_probe.py` | 跨平台操作系统工具链与依赖环境适配探针 | `PlatformProbe` |
|
|
39
|
+
| `probe_registry.py` | 探针插件注册中心,统一管理探针生命周期与预算调度 | `ProbeRegistry`, `run_preflight_probes` |
|
|
40
|
+
| `sast_probe.py` | 多引擎静态代码安全扫描与规则匹配探针 | `SASTProbe` |
|
|
41
|
+
| `sast_rules.py` | 内置 SAST AST 规则集与轻量模式匹配引擎 | `SASTRuleMatcher`, `BUILTIN_RULES` |
|
|
42
|
+
| `sca_scanner.py` | 依赖软件成分分析(SCA)与已知脆弱性依赖检测器 | `SCAScanner` |
|
|
43
|
+
| `SPEC.md` | 探针系统技术设计规范,阐述无侵入性检测与性能损耗边界 | 探针规范标准 |
|
|
44
|
+
| `web_probe.py` | 现代浏览器 Web 探针,通过 Chrome DevTools Protocol 捕获 Console 报错与 Network 异常 | `WebRuntimeProbe` |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 3. 核心设计契约与公理 (Design Axioms)
|
|
49
|
+
|
|
50
|
+
1. **非侵入与低损耗公理**:探针运行对目标应用主线程性能损耗必须小于 3%,严禁因探针自身异常导致被测宿主崩溃。
|
|
51
|
+
2. **连接断开物理自愈**:当审计结束或被测进程退出时,探针必须无残留平稳断开,清理临时转发端口(如 `adb forward`)。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# probes - Domain Specification (SPEC.md)
|
|
2
|
+
|
|
3
|
+
## 1. Responsibility & Domain Boundary
|
|
4
|
+
- **Title**: Domain Dynamic Probes System
|
|
5
|
+
- **Package Path**: `core/probes`
|
|
6
|
+
- **Core Mission**: Domain-specialized dynamic black-box probes (Web, Android, WeChat Mini Program) with static fallback.
|
|
7
|
+
- **Boundary**: All public capabilities must be formally declared in `INTERFACE.md`. Internal utilities must remain encapsulated.
|
|
8
|
+
|
|
9
|
+
## 2. Dependency & Interaction Topology
|
|
10
|
+
- **Inbound Invocations**: Called by autonomous CVE pipeline, audit workers, and supervisor verification.
|
|
11
|
+
- **Outbound Dependencies**: External runtimes (Playwright, adb, mini-program devtools).
|
|
12
|
+
|
|
13
|
+
## 3. System Invariants & Failure Modes
|
|
14
|
+
- **Safety Invariant**: Graceful degradation: if dynamic runtime is unavailable, probe must report static degradation cleanly.
|
|
15
|
+
- **Resilience Policy**: Failures must be isolated within the domain and converted to structured exceptions or error receipts.
|
|
16
|
+
|
|
17
|
+
## 4. Usage Patterns & Quickstart
|
|
18
|
+
```python
|
|
19
|
+
from core.probes import WebDynamicProbe
|
|
20
|
+
probe = WebDynamicProbe()
|
|
21
|
+
res = probe.execute_probe('http://localhost:8080')
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 5. Maintenance & Verification
|
|
25
|
+
- Verification is performed with short-lived tests outside the repository; no persistent `tests/` registry is retained.
|
|
26
|
+
- Validation runners and fixtures are process artifacts under `/tmp/bugx-tests-*`; they are
|
|
27
|
+
physically removed after the verification window and are not a repository interface.
|
|
28
|
+
- `capture_browser_page` is shared by `headless_browser_action` and `bugx probe ui`. The UI
|
|
29
|
+
audit owns its browser contexts, records native zoom, and adds computed style, layout and
|
|
30
|
+
explicit state and keyboard assertions to the same screenshot receipt. The packaged
|
|
31
|
+
axe-core bundle runs in the rendered context. The Web conformance reader verifies the
|
|
32
|
+
run identity, manifest, screenshot hashes and scoped outcomes.
|
|
33
|
+
- Storybook inputs bind the index digest and preview ID to each captured story. The
|
|
34
|
+
token importer resolves declared same-file aliases in project JSON and adds its file
|
|
35
|
+
digest and CSS mapping to the design receipt.
|
|
36
|
+
- Changes to exported interfaces must be synchronized via `python3 scripts/gen_interface_spec.py --package core/probes --write`.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""core/probes - 形态专属黑盒探针系统 (DOC-248 Dynamic Probes)。
|
|
3
|
+
|
|
4
|
+
统一导出所有领域专属探针基类与实现类。
|
|
5
|
+
|
|
6
|
+
W-004 惰性化(耗时账本):本包历史上 eager import 全部 19 个探针模块
|
|
7
|
+
(含 playwright 链的 web_probe/differential_probe 等重型依赖),被引擎
|
|
8
|
+
门禁链(launch_phases.common → governance → supervisor → coverage)
|
|
9
|
+
连带 import,每次引擎启动固定支付 ~190ms。改为 PEP 562 模块级
|
|
10
|
+
__getattr__ 按需加载:BaseProbe(轻量基类)保持 eager(probe_registry
|
|
11
|
+
注册面依赖),其余探针在首次属性访问时才 import——消费方三种形态
|
|
12
|
+
(from core.probes import X / from core.probes.X import Y / 子模块直
|
|
13
|
+
import)语义全部不变。
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
from .base import BaseProbe
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
"BaseProbe",
|
|
24
|
+
"WebDynamicProbe",
|
|
25
|
+
"AndroidProbe",
|
|
26
|
+
"MiniProgramProbe",
|
|
27
|
+
"sast_probe",
|
|
28
|
+
"sast_rules",
|
|
29
|
+
"sca_scanner",
|
|
30
|
+
"desktop_probe",
|
|
31
|
+
"mobile_probe",
|
|
32
|
+
"native_probe",
|
|
33
|
+
"platform_probe",
|
|
34
|
+
"memory_probe",
|
|
35
|
+
"efficiency_probe",
|
|
36
|
+
"differential_probe",
|
|
37
|
+
"pattern_probe",
|
|
38
|
+
"ios_binary_probe",
|
|
39
|
+
"codebase_memory_probe",
|
|
40
|
+
"openwiki_probe",
|
|
41
|
+
"probe_registry",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
# 惰性成员 → 所属子模块(属性名与历史 eager 导出逐一对应,语义不变)
|
|
45
|
+
_LAZY_MEMBERS: dict[str, str] = {
|
|
46
|
+
"WebDynamicProbe": "web_probe",
|
|
47
|
+
"AndroidProbe": "android_probe",
|
|
48
|
+
"MiniProgramProbe": "miniprogram_probe",
|
|
49
|
+
"sast_probe": "sast_probe",
|
|
50
|
+
"sast_rules": "sast_rules",
|
|
51
|
+
"sca_scanner": "sca_scanner",
|
|
52
|
+
"desktop_probe": "desktop_probe",
|
|
53
|
+
"mobile_probe": "mobile_probe",
|
|
54
|
+
"native_probe": "native_probe",
|
|
55
|
+
"platform_probe": "platform_probe",
|
|
56
|
+
"memory_probe": "memory_probe",
|
|
57
|
+
"efficiency_probe": "efficiency_probe",
|
|
58
|
+
"differential_probe": "differential_probe",
|
|
59
|
+
"pattern_probe": "pattern_probe",
|
|
60
|
+
"ios_binary_probe": "ios_binary_probe",
|
|
61
|
+
"codebase_memory_probe": "codebase_memory_probe",
|
|
62
|
+
"openwiki_probe": "openwiki_probe",
|
|
63
|
+
"probe_registry": "probe_registry",
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def __getattr__(name: str) -> Any:
|
|
68
|
+
"""PEP 562 按需加载探针成员(W-004:消除门禁链 190ms eager 税)。"""
|
|
69
|
+
target = _LAZY_MEMBERS.get(name)
|
|
70
|
+
if target is None:
|
|
71
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
72
|
+
import importlib
|
|
73
|
+
|
|
74
|
+
module = importlib.import_module(f"{__name__}.{target}")
|
|
75
|
+
globals()[name] = module # 缓存:后续访问零开销
|
|
76
|
+
return module
|