@vibecodetown/mcp-server 1.3.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/CONTRIBUTING.md +294 -0
- package/README.md +146 -0
- package/bin/clinic_linux_x64/clinic +0 -0
- package/bin/clinic_win_x64/clinic.exe +0 -0
- package/bin/musu-linux-x64 +0 -0
- package/bin/spec-high_linux_x64/spec-high +0 -0
- package/bin/spec-high_win_x64/spec-high.exe +0 -0
- package/bin/vibecoding-helper_linux_x64/vibecoding-helper +0 -0
- package/bin/vibecoding-helper_win_x64/vibecoding-helper.exe +0 -0
- package/bin/vpm-back_linux_x64/vpm-back +0 -0
- package/bin/vpm-back_win_x64/vpm-back.exe +0 -0
- package/build/background-sync-worker.d.ts +55 -0
- package/build/background-sync-worker.js +172 -0
- package/build/bin/vibe-auth.d.ts +12 -0
- package/build/bin/vibe-auth.js +246 -0
- package/build/bin/vibe-bitnet-worker.d.ts +21 -0
- package/build/bin/vibe-bitnet-worker.js +123 -0
- package/build/bin/vibe-ci.d.ts +15 -0
- package/build/bin/vibe-ci.js +1558 -0
- package/build/bin/vibe-dashboard.d.ts +12 -0
- package/build/bin/vibe-dashboard.js +76 -0
- package/build/bin/vibe-mapper-worker.d.ts +15 -0
- package/build/bin/vibe-mapper-worker.js +92 -0
- package/build/bitnet-worker/autostart.d.ts +39 -0
- package/build/bitnet-worker/autostart.js +110 -0
- package/build/bitnet-worker/client.d.ts +177 -0
- package/build/bitnet-worker/client.js +393 -0
- package/build/bitnet-worker/cpu_brake.d.ts +106 -0
- package/build/bitnet-worker/cpu_brake.js +177 -0
- package/build/bitnet-worker/embed_client.d.ts +31 -0
- package/build/bitnet-worker/embed_client.js +109 -0
- package/build/bitnet-worker/hw_slots.d.ts +90 -0
- package/build/bitnet-worker/hw_slots.js +167 -0
- package/build/bitnet-worker/index.d.ts +24 -0
- package/build/bitnet-worker/index.js +27 -0
- package/build/bitnet-worker/metrics.d.ts +78 -0
- package/build/bitnet-worker/metrics.js +129 -0
- package/build/bitnet-worker/native_inference.d.ts +86 -0
- package/build/bitnet-worker/native_inference.js +256 -0
- package/build/bitnet-worker/pool-autostart.d.ts +41 -0
- package/build/bitnet-worker/pool-autostart.js +124 -0
- package/build/bitnet-worker/request_cache.d.ts +41 -0
- package/build/bitnet-worker/request_cache.js +101 -0
- package/build/bitnet-worker/serial_queue.d.ts +13 -0
- package/build/bitnet-worker/serial_queue.js +22 -0
- package/build/bitnet-worker/server-autostart.d.ts +48 -0
- package/build/bitnet-worker/server-autostart.js +129 -0
- package/build/bitnet-worker/server.d.ts +76 -0
- package/build/bitnet-worker/server.js +545 -0
- package/build/bitnet-worker/server_manager.d.ts +133 -0
- package/build/bitnet-worker/server_manager.js +359 -0
- package/build/bitnet-worker/tiered_queue.d.ts +126 -0
- package/build/bitnet-worker/tiered_queue.js +187 -0
- package/build/bitnet-worker/types.d.ts +196 -0
- package/build/bitnet-worker/types.js +146 -0
- package/build/config/load-config.d.ts +40 -0
- package/build/config/load-config.js +227 -0
- package/build/coordinator/client.d.ts +99 -0
- package/build/coordinator/client.js +158 -0
- package/build/coordinator/index.d.ts +27 -0
- package/build/coordinator/index.js +31 -0
- package/build/correction-messages.d.ts +66 -0
- package/build/correction-messages.js +245 -0
- package/build/dashboard/autostart.d.ts +45 -0
- package/build/dashboard/autostart.js +121 -0
- package/build/dashboard/index.d.ts +21 -0
- package/build/dashboard/index.js +23 -0
- package/build/dashboard/server.d.ts +43 -0
- package/build/dashboard/server.js +334 -0
- package/build/db_sync/config.d.ts +76 -0
- package/build/db_sync/config.js +153 -0
- package/build/db_sync/index.d.ts +86 -0
- package/build/db_sync/index.js +294 -0
- package/build/db_sync/parsers/bitnet.d.ts +20 -0
- package/build/db_sync/parsers/bitnet.js +61 -0
- package/build/db_sync/parsers/gate.d.ts +23 -0
- package/build/db_sync/parsers/gate.js +73 -0
- package/build/db_sync/parsers/index.d.ts +10 -0
- package/build/db_sync/parsers/index.js +10 -0
- package/build/db_sync/parsers/ingress.d.ts +22 -0
- package/build/db_sync/parsers/ingress.js +57 -0
- package/build/db_sync/parsers/mapping.d.ts +22 -0
- package/build/db_sync/parsers/mapping.js +57 -0
- package/build/db_sync/parsers/orchestrator.d.ts +66 -0
- package/build/db_sync/parsers/orchestrator.js +110 -0
- package/build/db_sync/pool.d.ts +120 -0
- package/build/db_sync/pool.js +225 -0
- package/build/db_sync/publish.d.ts +125 -0
- package/build/db_sync/publish.js +197 -0
- package/build/db_sync/read_model.d.ts +54 -0
- package/build/db_sync/read_model.js +254 -0
- package/build/db_sync/scanner.d.ts +97 -0
- package/build/db_sync/scanner.js +287 -0
- package/build/db_sync/types.d.ts +254 -0
- package/build/db_sync/types.js +76 -0
- package/build/db_sync/writer.d.ts +111 -0
- package/build/db_sync/writer.js +377 -0
- package/build/decision-log-reader.d.ts +38 -0
- package/build/decision-log-reader.js +116 -0
- package/build/deep-link.d.ts +97 -0
- package/build/deep-link.js +176 -0
- package/build/deps/deps-update.d.ts +36 -0
- package/build/deps/deps-update.js +324 -0
- package/build/deps/drift-check.d.ts +35 -0
- package/build/deps/drift-check.js +247 -0
- package/build/deps/env-check.d.ts +43 -0
- package/build/deps/env-check.js +310 -0
- package/build/deps/index.d.ts +16 -0
- package/build/deps/index.js +22 -0
- package/build/deps/pm-detect.d.ts +56 -0
- package/build/deps/pm-detect.js +213 -0
- package/build/deps/types.d.ts +84 -0
- package/build/deps/types.js +4 -0
- package/build/deps/ux-renderer.d.ts +102 -0
- package/build/deps/ux-renderer.js +410 -0
- package/build/evidence-report.d.ts +152 -0
- package/build/evidence-report.js +648 -0
- package/build/health/index.d.ts +30 -0
- package/build/health/index.js +31 -0
- package/build/health/liveness.d.ts +32 -0
- package/build/health/liveness.js +49 -0
- package/build/health/readiness.d.ts +60 -0
- package/build/health/readiness.js +136 -0
- package/build/health/types.d.ts +75 -0
- package/build/health/types.js +31 -0
- package/build/index.d.ts +41 -0
- package/build/index.js +131 -0
- package/build/license-manager.d.ts +85 -0
- package/build/license-manager.js +349 -0
- package/build/mapper-worker/client.d.ts +92 -0
- package/build/mapper-worker/client.js +360 -0
- package/build/mapper-worker/index.d.ts +29 -0
- package/build/mapper-worker/index.js +33 -0
- package/build/mapper-worker/pool.d.ts +24 -0
- package/build/mapper-worker/pool.js +301 -0
- package/build/mapper-worker/server.d.ts +49 -0
- package/build/mapper-worker/server.js +324 -0
- package/build/mapper-worker/types.d.ts +215 -0
- package/build/mapper-worker/types.js +106 -0
- package/build/mcp/a2a/observer/hooks.d.ts +102 -0
- package/build/mcp/a2a/observer/hooks.js +207 -0
- package/build/mcp/a2a/observer/logger.d.ts +66 -0
- package/build/mcp/a2a/observer/logger.js +300 -0
- package/build/mcp/a2a/observer/types.d.ts +92 -0
- package/build/mcp/a2a/observer/types.js +11 -0
- package/build/mcp/a2a/orchestrator/loop.d.ts +84 -0
- package/build/mcp/a2a/orchestrator/loop.js +151 -0
- package/build/mcp/a2a/orchestrator/ralph-audit.d.ts +66 -0
- package/build/mcp/a2a/orchestrator/ralph-audit.js +113 -0
- package/build/mcp/a2a/orchestrator/ralph-runner.d.ts +120 -0
- package/build/mcp/a2a/orchestrator/ralph-runner.js +365 -0
- package/build/mcp/a2a/orchestrator/rewind-actions.d.ts +38 -0
- package/build/mcp/a2a/orchestrator/rewind-actions.js +148 -0
- package/build/mcp/a2a/types.d.ts +82 -0
- package/build/mcp/a2a/types.js +4 -0
- package/build/mcp/airlock/airlock.d.ts +2 -0
- package/build/mcp/airlock/airlock.js +34 -0
- package/build/mcp/airlock/index.d.ts +5 -0
- package/build/mcp/airlock/index.js +5 -0
- package/build/mcp/airlock/policy.d.ts +14 -0
- package/build/mcp/airlock/policy.js +31 -0
- package/build/mcp/airlock/redact.d.ts +11 -0
- package/build/mcp/airlock/redact.js +69 -0
- package/build/mcp/airlock/report.d.ts +14 -0
- package/build/mcp/airlock/report.js +53 -0
- package/build/mcp/airlock/types.d.ts +66 -0
- package/build/mcp/airlock/types.js +1 -0
- package/build/mcp/auth/gate.d.ts +51 -0
- package/build/mcp/auth/gate.js +225 -0
- package/build/mcp/auth/index.d.ts +32 -0
- package/build/mcp/auth/index.js +55 -0
- package/build/mcp/auth/public_key.d.ts +31 -0
- package/build/mcp/auth/public_key.js +34 -0
- package/build/mcp/auth/token_cache.d.ts +49 -0
- package/build/mcp/auth/token_cache.js +122 -0
- package/build/mcp/auth/token_verifier.d.ts +57 -0
- package/build/mcp/auth/token_verifier.js +117 -0
- package/build/mcp/bootstrap/doctor.d.ts +75 -0
- package/build/mcp/bootstrap/doctor.js +223 -0
- package/build/mcp/bootstrap/installer.d.ts +73 -0
- package/build/mcp/bootstrap/installer.js +993 -0
- package/build/mcp/bootstrap/lock.d.ts +5 -0
- package/build/mcp/bootstrap/lock.js +37 -0
- package/build/mcp/bootstrap/platform.d.ts +9 -0
- package/build/mcp/bootstrap/platform.js +26 -0
- package/build/mcp/bootstrap/registry.d.ts +46 -0
- package/build/mcp/bootstrap/registry.js +49 -0
- package/build/mcp/bootstrap/skills-installer.d.ts +154 -0
- package/build/mcp/bootstrap/skills-installer.js +610 -0
- package/build/mcp/cache/index.d.ts +77 -0
- package/build/mcp/cache/index.js +147 -0
- package/build/mcp/chunking/artifacts.d.ts +9 -0
- package/build/mcp/chunking/artifacts.js +41 -0
- package/build/mcp/chunking/chunking.d.ts +10 -0
- package/build/mcp/chunking/chunking.js +193 -0
- package/build/mcp/chunking/index.d.ts +4 -0
- package/build/mcp/chunking/index.js +4 -0
- package/build/mcp/chunking/policy.d.ts +27 -0
- package/build/mcp/chunking/policy.js +71 -0
- package/build/mcp/chunking/types.d.ts +66 -0
- package/build/mcp/chunking/types.js +1 -0
- package/build/mcp/cli.d.ts +57 -0
- package/build/mcp/cli.js +182 -0
- package/build/mcp/cockpit-bridge/client.d.ts +84 -0
- package/build/mcp/cockpit-bridge/client.js +78 -0
- package/build/mcp/cockpit-bridge/index.d.ts +16 -0
- package/build/mcp/cockpit-bridge/index.js +20 -0
- package/build/mcp/cockpit-bridge/tools/command.d.ts +101 -0
- package/build/mcp/cockpit-bridge/tools/command.js +185 -0
- package/build/mcp/cockpit-bridge/tools/decide.d.ts +27 -0
- package/build/mcp/cockpit-bridge/tools/decide.js +62 -0
- package/build/mcp/cockpit-bridge/tools/index.d.ts +17 -0
- package/build/mcp/cockpit-bridge/tools/index.js +28 -0
- package/build/mcp/cockpit-bridge/tools/manual.d.ts +26 -0
- package/build/mcp/cockpit-bridge/tools/manual.js +56 -0
- package/build/mcp/cockpit-bridge/tools/prompt.d.ts +19 -0
- package/build/mcp/cockpit-bridge/tools/prompt.js +57 -0
- package/build/mcp/cockpit-bridge/tools/status.d.ts +19 -0
- package/build/mcp/cockpit-bridge/tools/status.js +50 -0
- package/build/mcp/contracts.d.ts +609 -0
- package/build/mcp/contracts.js +22 -0
- package/build/mcp/engine.d.ts +86 -0
- package/build/mcp/engine.js +273 -0
- package/build/mcp/errors.d.ts +118 -0
- package/build/mcp/errors.js +278 -0
- package/build/mcp/events/constants.d.ts +31 -0
- package/build/mcp/events/constants.js +44 -0
- package/build/mcp/events/dedup_cooldown.d.ts +19 -0
- package/build/mcp/events/dedup_cooldown.js +51 -0
- package/build/mcp/events/emitter.d.ts +12 -0
- package/build/mcp/events/emitter.js +27 -0
- package/build/mcp/events/event_loop.d.ts +13 -0
- package/build/mcp/events/event_loop.js +248 -0
- package/build/mcp/events/file_watcher.d.ts +8 -0
- package/build/mcp/events/file_watcher.js +24 -0
- package/build/mcp/events/index.d.ts +11 -0
- package/build/mcp/events/index.js +11 -0
- package/build/mcp/events/logger.d.ts +8 -0
- package/build/mcp/events/logger.js +38 -0
- package/build/mcp/events/mq.d.ts +10 -0
- package/build/mcp/events/mq.js +22 -0
- package/build/mcp/events/mq_nats.d.ts +5 -0
- package/build/mcp/events/mq_nats.js +20 -0
- package/build/mcp/events/mq_redis.d.ts +5 -0
- package/build/mcp/events/mq_redis.js +20 -0
- package/build/mcp/events/nav_refresh.d.ts +14 -0
- package/build/mcp/events/nav_refresh.js +64 -0
- package/build/mcp/events/processor.d.ts +19 -0
- package/build/mcp/events/processor.js +76 -0
- package/build/mcp/events/replay.d.ts +6 -0
- package/build/mcp/events/replay.js +27 -0
- package/build/mcp/events/types.d.ts +32 -0
- package/build/mcp/events/types.js +18 -0
- package/build/mcp/generated/activate_input.d.ts +15 -0
- package/build/mcp/generated/activate_input.js +2 -0
- package/build/mcp/generated/activate_output.d.ts +36 -0
- package/build/mcp/generated/activate_output.js +57 -0
- package/build/mcp/generated/advisory_review_input.d.ts +42 -0
- package/build/mcp/generated/advisory_review_input.js +2 -0
- package/build/mcp/generated/advisory_review_output.d.ts +3 -0
- package/build/mcp/generated/advisory_review_output.js +35 -0
- package/build/mcp/generated/auth_token_file.d.ts +79 -0
- package/build/mcp/generated/auth_token_file.js +2 -0
- package/build/mcp/generated/autopilot_policy.d.ts +133 -0
- package/build/mcp/generated/autopilot_policy.js +77 -0
- package/build/mcp/generated/bitnet_signal.d.ts +146 -0
- package/build/mcp/generated/bitnet_signal.js +71 -0
- package/build/mcp/generated/bridge_build_seed_input.d.ts +65 -0
- package/build/mcp/generated/bridge_build_seed_input.js +2 -0
- package/build/mcp/generated/bridge_build_seed_output.d.ts +36 -0
- package/build/mcp/generated/bridge_build_seed_output.js +2 -0
- package/build/mcp/generated/bridge_confirm_reference_input.d.ts +30 -0
- package/build/mcp/generated/bridge_confirm_reference_input.js +2 -0
- package/build/mcp/generated/bridge_confirm_reference_output.d.ts +59 -0
- package/build/mcp/generated/bridge_confirm_reference_output.js +2 -0
- package/build/mcp/generated/bridge_confirmed_reference_file.d.ts +74 -0
- package/build/mcp/generated/bridge_confirmed_reference_file.js +2 -0
- package/build/mcp/generated/bridge_generate_references_input.d.ts +66 -0
- package/build/mcp/generated/bridge_generate_references_input.js +2 -0
- package/build/mcp/generated/bridge_generate_references_output.d.ts +62 -0
- package/build/mcp/generated/bridge_generate_references_output.js +2 -0
- package/build/mcp/generated/bridge_references_file.d.ts +141 -0
- package/build/mcp/generated/bridge_references_file.js +2 -0
- package/build/mcp/generated/bridge_work_order_seed_file.d.ts +120 -0
- package/build/mcp/generated/bridge_work_order_seed_file.js +2 -0
- package/build/mcp/generated/briefing_input.d.ts +15 -0
- package/build/mcp/generated/briefing_input.js +2 -0
- package/build/mcp/generated/briefing_output.d.ts +58 -0
- package/build/mcp/generated/briefing_output.js +2 -0
- package/build/mcp/generated/clinic_bridge_file.d.ts +3 -0
- package/build/mcp/generated/clinic_bridge_file.js +13 -0
- package/build/mcp/generated/contracts_bundle_info.d.ts +3 -0
- package/build/mcp/generated/contracts_bundle_info.js +5 -0
- package/build/mcp/generated/create_work_order_input.d.ts +12 -0
- package/build/mcp/generated/create_work_order_input.js +2 -0
- package/build/mcp/generated/create_work_order_output.d.ts +214 -0
- package/build/mcp/generated/create_work_order_output.js +2 -0
- package/build/mcp/generated/current_work_order_file.d.ts +39 -0
- package/build/mcp/generated/current_work_order_file.js +2 -0
- package/build/mcp/generated/deps_drift_report.d.ts +167 -0
- package/build/mcp/generated/deps_drift_report.js +33 -0
- package/build/mcp/generated/deps_scan.d.ts +207 -0
- package/build/mcp/generated/deps_scan.js +38 -0
- package/build/mcp/generated/doctor_input.d.ts +9 -0
- package/build/mcp/generated/doctor_input.js +2 -0
- package/build/mcp/generated/doctor_output.d.ts +217 -0
- package/build/mcp/generated/doctor_output.js +24 -0
- package/build/mcp/generated/execution_result.d.ts +116 -0
- package/build/mcp/generated/execution_result.js +2 -0
- package/build/mcp/generated/execution_task.d.ts +136 -0
- package/build/mcp/generated/execution_task.js +2 -0
- package/build/mcp/generated/export_output_input.d.ts +42 -0
- package/build/mcp/generated/export_output_input.js +2 -0
- package/build/mcp/generated/export_output_output.d.ts +71 -0
- package/build/mcp/generated/export_output_output.js +2 -0
- package/build/mcp/generated/finalize_work_input.d.ts +68 -0
- package/build/mcp/generated/finalize_work_input.js +2 -0
- package/build/mcp/generated/finalize_work_output.d.ts +42 -0
- package/build/mcp/generated/finalize_work_output.js +2 -0
- package/build/mcp/generated/gate_input.d.ts +158 -0
- package/build/mcp/generated/gate_input.js +2 -0
- package/build/mcp/generated/gate_output.d.ts +131 -0
- package/build/mcp/generated/gate_output.js +2 -0
- package/build/mcp/generated/gate_result_v1.d.ts +131 -0
- package/build/mcp/generated/gate_result_v1.js +2 -0
- package/build/mcp/generated/get_decision_input.d.ts +15 -0
- package/build/mcp/generated/get_decision_input.js +6 -0
- package/build/mcp/generated/get_decision_output.d.ts +68 -0
- package/build/mcp/generated/get_decision_output.js +13 -0
- package/build/mcp/generated/get_semantic_complexity_input.d.ts +21 -0
- package/build/mcp/generated/get_semantic_complexity_input.js +2 -0
- package/build/mcp/generated/get_semantic_complexity_output.d.ts +161 -0
- package/build/mcp/generated/get_semantic_complexity_output.js +2 -0
- package/build/mcp/generated/handoff_to_clinic.d.ts +15 -0
- package/build/mcp/generated/handoff_to_clinic.js +2 -0
- package/build/mcp/generated/index.d.ts +106 -0
- package/build/mcp/generated/index.js +108 -0
- package/build/mcp/generated/ingress_input.d.ts +30 -0
- package/build/mcp/generated/ingress_input.js +11 -0
- package/build/mcp/generated/ingress_output.d.ts +136 -0
- package/build/mcp/generated/ingress_output.js +2 -0
- package/build/mcp/generated/ingress_resolution_file.d.ts +33 -0
- package/build/mcp/generated/ingress_resolution_file.js +2 -0
- package/build/mcp/generated/ingress_summary_file.d.ts +130 -0
- package/build/mcp/generated/ingress_summary_file.js +2 -0
- package/build/mcp/generated/inspect_code_input.d.ts +47 -0
- package/build/mcp/generated/inspect_code_input.js +2 -0
- package/build/mcp/generated/inspect_code_output.d.ts +164 -0
- package/build/mcp/generated/inspect_code_output.js +13 -0
- package/build/mcp/generated/memory_retrieve_input.d.ts +21 -0
- package/build/mcp/generated/memory_retrieve_input.js +2 -0
- package/build/mcp/generated/memory_retrieve_output.d.ts +18 -0
- package/build/mcp/generated/memory_retrieve_output.js +2 -0
- package/build/mcp/generated/memory_state_file.d.ts +46 -0
- package/build/mcp/generated/memory_state_file.js +2 -0
- package/build/mcp/generated/memory_status_input.d.ts +15 -0
- package/build/mcp/generated/memory_status_input.js +2 -0
- package/build/mcp/generated/memory_status_output.d.ts +79 -0
- package/build/mcp/generated/memory_status_output.js +13 -0
- package/build/mcp/generated/memory_sync_input.d.ts +18 -0
- package/build/mcp/generated/memory_sync_input.js +2 -0
- package/build/mcp/generated/memory_sync_output.d.ts +66 -0
- package/build/mcp/generated/memory_sync_output.js +13 -0
- package/build/mcp/generated/message_template_id_mapping_file.d.ts +132 -0
- package/build/mcp/generated/message_template_id_mapping_file.js +2 -0
- package/build/mcp/generated/observer_event_map.d.ts +198 -0
- package/build/mcp/generated/observer_event_map.js +74 -0
- package/build/mcp/generated/ose_expand_input.d.ts +48 -0
- package/build/mcp/generated/ose_expand_input.js +2 -0
- package/build/mcp/generated/ose_expand_output.d.ts +45 -0
- package/build/mcp/generated/ose_expand_output.js +2 -0
- package/build/mcp/generated/oss_candidates_file.d.ts +132 -0
- package/build/mcp/generated/oss_candidates_file.js +2 -0
- package/build/mcp/generated/oss_decisions_file.d.ts +125 -0
- package/build/mcp/generated/oss_decisions_file.js +2 -0
- package/build/mcp/generated/oss_snippets_file.d.ts +117 -0
- package/build/mcp/generated/oss_snippets_file.js +2 -0
- package/build/mcp/generated/plugin_result.d.ts +43 -0
- package/build/mcp/generated/plugin_result.js +2 -0
- package/build/mcp/generated/react_perf_check_patterns_input.d.ts +15 -0
- package/build/mcp/generated/react_perf_check_patterns_input.js +2 -0
- package/build/mcp/generated/react_perf_check_patterns_output.d.ts +102 -0
- package/build/mcp/generated/react_perf_check_patterns_output.js +2 -0
- package/build/mcp/generated/react_perf_generate_report_input.d.ts +18 -0
- package/build/mcp/generated/react_perf_generate_report_input.js +2 -0
- package/build/mcp/generated/react_perf_generate_report_output.d.ts +76 -0
- package/build/mcp/generated/react_perf_generate_report_output.js +2 -0
- package/build/mcp/generated/read_file_input.d.ts +21 -0
- package/build/mcp/generated/read_file_input.js +2 -0
- package/build/mcp/generated/read_file_output.d.ts +119 -0
- package/build/mcp/generated/read_file_output.js +2 -0
- package/build/mcp/generated/repair_analysis_engine_input.d.ts +21 -0
- package/build/mcp/generated/repair_analysis_engine_input.js +2 -0
- package/build/mcp/generated/repair_analysis_engine_output.d.ts +45 -0
- package/build/mcp/generated/repair_analysis_engine_output.js +2 -0
- package/build/mcp/generated/repair_plan_input.d.ts +12 -0
- package/build/mcp/generated/repair_plan_input.js +2 -0
- package/build/mcp/generated/repair_plan_output.d.ts +48 -0
- package/build/mcp/generated/repair_plan_output.js +2 -0
- package/build/mcp/generated/run_app_input.d.ts +50 -0
- package/build/mcp/generated/run_app_input.js +2 -0
- package/build/mcp/generated/run_app_output.d.ts +27 -0
- package/build/mcp/generated/run_app_output.js +2 -0
- package/build/mcp/generated/run_state_file.d.ts +3 -0
- package/build/mcp/generated/run_state_file.js +13 -0
- package/build/mcp/generated/scaffold_input.d.ts +15 -0
- package/build/mcp/generated/scaffold_input.js +2 -0
- package/build/mcp/generated/scaffold_output.d.ts +39 -0
- package/build/mcp/generated/scaffold_output.js +2 -0
- package/build/mcp/generated/search_oss_input.d.ts +59 -0
- package/build/mcp/generated/search_oss_input.js +2 -0
- package/build/mcp/generated/search_oss_output.d.ts +88 -0
- package/build/mcp/generated/search_oss_output.js +2 -0
- package/build/mcp/generated/selection_validation_result.d.ts +358 -0
- package/build/mcp/generated/selection_validation_result.js +2 -0
- package/build/mcp/generated/signal_agent_input.d.ts +101 -0
- package/build/mcp/generated/signal_agent_input.js +2 -0
- package/build/mcp/generated/skillpack_file.d.ts +825 -0
- package/build/mcp/generated/skillpack_file.js +102 -0
- package/build/mcp/generated/skills_input.d.ts +30 -0
- package/build/mcp/generated/skills_input.js +11 -0
- package/build/mcp/generated/skills_output.d.ts +349 -0
- package/build/mcp/generated/skills_output.js +52 -0
- package/build/mcp/generated/spec_expansion_file.d.ts +282 -0
- package/build/mcp/generated/spec_expansion_file.js +2 -0
- package/build/mcp/generated/spec_high_ask_queue_items_file.d.ts +247 -0
- package/build/mcp/generated/spec_high_ask_queue_items_file.js +2 -0
- package/build/mcp/generated/spec_high_clinic_bridge_output.d.ts +15 -0
- package/build/mcp/generated/spec_high_clinic_bridge_output.js +2 -0
- package/build/mcp/generated/spec_high_decision_draft_output.d.ts +40 -0
- package/build/mcp/generated/spec_high_decision_draft_output.js +2 -0
- package/build/mcp/generated/spec_high_validate_output.d.ts +24 -0
- package/build/mcp/generated/spec_high_validate_output.js +2 -0
- package/build/mcp/generated/status_input.d.ts +12 -0
- package/build/mcp/generated/status_input.js +5 -0
- package/build/mcp/generated/status_output.d.ts +919 -0
- package/build/mcp/generated/status_output.js +188 -0
- package/build/mcp/generated/submit_decision_input.d.ts +18 -0
- package/build/mcp/generated/submit_decision_input.js +2 -0
- package/build/mcp/generated/submit_decision_output.d.ts +53 -0
- package/build/mcp/generated/submit_decision_output.js +2 -0
- package/build/mcp/generated/tool_error_output.d.ts +80 -0
- package/build/mcp/generated/tool_error_output.js +26 -0
- package/build/mcp/generated/undo_last_task_input.d.ts +12 -0
- package/build/mcp/generated/undo_last_task_input.js +2 -0
- package/build/mcp/generated/undo_last_task_output.d.ts +38 -0
- package/build/mcp/generated/undo_last_task_output.js +2 -0
- package/build/mcp/generated/update_input.d.ts +18 -0
- package/build/mcp/generated/update_input.js +2 -0
- package/build/mcp/generated/update_output.d.ts +124 -0
- package/build/mcp/generated/update_output.js +2 -0
- package/build/mcp/generated/verification_steps.d.ts +249 -0
- package/build/mcp/generated/verification_steps.js +34 -0
- package/build/mcp/generated/vibe_pm_inspection_result.d.ts +68 -0
- package/build/mcp/generated/vibe_pm_inspection_result.js +2 -0
- package/build/mcp/generated/vibe_pm_report_markdown.d.ts +15 -0
- package/build/mcp/generated/vibe_pm_report_markdown.js +2 -0
- package/build/mcp/generated/vibe_pm_verdict.d.ts +15 -0
- package/build/mcp/generated/vibe_pm_verdict.js +2 -0
- package/build/mcp/generated/vibe_repo_config.d.ts +214 -0
- package/build/mcp/generated/vibe_repo_config.js +2 -0
- package/build/mcp/generated/vibecoding_helper_answer_output.d.ts +18 -0
- package/build/mcp/generated/vibecoding_helper_answer_output.js +2 -0
- package/build/mcp/generated/vibecoding_helper_one_loop_selection_output.d.ts +115 -0
- package/build/mcp/generated/vibecoding_helper_one_loop_selection_output.js +2 -0
- package/build/mcp/generated/vibecoding_helper_show_ask_queue_output.d.ts +230 -0
- package/build/mcp/generated/vibecoding_helper_show_ask_queue_output.js +2 -0
- package/build/mcp/generated/work_order_v1.d.ts +89 -0
- package/build/mcp/generated/work_order_v1.js +2 -0
- package/build/mcp/generated/zoekt_evidence_input.d.ts +27 -0
- package/build/mcp/generated/zoekt_evidence_input.js +2 -0
- package/build/mcp/generated/zoekt_evidence_output.d.ts +70 -0
- package/build/mcp/generated/zoekt_evidence_output.js +2 -0
- package/build/mcp/index.d.ts +2 -0
- package/build/mcp/index.js +187 -0
- package/build/mcp/legacy_alias.d.ts +29 -0
- package/build/mcp/legacy_alias.js +53 -0
- package/build/mcp/metrics/collector.d.ts +23 -0
- package/build/mcp/metrics/collector.js +270 -0
- package/build/mcp/metrics/index.d.ts +8 -0
- package/build/mcp/metrics/index.js +6 -0
- package/build/mcp/metrics/server.d.ts +39 -0
- package/build/mcp/metrics/server.js +129 -0
- package/build/mcp/metrics/types.d.ts +105 -0
- package/build/mcp/metrics/types.js +46 -0
- package/build/mcp/path-utils.d.ts +34 -0
- package/build/mcp/path-utils.js +68 -0
- package/build/mcp/paths.d.ts +29 -0
- package/build/mcp/paths.js +90 -0
- package/build/mcp/policy/index.d.ts +2 -0
- package/build/mcp/policy/index.js +2 -0
- package/build/mcp/policy/loader.d.ts +18 -0
- package/build/mcp/policy/loader.js +46 -0
- package/build/mcp/policy/schema.d.ts +558 -0
- package/build/mcp/policy/schema.js +87 -0
- package/build/mcp/preprocess.d.ts +16 -0
- package/build/mcp/preprocess.js +64 -0
- package/build/mcp/profile-config.d.ts +87 -0
- package/build/mcp/profile-config.js +211 -0
- package/build/mcp/router/artifacts.d.ts +15 -0
- package/build/mcp/router/artifacts.js +30 -0
- package/build/mcp/router/decide.d.ts +2 -0
- package/build/mcp/router/decide.js +51 -0
- package/build/mcp/router/index.d.ts +4 -0
- package/build/mcp/router/index.js +4 -0
- package/build/mcp/router/rules.d.ts +14 -0
- package/build/mcp/router/rules.js +32 -0
- package/build/mcp/router/types.d.ts +32 -0
- package/build/mcp/router/types.js +1 -0
- package/build/mcp/run-retention.d.ts +15 -0
- package/build/mcp/run-retention.js +87 -0
- package/build/mcp/runtime/helper_commands.d.ts +205 -0
- package/build/mcp/runtime/helper_commands.js +198 -0
- package/build/mcp/runtime/helper_invoker.d.ts +48 -0
- package/build/mcp/runtime/helper_invoker.js +134 -0
- package/build/mcp/runtime/helper_resolver.d.ts +41 -0
- package/build/mcp/runtime/helper_resolver.js +148 -0
- package/build/mcp/runtime/index.d.ts +3 -0
- package/build/mcp/runtime/index.js +8 -0
- package/build/mcp/runtime/musu_adapter.d.ts +193 -0
- package/build/mcp/runtime/musu_adapter.js +373 -0
- package/build/mcp/security/input-validator.d.ts +76 -0
- package/build/mcp/security/input-validator.js +119 -0
- package/build/mcp/security/path-policy.d.ts +102 -0
- package/build/mcp/security/path-policy.js +289 -0
- package/build/mcp/security/sandbox.d.ts +55 -0
- package/build/mcp/security/sandbox.js +378 -0
- package/build/mcp/tool-registry.d.ts +26 -0
- package/build/mcp/tool-registry.js +136 -0
- package/build/mcp/tools/bitnet/index.d.ts +494 -0
- package/build/mcp/tools/bitnet/index.js +748 -0
- package/build/mcp/tools/vibe_pm/ask-queue/index.d.ts +9 -0
- package/build/mcp/tools/vibe_pm/ask-queue/index.js +10 -0
- package/build/mcp/tools/vibe_pm/ask-queue/loader.d.ts +29 -0
- package/build/mcp/tools/vibe_pm/ask-queue/loader.js +137 -0
- package/build/mcp/tools/vibe_pm/ask-queue/transformer.d.ts +18 -0
- package/build/mcp/tools/vibe_pm/ask-queue/transformer.js +58 -0
- package/build/mcp/tools/vibe_pm/ask-queue/types.d.ts +75 -0
- package/build/mcp/tools/vibe_pm/ask-queue/types.js +16 -0
- package/build/mcp/tools/vibe_pm/auto-init.d.ts +41 -0
- package/build/mcp/tools/vibe_pm/auto-init.js +133 -0
- package/build/mcp/tools/vibe_pm/autopilot.d.ts +74 -0
- package/build/mcp/tools/vibe_pm/autopilot.js +334 -0
- package/build/mcp/tools/vibe_pm/bitnet-cache.d.ts +124 -0
- package/build/mcp/tools/vibe_pm/bitnet-cache.js +327 -0
- package/build/mcp/tools/vibe_pm/bitnet-ensure.d.ts +58 -0
- package/build/mcp/tools/vibe_pm/bitnet-ensure.js +204 -0
- package/build/mcp/tools/vibe_pm/bitnet-hook-consumer.d.ts +87 -0
- package/build/mcp/tools/vibe_pm/bitnet-hook-consumer.js +323 -0
- package/build/mcp/tools/vibe_pm/bitnet-runner.d.ts +44 -0
- package/build/mcp/tools/vibe_pm/bitnet-runner.js +144 -0
- package/build/mcp/tools/vibe_pm/briefing.d.ts +15 -0
- package/build/mcp/tools/vibe_pm/briefing.js +165 -0
- package/build/mcp/tools/vibe_pm/context.d.ts +113 -0
- package/build/mcp/tools/vibe_pm/context.js +579 -0
- package/build/mcp/tools/vibe_pm/create_work_order.d.ts +15 -0
- package/build/mcp/tools/vibe_pm/create_work_order.js +252 -0
- package/build/mcp/tools/vibe_pm/dashboard.d.ts +64 -0
- package/build/mcp/tools/vibe_pm/dashboard.js +175 -0
- package/build/mcp/tools/vibe_pm/decision-log.d.ts +24 -0
- package/build/mcp/tools/vibe_pm/decision-log.js +38 -0
- package/build/mcp/tools/vibe_pm/diagrams/animator.d.ts +27 -0
- package/build/mcp/tools/vibe_pm/diagrams/animator.js +122 -0
- package/build/mcp/tools/vibe_pm/diagrams/constants.d.ts +71 -0
- package/build/mcp/tools/vibe_pm/diagrams/constants.js +158 -0
- package/build/mcp/tools/vibe_pm/diagrams/gate_engine.d.ts +67 -0
- package/build/mcp/tools/vibe_pm/diagrams/gate_engine.js +695 -0
- package/build/mcp/tools/vibe_pm/diagrams/generator.d.ts +8 -0
- package/build/mcp/tools/vibe_pm/diagrams/generator.js +214 -0
- package/build/mcp/tools/vibe_pm/diagrams/index.d.ts +8 -0
- package/build/mcp/tools/vibe_pm/diagrams/index.js +9 -0
- package/build/mcp/tools/vibe_pm/diagrams/manifest.d.ts +37 -0
- package/build/mcp/tools/vibe_pm/diagrams/manifest.js +151 -0
- package/build/mcp/tools/vibe_pm/diagrams/mermaid_generator.d.ts +70 -0
- package/build/mcp/tools/vibe_pm/diagrams/mermaid_generator.js +214 -0
- package/build/mcp/tools/vibe_pm/diagrams/renderer.d.ts +29 -0
- package/build/mcp/tools/vibe_pm/diagrams/renderer.js +207 -0
- package/build/mcp/tools/vibe_pm/diagrams/types.d.ts +66 -0
- package/build/mcp/tools/vibe_pm/diagrams/types.js +16 -0
- package/build/mcp/tools/vibe_pm/dirty-scan.d.ts +59 -0
- package/build/mcp/tools/vibe_pm/dirty-scan.js +242 -0
- package/build/mcp/tools/vibe_pm/docs_structure.d.ts +17 -0
- package/build/mcp/tools/vibe_pm/docs_structure.js +148 -0
- package/build/mcp/tools/vibe_pm/doctor.d.ts +65 -0
- package/build/mcp/tools/vibe_pm/doctor.js +244 -0
- package/build/mcp/tools/vibe_pm/engine-errors/index.d.ts +9 -0
- package/build/mcp/tools/vibe_pm/engine-errors/index.js +10 -0
- package/build/mcp/tools/vibe_pm/engine-errors/normalizer.d.ts +35 -0
- package/build/mcp/tools/vibe_pm/engine-errors/normalizer.js +122 -0
- package/build/mcp/tools/vibe_pm/engine-errors/patterns.d.ts +26 -0
- package/build/mcp/tools/vibe_pm/engine-errors/patterns.js +111 -0
- package/build/mcp/tools/vibe_pm/engine-errors/types.d.ts +51 -0
- package/build/mcp/tools/vibe_pm/engine-errors/types.js +47 -0
- package/build/mcp/tools/vibe_pm/facts/collector.d.ts +35 -0
- package/build/mcp/tools/vibe_pm/facts/collector.js +285 -0
- package/build/mcp/tools/vibe_pm/facts/index.d.ts +8 -0
- package/build/mcp/tools/vibe_pm/facts/index.js +8 -0
- package/build/mcp/tools/vibe_pm/facts/types.d.ts +94 -0
- package/build/mcp/tools/vibe_pm/facts/types.js +44 -0
- package/build/mcp/tools/vibe_pm/failure/classifier.d.ts +37 -0
- package/build/mcp/tools/vibe_pm/failure/classifier.js +134 -0
- package/build/mcp/tools/vibe_pm/failure/index.d.ts +11 -0
- package/build/mcp/tools/vibe_pm/failure/index.js +11 -0
- package/build/mcp/tools/vibe_pm/failure/loop_diagnose.d.ts +33 -0
- package/build/mcp/tools/vibe_pm/failure/loop_diagnose.js +232 -0
- package/build/mcp/tools/vibe_pm/failure/tracker.d.ts +66 -0
- package/build/mcp/tools/vibe_pm/failure/tracker.js +113 -0
- package/build/mcp/tools/vibe_pm/failure/types.d.ts +98 -0
- package/build/mcp/tools/vibe_pm/failure/types.js +17 -0
- package/build/mcp/tools/vibe_pm/feature-flags.d.ts +105 -0
- package/build/mcp/tools/vibe_pm/feature-flags.js +156 -0
- package/build/mcp/tools/vibe_pm/flow_policy.d.ts +66 -0
- package/build/mcp/tools/vibe_pm/flow_policy.js +253 -0
- package/build/mcp/tools/vibe_pm/get_decision.d.ts +9 -0
- package/build/mcp/tools/vibe_pm/get_decision.js +122 -0
- package/build/mcp/tools/vibe_pm/get_result.d.ts +43 -0
- package/build/mcp/tools/vibe_pm/get_result.js +82 -0
- package/build/mcp/tools/vibe_pm/index.d.ts +499 -0
- package/build/mcp/tools/vibe_pm/index.js +837 -0
- package/build/mcp/tools/vibe_pm/ingress.d.ts +29 -0
- package/build/mcp/tools/vibe_pm/ingress.js +435 -0
- package/build/mcp/tools/vibe_pm/init_docs.d.ts +21 -0
- package/build/mcp/tools/vibe_pm/init_docs.js +38 -0
- package/build/mcp/tools/vibe_pm/inspect_code.d.ts +10 -0
- package/build/mcp/tools/vibe_pm/inspect_code.js +729 -0
- package/build/mcp/tools/vibe_pm/mapping/change_map.d.ts +12 -0
- package/build/mcp/tools/vibe_pm/mapping/change_map.js +154 -0
- package/build/mcp/tools/vibe_pm/mapping/diff_scan.d.ts +31 -0
- package/build/mcp/tools/vibe_pm/mapping/diff_scan.js +156 -0
- package/build/mcp/tools/vibe_pm/mapping/gate_judge.d.ts +18 -0
- package/build/mcp/tools/vibe_pm/mapping/gate_judge.js +101 -0
- package/build/mcp/tools/vibe_pm/mapping/import_scan.d.ts +9 -0
- package/build/mcp/tools/vibe_pm/mapping/import_scan.js +56 -0
- package/build/mcp/tools/vibe_pm/mapping/index.d.ts +8 -0
- package/build/mcp/tools/vibe_pm/mapping/index.js +10 -0
- package/build/mcp/tools/vibe_pm/mapping/orchestrator.d.ts +41 -0
- package/build/mcp/tools/vibe_pm/mapping/orchestrator.js +200 -0
- package/build/mcp/tools/vibe_pm/mapping/skeleton_patch.d.ts +15 -0
- package/build/mcp/tools/vibe_pm/mapping/skeleton_patch.js +59 -0
- package/build/mcp/tools/vibe_pm/mapping/spec_map.d.ts +19 -0
- package/build/mcp/tools/vibe_pm/mapping/spec_map.js +43 -0
- package/build/mcp/tools/vibe_pm/mapping/types.d.ts +126 -0
- package/build/mcp/tools/vibe_pm/mapping/types.js +2 -0
- package/build/mcp/tools/vibe_pm/memory.d.ts +53 -0
- package/build/mcp/tools/vibe_pm/memory.js +92 -0
- package/build/mcp/tools/vibe_pm/memory_backend.d.ts +50 -0
- package/build/mcp/tools/vibe_pm/memory_backend.js +187 -0
- package/build/mcp/tools/vibe_pm/memory_docs_root.d.ts +15 -0
- package/build/mcp/tools/vibe_pm/memory_docs_root.js +39 -0
- package/build/mcp/tools/vibe_pm/memory_index.d.ts +36 -0
- package/build/mcp/tools/vibe_pm/memory_index.js +302 -0
- package/build/mcp/tools/vibe_pm/memory_index_embeddings.d.ts +138 -0
- package/build/mcp/tools/vibe_pm/memory_index_embeddings.js +481 -0
- package/build/mcp/tools/vibe_pm/memory_index_hashvec.d.ts +53 -0
- package/build/mcp/tools/vibe_pm/memory_index_hashvec.js +251 -0
- package/build/mcp/tools/vibe_pm/memory_rerank.d.ts +92 -0
- package/build/mcp/tools/vibe_pm/memory_rerank.js +164 -0
- package/build/mcp/tools/vibe_pm/memory_retrieve.d.ts +22 -0
- package/build/mcp/tools/vibe_pm/memory_retrieve.js +247 -0
- package/build/mcp/tools/vibe_pm/memory_status.d.ts +6 -0
- package/build/mcp/tools/vibe_pm/memory_status.js +101 -0
- package/build/mcp/tools/vibe_pm/memory_sync.d.ts +6 -0
- package/build/mcp/tools/vibe_pm/memory_sync.js +226 -0
- package/build/mcp/tools/vibe_pm/modules/fix_dependencies.d.ts +18 -0
- package/build/mcp/tools/vibe_pm/modules/fix_dependencies.js +223 -0
- package/build/mcp/tools/vibe_pm/modules/fix_imports.d.ts +43 -0
- package/build/mcp/tools/vibe_pm/modules/fix_imports.js +317 -0
- package/build/mcp/tools/vibe_pm/modules/fix_lint.d.ts +34 -0
- package/build/mcp/tools/vibe_pm/modules/fix_lint.js +267 -0
- package/build/mcp/tools/vibe_pm/modules/one_loop.d.ts +40 -0
- package/build/mcp/tools/vibe_pm/modules/one_loop.js +181 -0
- package/build/mcp/tools/vibe_pm/navigation/index.d.ts +10 -0
- package/build/mcp/tools/vibe_pm/navigation/index.js +9 -0
- package/build/mcp/tools/vibe_pm/navigation/resolver.d.ts +61 -0
- package/build/mcp/tools/vibe_pm/navigation/resolver.js +148 -0
- package/build/mcp/tools/vibe_pm/navigation/rules.d.ts +27 -0
- package/build/mcp/tools/vibe_pm/navigation/rules.js +258 -0
- package/build/mcp/tools/vibe_pm/navigation/types.d.ts +92 -0
- package/build/mcp/tools/vibe_pm/navigation/types.js +29 -0
- package/build/mcp/tools/vibe_pm/observer.d.ts +153 -0
- package/build/mcp/tools/vibe_pm/observer.js +402 -0
- package/build/mcp/tools/vibe_pm/phase.d.ts +69 -0
- package/build/mcp/tools/vibe_pm/phase.js +252 -0
- package/build/mcp/tools/vibe_pm/pm_language.d.ts +97 -0
- package/build/mcp/tools/vibe_pm/pm_language.js +355 -0
- package/build/mcp/tools/vibe_pm/policy/config.d.ts +30 -0
- package/build/mcp/tools/vibe_pm/policy/config.js +50 -0
- package/build/mcp/tools/vibe_pm/policy/index.d.ts +13 -0
- package/build/mcp/tools/vibe_pm/policy/index.js +12 -0
- package/build/mcp/tools/vibe_pm/policy/recommender.d.ts +49 -0
- package/build/mcp/tools/vibe_pm/policy/recommender.js +119 -0
- package/build/mcp/tools/vibe_pm/policy/types.d.ts +75 -0
- package/build/mcp/tools/vibe_pm/policy/types.js +32 -0
- package/build/mcp/tools/vibe_pm/ralph-loop-tools.d.ts +66 -0
- package/build/mcp/tools/vibe_pm/ralph-loop-tools.js +101 -0
- package/build/mcp/tools/vibe_pm/scaffold.d.ts +57 -0
- package/build/mcp/tools/vibe_pm/scaffold.js +403 -0
- package/build/mcp/tools/vibe_pm/schema-adapter.d.ts +44 -0
- package/build/mcp/tools/vibe_pm/schema-adapter.js +165 -0
- package/build/mcp/tools/vibe_pm/scorecard/index.d.ts +3 -0
- package/build/mcp/tools/vibe_pm/scorecard/index.js +3 -0
- package/build/mcp/tools/vibe_pm/scorecard/types.d.ts +66 -0
- package/build/mcp/tools/vibe_pm/scorecard/types.js +27 -0
- package/build/mcp/tools/vibe_pm/scorecard/writer.d.ts +33 -0
- package/build/mcp/tools/vibe_pm/scorecard/writer.js +134 -0
- package/build/mcp/tools/vibe_pm/setup.d.ts +52 -0
- package/build/mcp/tools/vibe_pm/setup.js +411 -0
- package/build/mcp/tools/vibe_pm/signals/index.d.ts +4 -0
- package/build/mcp/tools/vibe_pm/signals/index.js +4 -0
- package/build/mcp/tools/vibe_pm/signals/logger.d.ts +36 -0
- package/build/mcp/tools/vibe_pm/signals/logger.js +115 -0
- package/build/mcp/tools/vibe_pm/signals/rotation.d.ts +43 -0
- package/build/mcp/tools/vibe_pm/signals/rotation.js +128 -0
- package/build/mcp/tools/vibe_pm/signals/types.d.ts +46 -0
- package/build/mcp/tools/vibe_pm/signals/types.js +39 -0
- package/build/mcp/tools/vibe_pm/state-guesser.d.ts +50 -0
- package/build/mcp/tools/vibe_pm/state-guesser.js +322 -0
- package/build/mcp/tools/vibe_pm/state-schema.d.ts +133 -0
- package/build/mcp/tools/vibe_pm/state-schema.js +57 -0
- package/build/mcp/tools/vibe_pm/state-store.d.ts +8 -0
- package/build/mcp/tools/vibe_pm/state-store.js +97 -0
- package/build/mcp/tools/vibe_pm/status.d.ts +9 -0
- package/build/mcp/tools/vibe_pm/status.js +704 -0
- package/build/mcp/tools/vibe_pm/submit_decision.d.ts +9 -0
- package/build/mcp/tools/vibe_pm/submit_decision.js +154 -0
- package/build/mcp/tools/vibe_pm/submit_task.d.ts +107 -0
- package/build/mcp/tools/vibe_pm/submit_task.js +85 -0
- package/build/mcp/tools/vibe_pm/types.d.ts +4649 -0
- package/build/mcp/tools/vibe_pm/types.js +377 -0
- package/build/mcp/tools/vibe_pm/ui/index.d.ts +29 -0
- package/build/mcp/tools/vibe_pm/ui/index.js +17 -0
- package/build/mcp/tools/vibe_pm/ui/manifest.d.ts +14 -0
- package/build/mcp/tools/vibe_pm/ui/manifest.js +94 -0
- package/build/mcp/tools/vibe_pm/ui/types.d.ts +61 -0
- package/build/mcp/tools/vibe_pm/ui/types.js +3 -0
- package/build/mcp/tools/vibe_pm/ui/viewer_bundle.d.ts +6 -0
- package/build/mcp/tools/vibe_pm/ui/viewer_bundle.js +351 -0
- package/build/mcp/tools/vibe_pm/ux_fsm.d.ts +48 -0
- package/build/mcp/tools/vibe_pm/ux_fsm.js +127 -0
- package/build/mcp/tools/vibe_pm/verdict/index.d.ts +8 -0
- package/build/mcp/tools/vibe_pm/verdict/index.js +8 -0
- package/build/mcp/tools/vibe_pm/verdict/types.d.ts +69 -0
- package/build/mcp/tools/vibe_pm/verdict/types.js +50 -0
- package/build/mcp/tools/vibe_pm/verdict/writer.d.ts +42 -0
- package/build/mcp/tools/vibe_pm/verdict/writer.js +136 -0
- package/build/mcp/tools/vibe_pm/watcher.d.ts +91 -0
- package/build/mcp/tools/vibe_pm/watcher.js +235 -0
- package/build/mcp/tools/vibe_pm/worker_status.d.ts +43 -0
- package/build/mcp/tools/vibe_pm/worker_status.js +89 -0
- package/build/mcp/tools.d.ts +1 -0
- package/build/mcp/tools.js +11 -0
- package/build/mcp/transport/cli.d.ts +27 -0
- package/build/mcp/transport/cli.js +71 -0
- package/build/mcp/transport/handlers.d.ts +24 -0
- package/build/mcp/transport/handlers.js +118 -0
- package/build/mcp/transport/http.d.ts +28 -0
- package/build/mcp/transport/http.js +115 -0
- package/build/mcp/transport/index.d.ts +17 -0
- package/build/mcp/transport/index.js +18 -0
- package/build/mcp/transport/types.d.ts +81 -0
- package/build/mcp/transport/types.js +8 -0
- package/build/mcp/workspace-root.d.ts +49 -0
- package/build/mcp/workspace-root.js +165 -0
- package/build/offline-queue.d.ts +67 -0
- package/build/offline-queue.js +233 -0
- package/build/pool-manager/adapter.d.ts +118 -0
- package/build/pool-manager/adapter.js +99 -0
- package/build/pool-manager/bitnet-adapter.d.ts +74 -0
- package/build/pool-manager/bitnet-adapter.js +208 -0
- package/build/pool-manager/index.d.ts +16 -0
- package/build/pool-manager/index.js +14 -0
- package/build/pool-manager/mapper-adapter.d.ts +74 -0
- package/build/pool-manager/mapper-adapter.js +194 -0
- package/build/pool-manager/resource-monitor.d.ts +112 -0
- package/build/pool-manager/resource-monitor.js +213 -0
- package/build/pool-manager/types.d.ts +286 -0
- package/build/pool-manager/types.js +137 -0
- package/build/pool-manager/unified-pool.d.ts +168 -0
- package/build/pool-manager/unified-pool.js +561 -0
- package/build/profile-config.d.ts +115 -0
- package/build/profile-config.js +202 -0
- package/build/report-generator.d.ts +201 -0
- package/build/report-generator.js +763 -0
- package/build/review-history.d.ts +61 -0
- package/build/review-history.js +228 -0
- package/build/reviewer-ux-types.d.ts +85 -0
- package/build/reviewer-ux-types.js +21 -0
- package/build/skeleton-types.d.ts +89 -0
- package/build/skeleton-types.js +9 -0
- package/build/skill-loader.d.ts +177 -0
- package/build/skill-loader.js +407 -0
- package/build/spec-map.d.ts +32 -0
- package/build/spec-map.js +100 -0
- package/build/startup/index.d.ts +26 -0
- package/build/startup/index.js +26 -0
- package/build/startup/manager.d.ts +67 -0
- package/build/startup/manager.js +219 -0
- package/build/sync-manager.d.ts +58 -0
- package/build/sync-manager.js +113 -0
- package/build/sync-packet-builder.d.ts +215 -0
- package/build/sync-packet-builder.js +303 -0
- package/build/tier/ant_lane.d.ts +99 -0
- package/build/tier/ant_lane.js +308 -0
- package/build/tier/checkpoint.d.ts +61 -0
- package/build/tier/checkpoint.js +255 -0
- package/build/tier/checkpoint_types.d.ts +95 -0
- package/build/tier/checkpoint_types.js +8 -0
- package/build/tier/cooldown_store.d.ts +46 -0
- package/build/tier/cooldown_store.js +137 -0
- package/build/tier/feature_gate.d.ts +192 -0
- package/build/tier/feature_gate.js +416 -0
- package/build/tier/index.d.ts +45 -0
- package/build/tier/index.js +63 -0
- package/build/tier/policy_analysis.d.ts +130 -0
- package/build/tier/policy_analysis.js +465 -0
- package/build/tier/scorecard.d.ts +142 -0
- package/build/tier/scorecard.js +496 -0
- package/build/tier/scout_runner.d.ts +28 -0
- package/build/tier/scout_runner.js +203 -0
- package/build/tier/trigger_evaluator.d.ts +42 -0
- package/build/tier/trigger_evaluator.js +229 -0
- package/build/tier/trigger_facts_collector.d.ts +20 -0
- package/build/tier/trigger_facts_collector.js +294 -0
- package/build/tier/trigger_types.d.ts +87 -0
- package/build/tier/trigger_types.js +21 -0
- package/build/workers/base/autoscaler.d.ts +96 -0
- package/build/workers/base/autoscaler.js +165 -0
- package/build/workers/base/dashboard.d.ts +131 -0
- package/build/workers/base/dashboard.js +311 -0
- package/build/workers/base/health.d.ts +79 -0
- package/build/workers/base/health.js +240 -0
- package/build/workers/base/index.d.ts +13 -0
- package/build/workers/base/index.js +13 -0
- package/build/workers/base/metrics.d.ts +88 -0
- package/build/workers/base/metrics.js +183 -0
- package/build/workers/base/pool.d.ts +100 -0
- package/build/workers/base/pool.js +279 -0
- package/build/workers/base/queue.d.ts +48 -0
- package/build/workers/base/queue.js +163 -0
- package/build/workers/base/types.d.ts +131 -0
- package/build/workers/base/types.js +6 -0
- package/build/workers/base/worker.d.ts +64 -0
- package/build/workers/base/worker.js +198 -0
- package/build/workers/browser/index.d.ts +102 -0
- package/build/workers/browser/index.js +222 -0
- package/build/workers/build/index.d.ts +77 -0
- package/build/workers/build/index.js +167 -0
- package/build/workers/fs/index.d.ts +84 -0
- package/build/workers/fs/index.js +290 -0
- package/build/workers/index.d.ts +31 -0
- package/build/workers/index.js +60 -0
- package/build/workers/manager.d.ts +228 -0
- package/build/workers/manager.js +562 -0
- package/build/workers/model/index.d.ts +119 -0
- package/build/workers/model/index.js +239 -0
- package/build/workers/search/index.d.ts +93 -0
- package/build/workers/search/index.js +260 -0
- package/package.json +129 -0
- package/schemas/autopilot_policy.v1.schema.json +90 -0
- package/schemas/banned_question_rules.v1.schema.json +186 -0
- package/schemas/bitnet_signal.v1.schema.json +112 -0
- package/schemas/catalog_tree.v1.schema.json +172 -0
- package/schemas/choice_card.v1.schema.json +104 -0
- package/schemas/ci_summary.v1.schema.json +275 -0
- package/schemas/clinic_result.v1.2.schema.json +202 -0
- package/schemas/encrypted_packet.v1.schema.json +18 -0
- package/schemas/handoff_packet.v1.schema.json +192 -0
- package/schemas/observer_event_map.v1.schema.json +89 -0
- package/schemas/result.v1.schema.json +130 -0
- package/schemas/skeleton_map_summary.v1.schema.json +128 -0
- package/schemas/spec_gate_result.v1.schema.json +41 -0
- package/schemas/spec_map.v1.schema.json +40 -0
- package/schemas/sync_packet.v1.schema.json +103 -0
- package/schemas/task.v1.schema.json +227 -0
- package/schemas/vibe_tool_status.schema.json +182 -0
- package/scripts/build-artifacts.mjs +124 -0
- package/scripts/build-musu.sh +132 -0
- package/scripts/check-musu.mjs +78 -0
- package/scripts/check-pr-scope.mjs +121 -0
- package/scripts/clean-build.mjs +20 -0
- package/scripts/e2e-k8s-test.sh +202 -0
- package/scripts/ensure-exec.mjs +80 -0
- package/scripts/validate-doc-links.mjs +321 -0
- package/skills/skillpack.json +383 -0
- package/skills/skillpack.schema.json +212 -0
- package/templates/docs-structure/README.md +41 -0
- package/templates/docs-structure/active/.gitkeep +0 -0
- package/templates/docs-structure/archived/legacy/.gitkeep +0 -0
- package/templates/docs-structure/archived/topics/.gitkeep +0 -0
- package/templates/docs-structure/reference/contracts/.gitkeep +0 -0
- package/templates/docs-structure/reference/product-spec/.gitkeep +0 -0
- package/templates/docs-structure/reference/ssot/.gitkeep +0 -0
- package/templates/github-actions/vibe-ci.yml +27 -0
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
// MVP Core - vibe_pm.inspect_code
|
|
2
|
+
// Code review and validation (simplified MVP version)
|
|
3
|
+
import { invalidateEngineCache } from "../../engine.js";
|
|
4
|
+
import { resolveRunId, resolveProjectId, resolveBridgePath, readRunState, invalidateStateCache } from "./context.js";
|
|
5
|
+
import { signalToReview, formatIssueType, generateRepairPrompt, getStatusMessage } from "./pm_language.js";
|
|
6
|
+
import { VibecodingHelperOneLoopSelectionOutputSchema } from "../../generated/vibecoding_helper_one_loop_selection_output.js";
|
|
7
|
+
import { autoFixDependencies, hasFixableIssues } from "./modules/fix_dependencies.js";
|
|
8
|
+
import { fixMissingImports, hasFixableImportIssues } from "./modules/fix_imports.js";
|
|
9
|
+
import { fixLintViolations, hasFixableLintIssues } from "./modules/fix_lint.js";
|
|
10
|
+
import { oneLoopSelection } from "./modules/one_loop.js";
|
|
11
|
+
import { runMappingPipelineSmart, hasSpecMap, } from "./mapping/index.js";
|
|
12
|
+
import { appendDecisionLogEvent, readCurrentWorkOrderId, readCurrentDecisionId } from "./decision-log.js";
|
|
13
|
+
import { readLastCheckSync } from "./bitnet-cache.js";
|
|
14
|
+
import { computePhaseAndMissing } from "./phase.js";
|
|
15
|
+
import { appendScorecard, readScorecard } from "./scorecard/index.js";
|
|
16
|
+
import { appendSignal } from "./signals/index.js";
|
|
17
|
+
import { runPreprocess } from "../../preprocess.js";
|
|
18
|
+
import { spawn } from "node:child_process";
|
|
19
|
+
import { isPolicyEnabled, loadPolicyConfig, analyzeForPolicy, } from "./policy/index.js";
|
|
20
|
+
import { getWorkerManager } from "../../../workers/index.js";
|
|
21
|
+
import { LicenseManager } from "../../../license-manager.js";
|
|
22
|
+
import { Scorecard as TierScorecard, PolicyAnalyzer, } from "../../../tier/index.js";
|
|
23
|
+
async function runGitDiff(params) {
|
|
24
|
+
if (!params.files.length)
|
|
25
|
+
return "";
|
|
26
|
+
const maxFiles = 50;
|
|
27
|
+
const files = params.files.slice(0, maxFiles);
|
|
28
|
+
const args = ["diff", "--no-color", "--unified=3"];
|
|
29
|
+
if (params.useStaged || params.base === "staged" || params.head === "working") {
|
|
30
|
+
args.push("--cached");
|
|
31
|
+
}
|
|
32
|
+
else if (params.base && params.head) {
|
|
33
|
+
args.push(`${params.base}..${params.head}`);
|
|
34
|
+
}
|
|
35
|
+
args.push("--", ...files);
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
const proc = spawn("git", args, { cwd: params.cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
38
|
+
let stdout = "";
|
|
39
|
+
proc.stdout?.on("data", (d) => {
|
|
40
|
+
stdout += d.toString();
|
|
41
|
+
});
|
|
42
|
+
proc.on("close", () => resolve(stdout));
|
|
43
|
+
proc.on("error", () => resolve(""));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// === SCORECARD/SIGNALS FAIL-SAFE WRAPPERS ===
|
|
47
|
+
/**
|
|
48
|
+
* FAIL-SAFE wrapper for scorecard append
|
|
49
|
+
* Never throws - logs error and continues
|
|
50
|
+
*/
|
|
51
|
+
async function appendScorecardSafe(basePath, runId, entry) {
|
|
52
|
+
try {
|
|
53
|
+
await appendScorecard(basePath, runId, entry);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
console.error("[scorecard] append failed:", e instanceof Error ? e.message : e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* FAIL-SAFE wrapper for signals append
|
|
61
|
+
* Never throws - logs error and continues
|
|
62
|
+
*/
|
|
63
|
+
async function appendSignalSafe(basePath, event) {
|
|
64
|
+
try {
|
|
65
|
+
await appendSignal(basePath, event);
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.error("[signals] append failed:", e instanceof Error ? e.message : e);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Infer bottleneck code from issues array
|
|
73
|
+
* Priority: TEST_FAILURE > LINT_VIOLATION > TYPE_ERROR > MAPPING_VIOLATION > LOGIC_FLAW
|
|
74
|
+
*/
|
|
75
|
+
function inferBottleneck(issues) {
|
|
76
|
+
if (!issues || issues.length === 0)
|
|
77
|
+
return "UNKNOWN_ERROR";
|
|
78
|
+
const typeSet = new Set(issues.map((i) => (i.type ?? i.issue_type ?? "").toUpperCase()));
|
|
79
|
+
if (typeSet.has("TEST_FAIL") || typeSet.has("VERIFY_FAIL"))
|
|
80
|
+
return "TEST_FAILURE";
|
|
81
|
+
if (typeSet.has("RULE_VIOLATION"))
|
|
82
|
+
return "LINT_VIOLATION";
|
|
83
|
+
if (typeSet.has("TYPE_ERROR"))
|
|
84
|
+
return "TYPE_ERROR";
|
|
85
|
+
if (typeSet.has("SCOPE_MISMATCH"))
|
|
86
|
+
return "MAPPING_VIOLATION";
|
|
87
|
+
if (typeSet.has("RISK_SPIKE"))
|
|
88
|
+
return "LOGIC_FLAW";
|
|
89
|
+
return "UNKNOWN_ERROR";
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* vibe_pm.inspect_code - Code review and validation (MVP)
|
|
93
|
+
*
|
|
94
|
+
* Internal mapping:
|
|
95
|
+
* → vibecoding-helper one-loop <run_id> --output selection
|
|
96
|
+
* → issue classification
|
|
97
|
+
* → prompt_block generation (if FIX/BLOCK)
|
|
98
|
+
*/
|
|
99
|
+
export async function inspectCode(input) {
|
|
100
|
+
const basePath = process.cwd();
|
|
101
|
+
// Resolve run_id and bridge path
|
|
102
|
+
const { run_id } = resolveRunId(input.project_id, basePath);
|
|
103
|
+
const project_id = resolveProjectId(run_id, basePath);
|
|
104
|
+
const runState = readRunState(run_id, basePath);
|
|
105
|
+
const bridgePath = resolveBridgePath(input.bridge_path, run_id, basePath);
|
|
106
|
+
// Get mode for context
|
|
107
|
+
const mode = runState?.mode ?? "balanced";
|
|
108
|
+
// Best-effort preprocess (airlock/router/chunking)
|
|
109
|
+
try {
|
|
110
|
+
const rawText = JSON.stringify({
|
|
111
|
+
target_paths: input.target_paths ?? [],
|
|
112
|
+
mode: input.mode ?? "thorough",
|
|
113
|
+
auto_fix: input.auto_fix ?? true,
|
|
114
|
+
run_build: input.run_build ?? false,
|
|
115
|
+
});
|
|
116
|
+
await runPreprocess({
|
|
117
|
+
workspaceRoot: basePath,
|
|
118
|
+
runId: run_id,
|
|
119
|
+
rawText,
|
|
120
|
+
filePath: input.target_paths?.[0] ?? "inspect_code.txt",
|
|
121
|
+
taskType: "inspect_code",
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// ignore (best-effort)
|
|
126
|
+
}
|
|
127
|
+
// P0 Gate: No Spec + No Plan → No Work (mutation tool hard gate)
|
|
128
|
+
// - Inspect can trigger writes (auto_fix). Block before one-loop unless spec/plan exist.
|
|
129
|
+
const phase = computePhaseAndMissing(run_id, basePath);
|
|
130
|
+
const mutationMissing = phase.missing.filter((m) => m.required_for.includes("MUTATION"));
|
|
131
|
+
if (mutationMissing.length > 0) {
|
|
132
|
+
const missingList = mutationMissing.map((m) => m.id).join(", ");
|
|
133
|
+
// === INJECTION POINT A: P0 Gate (spec/plan missing) ===
|
|
134
|
+
await appendScorecardSafe(basePath, run_id, {
|
|
135
|
+
verdict: "BLOCK",
|
|
136
|
+
bottleneck: mutationMissing[0]?.id === "SPEC_MISSING" ? "SPEC_MISSING" : "PLAN_MISSING",
|
|
137
|
+
fix_count_increment: 0,
|
|
138
|
+
evidence_refs: mutationMissing.map((m) => m.evidence?.[0] ?? ""),
|
|
139
|
+
});
|
|
140
|
+
await appendSignalSafe(basePath, {
|
|
141
|
+
type: "INSPECT_VERDICT",
|
|
142
|
+
severity: "P0",
|
|
143
|
+
run_id,
|
|
144
|
+
data: { verdict: "BLOCK", reason: "P0_GATE", missing: mutationMissing.map((m) => m.id) },
|
|
145
|
+
});
|
|
146
|
+
// === END INJECTION POINT A ===
|
|
147
|
+
return {
|
|
148
|
+
project_id,
|
|
149
|
+
message_template_id: "BLOCK-01",
|
|
150
|
+
review_summary: {
|
|
151
|
+
decision_context: `프로젝트 ${project_id} 검수 준비 필요`,
|
|
152
|
+
review_result: "BLOCK",
|
|
153
|
+
one_line_verdict: `❌ 반려 - 필수 문서가 없습니다 (${missingList})`,
|
|
154
|
+
},
|
|
155
|
+
issues_found: mutationMissing.map((m) => ({
|
|
156
|
+
type: "VERIFY_FAIL",
|
|
157
|
+
business_risk: `필수 문서 누락: ${m.id}`,
|
|
158
|
+
plain_explanation: "검수 전에 스펙(spec)과 계획(plan)을 먼저 고정해야 합니다.",
|
|
159
|
+
technical_detail: {
|
|
160
|
+
file_path: (m.evidence?.[0] ?? "runs/<run_id>/..."),
|
|
161
|
+
},
|
|
162
|
+
})),
|
|
163
|
+
next_action: {
|
|
164
|
+
action_type: "CONTINUE",
|
|
165
|
+
tool: "vibe_pm.create_work_order",
|
|
166
|
+
reason: "스펙/계획을 먼저 생성한 뒤 검수를 다시 진행합니다.",
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
// Mapping Guard: Check change_map violations BEFORE oneLoopSelection
|
|
171
|
+
let mappingViolationIssues = [];
|
|
172
|
+
let mappingResult = null;
|
|
173
|
+
try {
|
|
174
|
+
if (hasSpecMap(basePath)) {
|
|
175
|
+
mappingResult = await runMappingPipelineSmart({
|
|
176
|
+
workspaceRoot: basePath,
|
|
177
|
+
run_id,
|
|
178
|
+
});
|
|
179
|
+
// Best-effort preprocess with mapping output (diff-based context)
|
|
180
|
+
try {
|
|
181
|
+
const diffText = await runGitDiff({
|
|
182
|
+
cwd: basePath,
|
|
183
|
+
files: [
|
|
184
|
+
...mappingResult.changeMap.mapped.map((m) => m.file),
|
|
185
|
+
...mappingResult.changeMap.unmapped.map((u) => u.file),
|
|
186
|
+
],
|
|
187
|
+
base: mappingResult.changeMap.base,
|
|
188
|
+
head: mappingResult.changeMap.head,
|
|
189
|
+
useStaged: mappingResult.changeMap.base === "staged",
|
|
190
|
+
});
|
|
191
|
+
const MAX_DIFF_CHARS = 50000;
|
|
192
|
+
const diffExcerpt = diffText.length > MAX_DIFF_CHARS ? diffText.slice(0, MAX_DIFF_CHARS) : diffText;
|
|
193
|
+
const preprocessText = JSON.stringify({
|
|
194
|
+
change_map_summary: mappingResult.changeMap.summary,
|
|
195
|
+
mapped_files: mappingResult.changeMap.mapped.map((m) => m.file),
|
|
196
|
+
unmapped_files: mappingResult.changeMap.unmapped.map((u) => u.file),
|
|
197
|
+
violations: mappingResult.changeMap.violations,
|
|
198
|
+
decision: mappingResult.decision,
|
|
199
|
+
change_map_path: mappingResult.changeMapPath,
|
|
200
|
+
diff_base: mappingResult.changeMap.base,
|
|
201
|
+
diff_head: mappingResult.changeMap.head,
|
|
202
|
+
diff_excerpt: diffExcerpt,
|
|
203
|
+
diff_truncated: diffText.length > MAX_DIFF_CHARS,
|
|
204
|
+
});
|
|
205
|
+
await runPreprocess({
|
|
206
|
+
workspaceRoot: basePath,
|
|
207
|
+
runId: run_id,
|
|
208
|
+
rawText: preprocessText,
|
|
209
|
+
filePath: mappingResult.changeMapPath,
|
|
210
|
+
taskType: "mapping",
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
// ignore (best-effort)
|
|
215
|
+
}
|
|
216
|
+
// Convert mapping violations to issues
|
|
217
|
+
if (mappingResult.decision.verdict !== "GO") {
|
|
218
|
+
mappingViolationIssues = mappingResult.changeMap.violations.map((v) => ({
|
|
219
|
+
type: (v.severity === "BLOCK" ? "SCOPE_MISMATCH" : "RULE_VIOLATION"),
|
|
220
|
+
business_risk: v.detail,
|
|
221
|
+
plain_explanation: mappingResult.decision.navigation?.[0] ?? "spec_map.v1.json 또는 코드 소속을 확인하세요.",
|
|
222
|
+
technical_detail: v.file ? {
|
|
223
|
+
file_path: v.file,
|
|
224
|
+
} : undefined,
|
|
225
|
+
}));
|
|
226
|
+
// If BLOCK-level violations exist, return early without oneLoopSelection
|
|
227
|
+
if (mappingResult.decision.verdict === "BLOCK") {
|
|
228
|
+
// === INJECTION POINT B: Mapping Guard (mapping blocks) ===
|
|
229
|
+
await appendScorecardSafe(basePath, run_id, {
|
|
230
|
+
verdict: "BLOCK",
|
|
231
|
+
bottleneck: "MAPPING_VIOLATION",
|
|
232
|
+
fix_count_increment: 0,
|
|
233
|
+
details: { violations: mappingResult.changeMap.violations.length },
|
|
234
|
+
});
|
|
235
|
+
await appendSignalSafe(basePath, {
|
|
236
|
+
type: "MAPPING_BLOCK",
|
|
237
|
+
severity: "P0",
|
|
238
|
+
run_id,
|
|
239
|
+
data: { verdict: "BLOCK", violations_count: mappingResult.changeMap.violations.length },
|
|
240
|
+
});
|
|
241
|
+
// === END INJECTION POINT B ===
|
|
242
|
+
const statusMessage = getStatusMessage("BLOCK");
|
|
243
|
+
return {
|
|
244
|
+
project_id,
|
|
245
|
+
message_template_id: "BLOCK-02",
|
|
246
|
+
review_summary: {
|
|
247
|
+
decision_context: `프로젝트 ${project_id} 검수 결과`,
|
|
248
|
+
review_result: "BLOCK",
|
|
249
|
+
one_line_verdict: `${statusMessage} - 경계 위반 감지`
|
|
250
|
+
},
|
|
251
|
+
issues_found: mappingViolationIssues,
|
|
252
|
+
next_action: {
|
|
253
|
+
action_type: "ASK_DECISION",
|
|
254
|
+
tool: "vibe_pm.get_decision",
|
|
255
|
+
reason: "소속 경계 위반이 발생했습니다. 결재 단계로 돌아가 다시 결정해야 합니다."
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
// Mapping Guard 실패는 무시 (FAIL-SAFE)
|
|
264
|
+
console.error(`[vibe_pm.inspect_code] Mapping Guard failed: ${err}`);
|
|
265
|
+
}
|
|
266
|
+
// Build command arguments
|
|
267
|
+
const oneLoopResultRaw = await oneLoopSelection({
|
|
268
|
+
run_id,
|
|
269
|
+
base_path: basePath,
|
|
270
|
+
bridge_path: bridgePath,
|
|
271
|
+
target_paths: input.target_paths ?? []
|
|
272
|
+
});
|
|
273
|
+
// Invalidate caches after inspection
|
|
274
|
+
invalidateEngineCache(new RegExp(run_id));
|
|
275
|
+
invalidateStateCache(run_id, basePath);
|
|
276
|
+
// Parse result
|
|
277
|
+
let oneLoopResult = { status: "UNKNOWN" };
|
|
278
|
+
const validated = VibecodingHelperOneLoopSelectionOutputSchema.safeParse(oneLoopResultRaw);
|
|
279
|
+
if (validated.success) {
|
|
280
|
+
oneLoopResult = validated.data;
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
// Keep behavior deterministic for MCP clients: treat as verification failure.
|
|
284
|
+
oneLoopResult = {
|
|
285
|
+
status: "ERROR",
|
|
286
|
+
signal_level: "LEVEL_2",
|
|
287
|
+
issues: [{
|
|
288
|
+
type: "VERIFY_FAIL",
|
|
289
|
+
message: "검수 실행에 실패했습니다.",
|
|
290
|
+
description: "내부 검수 결과 포맷이 올바르지 않습니다."
|
|
291
|
+
}]
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
// Determine review result from signal_level
|
|
295
|
+
const signalLevel = oneLoopResult.signal_level ?? oneLoopResult.signal ?? "LEVEL_2";
|
|
296
|
+
const { result: reviewResult, verdict } = signalToReview(signalLevel);
|
|
297
|
+
// === INJECTION POINT C: Final Verdict ===
|
|
298
|
+
const finalBottleneck = reviewResult !== "GO"
|
|
299
|
+
? inferBottleneck(oneLoopResult.issues)
|
|
300
|
+
: undefined;
|
|
301
|
+
await appendScorecardSafe(basePath, run_id, {
|
|
302
|
+
verdict: reviewResult,
|
|
303
|
+
bottleneck: finalBottleneck,
|
|
304
|
+
fix_count_increment: reviewResult === "GO" ? 0 : 1,
|
|
305
|
+
evidence_refs: oneLoopResult.modified_files,
|
|
306
|
+
});
|
|
307
|
+
await appendSignalSafe(basePath, {
|
|
308
|
+
type: "INSPECT_VERDICT",
|
|
309
|
+
severity: reviewResult === "BLOCK" ? "P0" : reviewResult === "FIX" ? "P1" : "P2",
|
|
310
|
+
run_id,
|
|
311
|
+
data: {
|
|
312
|
+
verdict: reviewResult,
|
|
313
|
+
issues_count: oneLoopResult.issues?.length ?? 0,
|
|
314
|
+
bottleneck: finalBottleneck,
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
// === END INJECTION POINT C ===
|
|
318
|
+
// PR-H: Append inspect_verdict to decision_log (FAIL-SAFE)
|
|
319
|
+
try {
|
|
320
|
+
const work_order_id = await readCurrentWorkOrderId({ workspaceRoot: basePath });
|
|
321
|
+
const decision_id = await readCurrentDecisionId({ workspaceRoot: basePath });
|
|
322
|
+
// BitNet trace_id 읽기 (있으면)
|
|
323
|
+
let bitnet_trace_id = null;
|
|
324
|
+
try {
|
|
325
|
+
const bitnetCache = readLastCheckSync(basePath);
|
|
326
|
+
bitnet_trace_id = bitnetCache.data?.trace_id ?? null;
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
// BitNet not available
|
|
330
|
+
}
|
|
331
|
+
const changed_files_count = oneLoopResult.modified_files?.length ?? null;
|
|
332
|
+
await appendDecisionLogEvent({
|
|
333
|
+
workspaceRoot: basePath,
|
|
334
|
+
event: {
|
|
335
|
+
event_type: "inspect_verdict",
|
|
336
|
+
run_id,
|
|
337
|
+
verdict: reviewResult,
|
|
338
|
+
bitnet_trace_id,
|
|
339
|
+
bitnet_result_path: bitnet_trace_id ? ".vibe/cache/bitnet/last_check.json" : null,
|
|
340
|
+
decision_id,
|
|
341
|
+
work_order_id,
|
|
342
|
+
changed_files_count,
|
|
343
|
+
timestamp: new Date().toISOString(),
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
catch (e) {
|
|
348
|
+
console.error("[decision_log] failed to append inspect_verdict:", e);
|
|
349
|
+
}
|
|
350
|
+
// Transform issues to PM language
|
|
351
|
+
let issues = (oneLoopResult.issues ?? []).map(transformIssue);
|
|
352
|
+
// Merge FIX-level mapping violations (if any)
|
|
353
|
+
if (mappingViolationIssues.length > 0) {
|
|
354
|
+
issues = [...mappingViolationIssues, ...issues];
|
|
355
|
+
}
|
|
356
|
+
// v2.0: Auto-fix recoverable issues if enabled (default: true)
|
|
357
|
+
let fixedIssues = [];
|
|
358
|
+
const autoFixEnabled = input.auto_fix !== false; // default true
|
|
359
|
+
// Check tier for extended auto-fix (Pro only)
|
|
360
|
+
const isPro = (() => {
|
|
361
|
+
try {
|
|
362
|
+
const licenseManager = new LicenseManager();
|
|
363
|
+
return licenseManager.loadEntitlements().planEffective === "PRO";
|
|
364
|
+
}
|
|
365
|
+
catch {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
})();
|
|
369
|
+
if (autoFixEnabled && reviewResult !== "GO") {
|
|
370
|
+
try {
|
|
371
|
+
// 1. Dependencies auto-fix (FREE tier)
|
|
372
|
+
if (hasFixableIssues(issues)) {
|
|
373
|
+
const depFixes = await autoFixDependencies(issues, basePath);
|
|
374
|
+
fixedIssues.push(...depFixes);
|
|
375
|
+
}
|
|
376
|
+
// 2. Import auto-fix (PRO tier only)
|
|
377
|
+
if (isPro && hasFixableImportIssues(issues)) {
|
|
378
|
+
const importFixes = await fixMissingImports(issues, basePath);
|
|
379
|
+
fixedIssues.push(...importFixes);
|
|
380
|
+
}
|
|
381
|
+
// 3. Lint auto-fix (PRO tier only)
|
|
382
|
+
if (isPro && hasFixableLintIssues(issues)) {
|
|
383
|
+
const lintFixes = await fixLintViolations(issues, basePath);
|
|
384
|
+
fixedIssues.push(...lintFixes);
|
|
385
|
+
}
|
|
386
|
+
// If we fixed issues, log for debugging
|
|
387
|
+
if (fixedIssues.length > 0) {
|
|
388
|
+
console.error(`[vibe_pm.inspect_code] Auto-fixed ${fixedIssues.length} issue(s)`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
catch (err) {
|
|
392
|
+
// Auto-fix failed, continue without it
|
|
393
|
+
console.error(`[vibe_pm.inspect_code] Auto-fix failed: ${err}`);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
// === PHASE 14: BuildWorker Integration ===
|
|
397
|
+
let buildResult = null;
|
|
398
|
+
if (input.run_build === true) {
|
|
399
|
+
try {
|
|
400
|
+
const manager = getWorkerManager();
|
|
401
|
+
const buildSteps = input.build_steps ?? [
|
|
402
|
+
{ name: 'lint', cmd: 'npm run lint --if-present', continueOnFailure: true },
|
|
403
|
+
{ name: 'test', cmd: 'npm test --if-present', continueOnFailure: false },
|
|
404
|
+
];
|
|
405
|
+
const submitResult = await manager.submitTask({
|
|
406
|
+
project_id: run_id,
|
|
407
|
+
worker_type: 'build',
|
|
408
|
+
inputs: {
|
|
409
|
+
workspace_root: basePath,
|
|
410
|
+
steps: buildSteps,
|
|
411
|
+
capture: { stdout: true, stderr: true },
|
|
412
|
+
},
|
|
413
|
+
limits: { timeout_ms: 120000 },
|
|
414
|
+
});
|
|
415
|
+
// Poll for completion (max 60 seconds)
|
|
416
|
+
buildResult = await pollForBuildResult(manager, submitResult.task_id, run_id, 60000);
|
|
417
|
+
// Convert build failures to issues
|
|
418
|
+
if (buildResult && buildResult.summary.failed > 0) {
|
|
419
|
+
const buildIssues = buildResult.steps
|
|
420
|
+
.filter(s => !s.success)
|
|
421
|
+
.map(s => ({
|
|
422
|
+
type: 'VERIFY_FAIL',
|
|
423
|
+
business_risk: `${s.name} 실패 (exit code: ${s.exitCode})`,
|
|
424
|
+
plain_explanation: s.stderr?.slice(0, 200) || 'Unknown error',
|
|
425
|
+
technical_detail: {
|
|
426
|
+
file_path: s.name,
|
|
427
|
+
rule_violated: s.command,
|
|
428
|
+
},
|
|
429
|
+
}));
|
|
430
|
+
issues = [...issues, ...buildIssues];
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
catch (err) {
|
|
434
|
+
console.error('[vibe_pm.inspect_code] BuildWorker failed:', err);
|
|
435
|
+
// FAIL-SAFE: continue without build results
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
// === END PHASE 14: BuildWorker Integration ===
|
|
439
|
+
// === POLICY LOOP (Phase IV - opt-in) ===
|
|
440
|
+
let policyAdjustment = null;
|
|
441
|
+
try {
|
|
442
|
+
if (isPolicyEnabled()) {
|
|
443
|
+
const policyConfig = loadPolicyConfig();
|
|
444
|
+
const scorecard = await readScorecard(basePath, run_id);
|
|
445
|
+
// Get BitNet result (may be null)
|
|
446
|
+
let bitnetResult = null;
|
|
447
|
+
try {
|
|
448
|
+
const bitnetCache = readLastCheckSync(basePath);
|
|
449
|
+
if (bitnetCache.data) {
|
|
450
|
+
bitnetResult = {
|
|
451
|
+
verdict: bitnetCache.data.verdict ?? "GO",
|
|
452
|
+
risk_tags: bitnetCache.data.risk_tags,
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
catch {
|
|
457
|
+
// BitNet not available - continue without it
|
|
458
|
+
}
|
|
459
|
+
policyAdjustment = analyzeForPolicy(scorecard, bitnetResult, policyConfig);
|
|
460
|
+
// Log policy signal if triggered
|
|
461
|
+
if (policyAdjustment) {
|
|
462
|
+
await appendSignalSafe(basePath, {
|
|
463
|
+
type: "POLICY_RECOMMENDED",
|
|
464
|
+
severity: "P1",
|
|
465
|
+
run_id,
|
|
466
|
+
evidence: [policyAdjustment.policy_id],
|
|
467
|
+
data: {
|
|
468
|
+
policy_id: policyAdjustment.policy_id,
|
|
469
|
+
trigger: policyAdjustment.trigger,
|
|
470
|
+
gate_mode_suggested: policyAdjustment.gate_mode_suggested,
|
|
471
|
+
reason: policyAdjustment.reason,
|
|
472
|
+
},
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
catch (e) {
|
|
478
|
+
// FAIL-SAFE: policy errors don't block main flow
|
|
479
|
+
console.error("[policy] check failed:", e instanceof Error ? e.message : e);
|
|
480
|
+
}
|
|
481
|
+
// === END POLICY LOOP ===
|
|
482
|
+
// Generate status message
|
|
483
|
+
const statusMessage = getStatusMessage(reviewResult);
|
|
484
|
+
// Determine message template (consider auto-fixed issues)
|
|
485
|
+
const messageTemplateId = fixedIssues.length > 0
|
|
486
|
+
? "DEPS-02" // Auto-fix completed
|
|
487
|
+
: determineMessageTemplate(reviewResult, issues);
|
|
488
|
+
// Generate repair prompt if needed
|
|
489
|
+
let promptBlock;
|
|
490
|
+
if (reviewResult !== "GO" && issues.length > 0) {
|
|
491
|
+
const repairData = {
|
|
492
|
+
projectName: project_id,
|
|
493
|
+
mode,
|
|
494
|
+
problem: issues.map(i => i.business_risk).join("; "),
|
|
495
|
+
cause: issues.map(i => i.plain_explanation).join("; "),
|
|
496
|
+
fixDirection: issues.map(i => `${formatIssueType(i.type).name}: ${i.plain_explanation}`),
|
|
497
|
+
verifyCriteria: ["빌드 성공", "테스트 통과", "범위 내 변경"]
|
|
498
|
+
};
|
|
499
|
+
promptBlock = generateRepairPrompt(repairData);
|
|
500
|
+
}
|
|
501
|
+
// Determine next action
|
|
502
|
+
const nextAction = determineNextAction(reviewResult, promptBlock);
|
|
503
|
+
// Get tier info and run Pro analysis if available
|
|
504
|
+
const tierAnalysis = await runTierAnalysis(basePath);
|
|
505
|
+
// Build output
|
|
506
|
+
const output = {
|
|
507
|
+
project_id,
|
|
508
|
+
message_template_id: messageTemplateId,
|
|
509
|
+
review_summary: {
|
|
510
|
+
decision_context: `프로젝트 ${project_id} 검수 결과`,
|
|
511
|
+
review_result: reviewResult,
|
|
512
|
+
one_line_verdict: `${statusMessage} - ${verdict}`
|
|
513
|
+
},
|
|
514
|
+
issues_found: issues,
|
|
515
|
+
next_action: nextAction
|
|
516
|
+
};
|
|
517
|
+
// Add fixed_issues if any were fixed
|
|
518
|
+
if (fixedIssues.length > 0) {
|
|
519
|
+
output.fixed_issues = fixedIssues;
|
|
520
|
+
}
|
|
521
|
+
// Add policy_adjustment if policy triggered (Phase IV)
|
|
522
|
+
if (policyAdjustment) {
|
|
523
|
+
output.policy_adjustment = {
|
|
524
|
+
policy_id: policyAdjustment.policy_id,
|
|
525
|
+
trigger: policyAdjustment.trigger,
|
|
526
|
+
gate_mode_suggested: policyAdjustment.gate_mode_suggested,
|
|
527
|
+
reason: policyAdjustment.reason,
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
// Add tier analysis results (v1.6.0)
|
|
531
|
+
if (tierAnalysis) {
|
|
532
|
+
output.tier_info = tierAnalysis.tier_info;
|
|
533
|
+
if (tierAnalysis.scorecard) {
|
|
534
|
+
output.scorecard = tierAnalysis.scorecard;
|
|
535
|
+
}
|
|
536
|
+
if (tierAnalysis.policy) {
|
|
537
|
+
output.policy = tierAnalysis.policy;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
// Add build_result (Phase 14)
|
|
541
|
+
if (buildResult) {
|
|
542
|
+
output.build_result = {
|
|
543
|
+
total_duration_ms: buildResult.totalDuration,
|
|
544
|
+
steps_passed: buildResult.summary.passed,
|
|
545
|
+
steps_failed: buildResult.summary.failed,
|
|
546
|
+
artifacts: buildResult.artifacts ? {
|
|
547
|
+
junit: buildResult.artifacts.junit,
|
|
548
|
+
coverage: buildResult.artifacts.coverage,
|
|
549
|
+
} : undefined,
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
return output;
|
|
553
|
+
}
|
|
554
|
+
function transformIssue(rawIssue) {
|
|
555
|
+
const issueType = mapIssueType(rawIssue.type ?? rawIssue.issue_type ?? "unknown");
|
|
556
|
+
const typeInfo = formatIssueType(issueType);
|
|
557
|
+
const issue = {
|
|
558
|
+
type: issueType,
|
|
559
|
+
business_risk: rawIssue.business_risk ?? rawIssue.message ?? "알 수 없는 문제",
|
|
560
|
+
plain_explanation: rawIssue.description ?? typeInfo.description
|
|
561
|
+
};
|
|
562
|
+
// Only add technical_detail if file_path exists
|
|
563
|
+
if (rawIssue.file_path) {
|
|
564
|
+
issue.technical_detail = {
|
|
565
|
+
file_path: rawIssue.file_path,
|
|
566
|
+
line_range: rawIssue.line_range,
|
|
567
|
+
rule_violated: rawIssue.rule_violated
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
return issue;
|
|
571
|
+
}
|
|
572
|
+
function mapIssueType(rawType) {
|
|
573
|
+
const normalized = rawType.toUpperCase().replace(/[\s-]/g, "_");
|
|
574
|
+
// Map various raw types to the 4 valid IssueTypes
|
|
575
|
+
const mapping = {
|
|
576
|
+
// Direct mappings
|
|
577
|
+
RULE_VIOLATION: "RULE_VIOLATION",
|
|
578
|
+
VERIFY_FAIL: "VERIFY_FAIL",
|
|
579
|
+
SCOPE_MISMATCH: "SCOPE_MISMATCH",
|
|
580
|
+
RISK_SPIKE: "RISK_SPIKE",
|
|
581
|
+
// Alias mappings
|
|
582
|
+
BUILD_FAIL: "VERIFY_FAIL",
|
|
583
|
+
TEST_FAIL: "VERIFY_FAIL",
|
|
584
|
+
SPEC_DRIFT: "SCOPE_MISMATCH",
|
|
585
|
+
SCOPE_VIOLATION: "SCOPE_MISMATCH",
|
|
586
|
+
PATH_ZONE_VIOLATION: "SCOPE_MISMATCH",
|
|
587
|
+
LOOP_LIMIT: "RISK_SPIKE"
|
|
588
|
+
};
|
|
589
|
+
return mapping[normalized] ?? "RULE_VIOLATION";
|
|
590
|
+
}
|
|
591
|
+
function determineMessageTemplate(reviewResult, issues) {
|
|
592
|
+
if (reviewResult === "GO") {
|
|
593
|
+
return "GO-01";
|
|
594
|
+
}
|
|
595
|
+
if (reviewResult === "BLOCK") {
|
|
596
|
+
const hasScopeMismatch = issues.some(i => i.type === "SCOPE_MISMATCH");
|
|
597
|
+
return hasScopeMismatch ? "BLOCK-02" : "BLOCK-01";
|
|
598
|
+
}
|
|
599
|
+
// FIX
|
|
600
|
+
const hasVerifyFail = issues.some(i => i.type === "VERIFY_FAIL");
|
|
601
|
+
return hasVerifyFail ? "FIX-02" : "FIX-01";
|
|
602
|
+
}
|
|
603
|
+
function determineNextAction(reviewResult, promptBlock) {
|
|
604
|
+
if (reviewResult === "GO") {
|
|
605
|
+
return {
|
|
606
|
+
action_type: "CONTINUE",
|
|
607
|
+
tool: "vibe_pm.create_work_order",
|
|
608
|
+
reason: "검수 통과. 다음 작업 지시서를 받거나 작업을 완료합니다."
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
if (reviewResult === "BLOCK") {
|
|
612
|
+
return {
|
|
613
|
+
action_type: "ASK_DECISION",
|
|
614
|
+
tool: "vibe_pm.get_decision",
|
|
615
|
+
reason: "결재 단계로 돌아가 다시 결정해야 합니다."
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
// FIX - use COPY_PASTE_TO_AGENT if we have a prompt block
|
|
619
|
+
if (promptBlock) {
|
|
620
|
+
return {
|
|
621
|
+
action_type: "COPY_PASTE_TO_AGENT",
|
|
622
|
+
label: "수정 프롬프트",
|
|
623
|
+
prompt_block: promptBlock
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
// FIX without prompt block - suggest doctor
|
|
627
|
+
return {
|
|
628
|
+
action_type: "CONTINUE",
|
|
629
|
+
tool: "vibe_pm.doctor",
|
|
630
|
+
reason: "문제를 수정한 후 다시 검수해주세요."
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Run tier analysis (Scorecard, Policy) for Pro users
|
|
635
|
+
* FAIL-SAFE: Returns tier_info only on error or Free tier
|
|
636
|
+
*/
|
|
637
|
+
async function runTierAnalysis(basePath) {
|
|
638
|
+
try {
|
|
639
|
+
const manager = new LicenseManager();
|
|
640
|
+
const entitlements = manager.loadEntitlements();
|
|
641
|
+
const isPro = entitlements.planEffective === "PRO";
|
|
642
|
+
const featuresUsed = [];
|
|
643
|
+
// Base tier info (always returned)
|
|
644
|
+
const tierInfo = {
|
|
645
|
+
plan: entitlements.planEffective,
|
|
646
|
+
features_used: featuresUsed,
|
|
647
|
+
};
|
|
648
|
+
// If not Pro, return basic tier info only
|
|
649
|
+
if (!isPro) {
|
|
650
|
+
return { tier_info: tierInfo };
|
|
651
|
+
}
|
|
652
|
+
// Run Pro-only analysis
|
|
653
|
+
let scorecardResult = null;
|
|
654
|
+
let policyResult = null;
|
|
655
|
+
// Try Scorecard
|
|
656
|
+
try {
|
|
657
|
+
const scorecard = new TierScorecard({ workspace: basePath });
|
|
658
|
+
scorecardResult = await scorecard.generate();
|
|
659
|
+
featuresUsed.push("scorecard");
|
|
660
|
+
}
|
|
661
|
+
catch {
|
|
662
|
+
// Scorecard failed - continue without it
|
|
663
|
+
}
|
|
664
|
+
// Try Policy Analysis
|
|
665
|
+
try {
|
|
666
|
+
const analyzer = new PolicyAnalyzer(basePath);
|
|
667
|
+
policyResult = await analyzer.analyze();
|
|
668
|
+
featuresUsed.push("policy_analysis");
|
|
669
|
+
}
|
|
670
|
+
catch {
|
|
671
|
+
// Policy failed - continue without it
|
|
672
|
+
}
|
|
673
|
+
// Build result
|
|
674
|
+
const result = {
|
|
675
|
+
tier_info: tierInfo,
|
|
676
|
+
};
|
|
677
|
+
if (scorecardResult) {
|
|
678
|
+
result.scorecard = {
|
|
679
|
+
overall_score: scorecardResult.overallScore,
|
|
680
|
+
grade: scorecardResult.grade,
|
|
681
|
+
metrics: scorecardResult.metrics.map((m) => ({
|
|
682
|
+
name: m.name,
|
|
683
|
+
score: m.score,
|
|
684
|
+
})),
|
|
685
|
+
suggestions: scorecardResult.suggestions,
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
if (policyResult) {
|
|
689
|
+
const criticalViolations = policyResult.violations
|
|
690
|
+
.filter((v) => v.severity === "error")
|
|
691
|
+
.slice(0, 5)
|
|
692
|
+
.map((v) => ({
|
|
693
|
+
rule_id: v.ruleId,
|
|
694
|
+
message: v.message,
|
|
695
|
+
}));
|
|
696
|
+
result.policy = {
|
|
697
|
+
passed: policyResult.passed,
|
|
698
|
+
violations_count: policyResult.summary.total,
|
|
699
|
+
critical_violations: criticalViolations,
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
return result;
|
|
703
|
+
}
|
|
704
|
+
catch {
|
|
705
|
+
// FAIL-SAFE: Return null on error (tier info won't be added to output)
|
|
706
|
+
return null;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Poll for build result with timeout
|
|
711
|
+
* @param manager WorkerManager instance
|
|
712
|
+
* @param taskId Task ID to poll
|
|
713
|
+
* @param runId Run ID for project context
|
|
714
|
+
* @param timeoutMs Maximum wait time in milliseconds
|
|
715
|
+
*/
|
|
716
|
+
async function pollForBuildResult(manager, taskId, runId, timeoutMs) {
|
|
717
|
+
const start = Date.now();
|
|
718
|
+
const pollInterval = 500;
|
|
719
|
+
while (Date.now() - start < timeoutMs) {
|
|
720
|
+
const status = await manager.getStatus({ task_id: taskId, project_id: runId });
|
|
721
|
+
const task = status.tasks[0];
|
|
722
|
+
if (task?.status === 'done' || task?.status === 'failed') {
|
|
723
|
+
const result = await manager.getResult({ task_id: taskId, project_id: runId });
|
|
724
|
+
return result.result?.output ?? null;
|
|
725
|
+
}
|
|
726
|
+
await new Promise(r => setTimeout(r, pollInterval));
|
|
727
|
+
}
|
|
728
|
+
return null; // Timeout
|
|
729
|
+
}
|