autosnippet 3.2.21 → 3.3.2
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/dashboard/dist/assets/icons-BJ2mUBi8.js +1 -0
- package/dashboard/dist/assets/index-B659K9t5.js +128 -0
- package/dashboard/dist/assets/index-NCm40PMD.css +1 -0
- package/dashboard/dist/index.html +3 -3
- package/dist/bin/cli.d.ts +1 -1
- package/dist/bin/cli.js +244 -261
- package/dist/lib/agent/context/ExplorationTracker.d.ts +2 -0
- package/dist/lib/agent/context/ExplorationTracker.js +21 -3
- package/dist/lib/agent/core/ToolExecutionPipeline.d.ts +3 -1
- package/dist/lib/agent/core/ToolExecutionPipeline.js +8 -1
- package/dist/lib/agent/forge/DynamicComposer.d.ts +58 -0
- package/dist/lib/agent/forge/DynamicComposer.js +99 -0
- package/dist/lib/agent/forge/SandboxRunner.d.ts +60 -0
- package/dist/lib/agent/forge/SandboxRunner.js +251 -0
- package/dist/lib/agent/forge/TemporaryToolRegistry.d.ts +76 -0
- package/dist/lib/agent/forge/TemporaryToolRegistry.js +154 -0
- package/dist/lib/agent/forge/ToolForge.d.ts +92 -0
- package/dist/lib/agent/forge/ToolForge.js +239 -0
- package/dist/lib/agent/forge/ToolRequirementAnalyzer.d.ts +44 -0
- package/dist/lib/agent/forge/ToolRequirementAnalyzer.js +119 -0
- package/dist/lib/agent/tools/ToolRegistry.d.ts +2 -0
- package/dist/lib/agent/tools/ToolRegistry.js +4 -0
- package/dist/lib/agent/tools/composite.js +0 -1
- package/dist/lib/agent/tools/index.d.ts +2 -50
- package/dist/lib/agent/tools/index.js +2 -3
- package/dist/lib/agent/tools/lifecycle.d.ts +1 -58
- package/dist/lib/agent/tools/lifecycle.js +2 -75
- package/dist/lib/cli/SetupService.d.ts +46 -2
- package/dist/lib/cli/SetupService.js +2 -27
- package/dist/lib/cli/deploy/FileManifest.d.ts +0 -21
- package/dist/lib/cli/deploy/FileManifest.js +0 -11
- package/dist/lib/{platform/ios/spm → core/discovery}/SpmDiscoverer.d.ts +2 -5
- package/dist/lib/{platform/ios/spm → core/discovery}/SpmDiscoverer.js +159 -44
- package/dist/lib/core/discovery/index.d.ts +1 -1
- package/dist/lib/core/discovery/index.js +2 -2
- package/dist/lib/domain/knowledge/KnowledgeEntry.d.ts +10 -0
- package/dist/lib/domain/knowledge/KnowledgeEntry.js +2 -0
- package/dist/lib/domain/knowledge/Lifecycle.d.ts +19 -2
- package/dist/lib/domain/knowledge/Lifecycle.js +32 -6
- package/dist/lib/domain/knowledge/UnifiedValidator.d.ts +1 -5
- package/dist/lib/domain/knowledge/UnifiedValidator.js +7 -44
- package/dist/lib/domain/knowledge/values/Stats.d.ts +29 -0
- package/dist/lib/domain/knowledge/values/Stats.js +41 -0
- package/dist/lib/external/mcp/McpServer.d.ts +19 -38
- package/dist/lib/external/mcp/McpServer.js +145 -117
- package/dist/lib/external/mcp/autoApproveInjector.js +0 -2
- package/dist/lib/external/mcp/handlers/bootstrap/MissionBriefingBuilder.d.ts +26 -1
- package/dist/lib/external/mcp/handlers/bootstrap/MissionBriefingBuilder.js +41 -0
- package/dist/lib/external/mcp/handlers/bootstrap/pipeline/orchestrator.js +49 -0
- package/dist/lib/external/mcp/handlers/bootstrap/shared/bootstrap-phases.d.ts +3 -0
- package/dist/lib/external/mcp/handlers/bootstrap/shared/bootstrap-phases.js +27 -0
- package/dist/lib/external/mcp/handlers/bootstrap/skills.js +1 -1
- package/dist/lib/external/mcp/handlers/bootstrap-external.js +1 -0
- package/dist/lib/external/mcp/handlers/bootstrap-internal.js +2 -0
- package/dist/lib/external/mcp/handlers/consolidated.d.ts +116 -6
- package/dist/lib/external/mcp/handlers/consolidated.js +251 -71
- package/dist/lib/external/mcp/handlers/guard.d.ts +150 -0
- package/dist/lib/external/mcp/handlers/guard.js +245 -8
- package/dist/lib/external/mcp/handlers/knowledge.d.ts +0 -29
- package/dist/lib/external/mcp/handlers/knowledge.js +1 -76
- package/dist/lib/external/mcp/handlers/panorama.d.ts +36 -0
- package/dist/lib/external/mcp/handlers/panorama.js +156 -0
- package/dist/lib/external/mcp/handlers/system.d.ts +2 -54
- package/dist/lib/external/mcp/handlers/system.js +3 -113
- package/dist/lib/external/mcp/handlers/task.d.ts +13 -24
- package/dist/lib/external/mcp/handlers/task.js +217 -557
- package/dist/lib/external/mcp/handlers/types.d.ts +91 -8
- package/dist/lib/external/mcp/handlers/types.js +18 -1
- package/dist/lib/external/mcp/handlers/wiki-external.d.ts +18 -1
- package/dist/lib/external/mcp/handlers/wiki-external.js +16 -1
- package/dist/lib/external/mcp/tools.d.ts +14 -20
- package/dist/lib/external/mcp/tools.js +62 -91
- package/dist/lib/http/HttpServer.js +52 -6
- package/dist/lib/http/routes/{snippets.d.ts → audit.d.ts} +4 -2
- package/dist/lib/http/routes/audit.js +51 -0
- package/dist/lib/http/routes/commands.d.ts +1 -1
- package/dist/lib/http/routes/commands.js +1 -66
- package/dist/lib/http/routes/guardReport.d.ts +10 -0
- package/dist/lib/http/routes/guardReport.js +143 -0
- package/dist/lib/http/routes/knowledge.js +32 -1
- package/dist/lib/http/routes/panorama.d.ts +11 -0
- package/dist/lib/http/routes/panorama.js +322 -0
- package/dist/lib/http/routes/remote.js +0 -5
- package/dist/lib/http/routes/signals.d.ts +10 -0
- package/dist/lib/http/routes/signals.js +104 -0
- package/dist/lib/http/routes/task.d.ts +2 -3
- package/dist/lib/http/routes/task.js +17 -347
- package/dist/lib/http/routes/violations.js +1 -1
- package/dist/lib/infrastructure/audit/AuditLogger.d.ts +6 -1
- package/dist/lib/infrastructure/audit/AuditLogger.js +14 -1
- package/dist/lib/infrastructure/database/drizzle/schema.d.ts +181 -583
- package/dist/lib/infrastructure/database/drizzle/schema.js +28 -69
- package/dist/lib/infrastructure/database/migrations/004_evolution_proposals.d.ts +8 -0
- package/dist/lib/infrastructure/database/migrations/004_evolution_proposals.js +43 -0
- package/dist/lib/infrastructure/logging/Logger.d.ts +2 -0
- package/dist/lib/infrastructure/logging/Logger.js +34 -7
- package/dist/lib/infrastructure/monitoring/ErrorTracker.js +3 -1
- package/dist/lib/infrastructure/monitoring/PerformanceMonitor.d.ts +2 -2
- package/dist/lib/infrastructure/monitoring/PerformanceMonitor.js +12 -10
- package/dist/lib/infrastructure/notification/LarkNotifier.d.ts +24 -0
- package/dist/lib/infrastructure/notification/LarkNotifier.js +97 -0
- package/dist/lib/infrastructure/report/ReportStore.d.ts +45 -0
- package/dist/lib/infrastructure/report/ReportStore.js +133 -0
- package/dist/lib/infrastructure/signal/SignalAggregator.d.ts +18 -0
- package/dist/lib/infrastructure/signal/SignalAggregator.js +84 -0
- package/dist/lib/infrastructure/signal/SignalBridge.d.ts +13 -0
- package/dist/lib/infrastructure/signal/SignalBridge.js +20 -0
- package/dist/lib/infrastructure/signal/SignalBus.d.ts +63 -0
- package/dist/lib/infrastructure/signal/SignalBus.js +106 -0
- package/dist/lib/infrastructure/signal/SignalTraceWriter.d.ts +36 -0
- package/dist/lib/infrastructure/signal/SignalTraceWriter.js +130 -0
- package/dist/lib/injection/ServiceContainer.js +6 -0
- package/dist/lib/injection/ServiceMap.d.ts +16 -19
- package/dist/lib/injection/modules/AgentModule.d.ts +1 -1
- package/dist/lib/injection/modules/AgentModule.js +7 -1
- package/dist/lib/injection/modules/AppModule.d.ts +3 -4
- package/dist/lib/injection/modules/AppModule.js +7 -43
- package/dist/lib/injection/modules/GuardModule.js +59 -2
- package/dist/lib/injection/modules/InfraModule.d.ts +0 -1
- package/dist/lib/injection/modules/InfraModule.js +9 -7
- package/dist/lib/injection/modules/KnowledgeModule.js +51 -0
- package/dist/lib/injection/modules/PanoramaModule.d.ts +18 -0
- package/dist/lib/injection/modules/PanoramaModule.js +76 -0
- package/dist/lib/injection/modules/SignalModule.d.ts +10 -0
- package/dist/lib/injection/modules/SignalModule.js +84 -0
- package/dist/lib/repository/knowledge/KnowledgeRepository.impl.d.ts +1 -0
- package/dist/lib/repository/knowledge/KnowledgeRepository.impl.js +6 -0
- package/dist/lib/service/bootstrap/BootstrapTaskManager.d.ts +3 -1
- package/dist/lib/service/bootstrap/BootstrapTaskManager.js +20 -1
- package/dist/lib/service/delivery/AgentInstructionsGenerator.js +4 -5
- package/dist/lib/service/delivery/CursorDeliveryPipeline.d.ts +3 -1
- package/dist/lib/service/delivery/CursorDeliveryPipeline.js +13 -10
- package/dist/lib/service/delivery/RulesGenerator.js +3 -2
- package/dist/lib/service/evolution/ConsolidationAdvisor.d.ts +114 -0
- package/dist/lib/service/evolution/ConsolidationAdvisor.js +542 -0
- package/dist/lib/service/evolution/ContradictionDetector.d.ts +54 -0
- package/dist/lib/service/evolution/ContradictionDetector.js +253 -0
- package/dist/lib/service/evolution/DecayDetector.d.ts +71 -0
- package/dist/lib/service/evolution/DecayDetector.js +244 -0
- package/dist/lib/service/evolution/EnhancementSuggester.d.ts +38 -0
- package/dist/lib/service/evolution/EnhancementSuggester.js +220 -0
- package/dist/lib/service/evolution/KnowledgeMetabolism.d.ts +82 -0
- package/dist/lib/service/evolution/KnowledgeMetabolism.js +167 -0
- package/dist/lib/service/evolution/RedundancyAnalyzer.d.ts +53 -0
- package/dist/lib/service/evolution/RedundancyAnalyzer.js +210 -0
- package/dist/lib/service/evolution/StagingManager.d.ts +57 -0
- package/dist/lib/service/evolution/StagingManager.js +201 -0
- package/dist/lib/service/guard/ComplianceReporter.d.ts +42 -2
- package/dist/lib/service/guard/ComplianceReporter.js +43 -5
- package/dist/lib/service/guard/CoverageAnalyzer.d.ts +54 -0
- package/dist/lib/service/guard/CoverageAnalyzer.js +149 -0
- package/dist/lib/service/guard/GuardCheckEngine.d.ts +55 -1
- package/dist/lib/service/guard/GuardCheckEngine.js +508 -15
- package/dist/lib/service/guard/GuardFeedbackLoop.d.ts +3 -0
- package/dist/lib/service/guard/GuardFeedbackLoop.js +9 -0
- package/dist/lib/service/guard/ReverseGuard.d.ts +73 -0
- package/dist/lib/service/guard/ReverseGuard.js +256 -0
- package/dist/lib/service/guard/RuleLearner.d.ts +12 -0
- package/dist/lib/service/guard/RuleLearner.js +38 -0
- package/dist/lib/service/guard/UncertaintyCollector.d.ts +83 -0
- package/dist/lib/service/guard/UncertaintyCollector.js +149 -0
- package/dist/lib/service/guard/ViolationsStore.d.ts +1 -0
- package/dist/lib/service/guard/ViolationsStore.js +33 -3
- package/dist/lib/service/knowledge/ConfidenceRouter.d.ts +13 -0
- package/dist/lib/service/knowledge/ConfidenceRouter.js +14 -0
- package/dist/lib/service/knowledge/KnowledgeService.js +22 -4
- package/dist/lib/service/module/ModuleService.js +3 -13
- package/dist/lib/service/panorama/CouplingAnalyzer.d.ts +27 -0
- package/dist/lib/service/panorama/CouplingAnalyzer.js +192 -0
- package/dist/lib/service/panorama/DimensionAnalyzer.d.ts +28 -0
- package/dist/lib/service/panorama/DimensionAnalyzer.js +320 -0
- package/dist/lib/service/panorama/LayerInferrer.d.ts +19 -0
- package/dist/lib/service/panorama/LayerInferrer.js +182 -0
- package/dist/lib/service/panorama/ModuleDiscoverer.d.ts +24 -0
- package/dist/lib/service/panorama/ModuleDiscoverer.js +185 -0
- package/dist/lib/service/panorama/PanoramaAggregator.d.ts +29 -0
- package/dist/lib/service/panorama/PanoramaAggregator.js +228 -0
- package/dist/lib/service/panorama/PanoramaScanner.d.ts +52 -0
- package/dist/lib/service/panorama/PanoramaScanner.js +188 -0
- package/dist/lib/service/panorama/PanoramaService.d.ts +108 -0
- package/dist/lib/service/panorama/PanoramaService.js +220 -0
- package/dist/lib/service/panorama/PanoramaTypes.d.ts +134 -0
- package/dist/lib/service/panorama/PanoramaTypes.js +6 -0
- package/dist/lib/service/panorama/RoleRefiner.d.ts +48 -0
- package/dist/lib/service/panorama/RoleRefiner.js +535 -0
- package/dist/lib/service/search/MultiSignalRanker.d.ts +1 -0
- package/dist/lib/service/search/MultiSignalRanker.js +16 -0
- package/dist/lib/service/search/SearchEngine.d.ts +1 -0
- package/dist/lib/service/search/SearchEngine.js +9 -1
- package/dist/lib/service/search/SearchTypes.d.ts +2 -0
- package/dist/lib/service/signal/HitRecorder.d.ts +68 -0
- package/dist/lib/service/signal/HitRecorder.js +173 -0
- package/dist/lib/service/skills/SignalCollector.d.ts +3 -1
- package/dist/lib/service/skills/SignalCollector.js +31 -1
- package/dist/lib/service/task/IntentExtractor.d.ts +58 -0
- package/dist/lib/service/task/IntentExtractor.js +142 -0
- package/dist/lib/service/task/PrimeSearchPipeline.d.ts +54 -0
- package/dist/lib/service/task/PrimeSearchPipeline.js +98 -0
- package/dist/lib/shared/constants.d.ts +0 -15
- package/dist/lib/shared/constants.js +0 -10
- package/dist/lib/shared/schemas/config.d.ts +4 -1
- package/dist/lib/shared/schemas/config.js +8 -1
- package/dist/lib/shared/schemas/mcp-tools.d.ts +41 -96
- package/dist/lib/shared/schemas/mcp-tools.js +59 -119
- package/dist/scripts/analyze-signals.d.ts +20 -0
- package/dist/scripts/analyze-signals.js +155 -0
- package/dist/scripts/diagnose-mcp.js +1 -1
- package/dist/scripts/release.js +2 -10
- package/package.json +4 -19
- package/skills/autosnippet-devdocs/SKILL.md +11 -8
- package/templates/claude-code/hooks/autosnippet-session.sh +10 -15
- package/templates/cursor-hooks/hooks/session-start.sh +1 -1
- package/templates/instructions/agent-static.md +2 -1
- package/templates/instructions/conventions.md +5 -6
- package/templates/recipes-setup/README.md +1 -2
- package/dashboard/dist/assets/icons-C1dUryS-.js +0 -1
- package/dashboard/dist/assets/index-D0whuycy.css +0 -1
- package/dashboard/dist/assets/index-DdvZE4Yd.js +0 -128
- package/dist/lib/domain/task/Task.d.ts +0 -140
- package/dist/lib/domain/task/Task.js +0 -254
- package/dist/lib/domain/task/TaskDependency.d.ts +0 -23
- package/dist/lib/domain/task/TaskDependency.js +0 -34
- package/dist/lib/domain/task/TaskIdGenerator.d.ts +0 -40
- package/dist/lib/domain/task/TaskIdGenerator.js +0 -75
- package/dist/lib/domain/task/index.d.ts +0 -4
- package/dist/lib/domain/task/index.js +0 -4
- package/dist/lib/http/routes/snippets.js +0 -49
- package/dist/lib/infrastructure/database/migrations/002_add_tasks.d.ts +0 -11
- package/dist/lib/infrastructure/database/migrations/002_add_tasks.js +0 -86
- package/dist/lib/platform/ClipboardManager.d.ts +0 -24
- package/dist/lib/platform/ClipboardManager.js +0 -142
- package/dist/lib/platform/NativeUi.d.ts +0 -53
- package/dist/lib/platform/NativeUi.js +0 -284
- package/dist/lib/platform/ios/index.d.ts +0 -38
- package/dist/lib/platform/ios/index.js +0 -42
- package/dist/lib/platform/ios/routes/spm.d.ts +0 -9
- package/dist/lib/platform/ios/routes/spm.js +0 -371
- package/dist/lib/platform/ios/snippet/PlaceholderConverter.d.ts +0 -21
- package/dist/lib/platform/ios/snippet/PlaceholderConverter.js +0 -48
- package/dist/lib/platform/ios/snippet/XcodeCodec.d.ts +0 -23
- package/dist/lib/platform/ios/snippet/XcodeCodec.js +0 -96
- package/dist/lib/platform/ios/spm/DependencyGraph.d.ts +0 -56
- package/dist/lib/platform/ios/spm/DependencyGraph.js +0 -195
- package/dist/lib/platform/ios/spm/PackageSwiftParser.d.ts +0 -69
- package/dist/lib/platform/ios/spm/PackageSwiftParser.js +0 -231
- package/dist/lib/platform/ios/spm/PathFinder.d.ts +0 -28
- package/dist/lib/platform/ios/spm/PathFinder.js +0 -117
- package/dist/lib/platform/ios/spm/PolicyEngine.d.ts +0 -44
- package/dist/lib/platform/ios/spm/PolicyEngine.js +0 -79
- package/dist/lib/platform/ios/spm/SpmHelper.d.ts +0 -102
- package/dist/lib/platform/ios/spm/SpmHelper.js +0 -464
- package/dist/lib/platform/ios/xcode/HeaderResolver.d.ts +0 -33
- package/dist/lib/platform/ios/xcode/HeaderResolver.js +0 -90
- package/dist/lib/platform/ios/xcode/SaveEventFilter.d.ts +0 -66
- package/dist/lib/platform/ios/xcode/SaveEventFilter.js +0 -142
- package/dist/lib/platform/ios/xcode/XcodeAutomation.d.ts +0 -71
- package/dist/lib/platform/ios/xcode/XcodeAutomation.js +0 -327
- package/dist/lib/platform/ios/xcode/XcodeImportResolver.d.ts +0 -130
- package/dist/lib/platform/ios/xcode/XcodeImportResolver.js +0 -404
- package/dist/lib/platform/ios/xcode/XcodeIntegration.d.ts +0 -89
- package/dist/lib/platform/ios/xcode/XcodeIntegration.js +0 -588
- package/dist/lib/platform/ios/xcode/XcodeWriteUtils.d.ts +0 -99
- package/dist/lib/platform/ios/xcode/XcodeWriteUtils.js +0 -190
- package/dist/lib/repository/task/TaskRepository.impl.d.ts +0 -171
- package/dist/lib/repository/task/TaskRepository.impl.js +0 -347
- package/dist/lib/service/automation/ActionPipeline.d.ts +0 -34
- package/dist/lib/service/automation/ActionPipeline.js +0 -53
- package/dist/lib/service/automation/AutomationOrchestrator.d.ts +0 -86
- package/dist/lib/service/automation/AutomationOrchestrator.js +0 -57
- package/dist/lib/service/automation/ContextCollector.d.ts +0 -24
- package/dist/lib/service/automation/ContextCollector.js +0 -35
- package/dist/lib/service/automation/DirectiveDetector.d.ts +0 -51
- package/dist/lib/service/automation/DirectiveDetector.js +0 -112
- package/dist/lib/service/automation/FileWatcher.d.ts +0 -51
- package/dist/lib/service/automation/FileWatcher.js +0 -366
- package/dist/lib/service/automation/TriggerResolver.d.ts +0 -36
- package/dist/lib/service/automation/TriggerResolver.js +0 -62
- package/dist/lib/service/automation/handlers/AlinkHandler.d.ts +0 -7
- package/dist/lib/service/automation/handlers/AlinkHandler.js +0 -80
- package/dist/lib/service/automation/handlers/CreateHandler.d.ts +0 -11
- package/dist/lib/service/automation/handlers/CreateHandler.js +0 -170
- package/dist/lib/service/automation/handlers/GuardHandler.d.ts +0 -17
- package/dist/lib/service/automation/handlers/GuardHandler.js +0 -218
- package/dist/lib/service/automation/handlers/HeaderHandler.d.ts +0 -2
- package/dist/lib/service/automation/handlers/HeaderHandler.js +0 -32
- package/dist/lib/service/automation/handlers/SearchHandler.d.ts +0 -11
- package/dist/lib/service/automation/handlers/SearchHandler.js +0 -278
- package/dist/lib/service/snippet/SnippetFactory.d.ts +0 -101
- package/dist/lib/service/snippet/SnippetFactory.js +0 -145
- package/dist/lib/service/snippet/SnippetInstaller.d.ts +0 -91
- package/dist/lib/service/snippet/SnippetInstaller.js +0 -276
- package/dist/lib/service/snippet/codecs/SnippetCodec.d.ts +0 -44
- package/dist/lib/service/snippet/codecs/SnippetCodec.js +0 -35
- package/dist/lib/service/snippet/codecs/VSCodeCodec.d.ts +0 -27
- package/dist/lib/service/snippet/codecs/VSCodeCodec.js +0 -82
- package/dist/lib/service/task/TaskGraphService.d.ts +0 -222
- package/dist/lib/service/task/TaskGraphService.js +0 -597
- package/dist/lib/service/task/TaskKnowledgeBridge.d.ts +0 -95
- package/dist/lib/service/task/TaskKnowledgeBridge.js +0 -298
- package/dist/lib/service/task/TaskReadyEngine.d.ts +0 -84
- package/dist/lib/service/task/TaskReadyEngine.js +0 -115
- package/dist/scripts/build-native-ui.d.ts +0 -3
- package/dist/scripts/build-native-ui.js +0 -62
- package/dist/scripts/init-snippets.d.ts +0 -30
- package/dist/scripts/init-snippets.js +0 -298
- package/dist/scripts/install-full.d.ts +0 -7
- package/dist/scripts/install-full.js +0 -38
- package/resources/native-ui/README.md +0 -29
- package/resources/native-ui/combined-window.swift +0 -494
- package/resources/native-ui/main.swift +0 -598
- package/scripts/postinstall-safe.mjs +0 -89
|
@@ -18,20 +18,41 @@ export class ViolationsStore {
|
|
|
18
18
|
// ─── 写入 ─────────────────────────────────────────────
|
|
19
19
|
/**
|
|
20
20
|
* 追加一次 Guard 运行记录
|
|
21
|
+
* ★ 去重:同一文件、同一违规集合不重复入库,仅更新时间戳
|
|
21
22
|
* ★ Drizzle 类型安全 INSERT + raw SQL 截断
|
|
22
23
|
*/
|
|
23
24
|
appendRun(run) {
|
|
25
|
+
const filePath = run.filePath || '';
|
|
26
|
+
const violations = run.violations || [];
|
|
27
|
+
const violationsJson = JSON.stringify(violations);
|
|
28
|
+
// ── 去重:查最近一条同文件记录,比较违规指纹 ──
|
|
29
|
+
const fingerprint = this.#violationFingerprint(violations);
|
|
30
|
+
if (filePath) {
|
|
31
|
+
const lastRow = this.#db
|
|
32
|
+
.prepare(`SELECT id, violations_json FROM guard_violations WHERE file_path = ? ORDER BY created_at DESC LIMIT 1`)
|
|
33
|
+
.get(filePath);
|
|
34
|
+
if (lastRow) {
|
|
35
|
+
const lastFingerprint = this.#violationFingerprint(JSON.parse(lastRow.violations_json || '[]'));
|
|
36
|
+
if (fingerprint === lastFingerprint) {
|
|
37
|
+
// 违规未变化:仅刷新时间戳,不新增行
|
|
38
|
+
this.#db
|
|
39
|
+
.prepare(`UPDATE guard_violations SET triggered_at = ?, created_at = ? WHERE id = ?`)
|
|
40
|
+
.run(new Date().toISOString(), Math.floor(Date.now() / 1000), lastRow.id);
|
|
41
|
+
return lastRow.id;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
24
45
|
const id = `run_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
|
25
46
|
const now = Math.floor(Date.now() / 1000);
|
|
26
47
|
this.#drizzle
|
|
27
48
|
.insert(guardViolations)
|
|
28
49
|
.values({
|
|
29
50
|
id,
|
|
30
|
-
filePath
|
|
51
|
+
filePath,
|
|
31
52
|
triggeredAt: new Date().toISOString(),
|
|
32
|
-
violationCount:
|
|
53
|
+
violationCount: violations.length,
|
|
33
54
|
summary: run.summary || '',
|
|
34
|
-
violationsJson
|
|
55
|
+
violationsJson,
|
|
35
56
|
createdAt: now,
|
|
36
57
|
})
|
|
37
58
|
.run();
|
|
@@ -45,6 +66,15 @@ export class ViolationsStore {
|
|
|
45
66
|
.run(MAX_RUNS);
|
|
46
67
|
return id;
|
|
47
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* 违规指纹:按 ruleId+severity+line 排序后拼接,用于去重比较
|
|
71
|
+
*/
|
|
72
|
+
#violationFingerprint(violations) {
|
|
73
|
+
return violations
|
|
74
|
+
.map((v) => `${v.ruleId || ''}|${v.severity || ''}|${v.line ?? ''}`)
|
|
75
|
+
.sort()
|
|
76
|
+
.join('\n');
|
|
77
|
+
}
|
|
48
78
|
// ─── 查询 ─────────────────────────────────────────────
|
|
49
79
|
/**
|
|
50
80
|
* 获取所有运行记录(最新在后)
|
|
@@ -8,11 +8,18 @@ interface ConfidenceRouterConfig {
|
|
|
8
8
|
requireReasoning?: boolean;
|
|
9
9
|
trustedSources?: string[];
|
|
10
10
|
trustedAutoApproveThreshold?: number;
|
|
11
|
+
highConfidenceThreshold?: number;
|
|
12
|
+
standardGracePeriod?: number;
|
|
13
|
+
highConfidenceGracePeriod?: number;
|
|
11
14
|
}
|
|
12
15
|
interface RouteResult {
|
|
13
16
|
action: 'auto_approve' | 'pending' | 'reject';
|
|
14
17
|
reason: string;
|
|
15
18
|
confidence?: number;
|
|
19
|
+
/** 目标生命周期状态(六态状态机) */
|
|
20
|
+
targetState?: 'staging' | 'pending' | 'deprecated';
|
|
21
|
+
/** Grace Period(毫秒)— staging → active 自动转换等待时间 */
|
|
22
|
+
gracePeriod?: number;
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* ConfidenceRouter — 知识条目自动审核路由器
|
|
@@ -38,6 +45,12 @@ declare const DEFAULT_CONFIG: {
|
|
|
38
45
|
trustedSources: string[];
|
|
39
46
|
/** 可信来源的自动通过阈值 */
|
|
40
47
|
trustedAutoApproveThreshold: number;
|
|
48
|
+
/** 极高置信度阈值 (≥0.90 → 24h Grace) */
|
|
49
|
+
highConfidenceThreshold: number;
|
|
50
|
+
/** 标准 Grace Period(72h)— staging → active */
|
|
51
|
+
standardGracePeriod: number;
|
|
52
|
+
/** 高置信度 Grace Period(24h) */
|
|
53
|
+
highConfidenceGracePeriod: number;
|
|
41
54
|
};
|
|
42
55
|
export declare class ConfidenceRouter {
|
|
43
56
|
_config: Required<typeof DEFAULT_CONFIG>;
|
|
@@ -23,6 +23,12 @@ const DEFAULT_CONFIG = {
|
|
|
23
23
|
trustedSources: ['bootstrap', 'cursor-scan'],
|
|
24
24
|
/** 可信来源的自动通过阈值 */
|
|
25
25
|
trustedAutoApproveThreshold: 0.7,
|
|
26
|
+
/** 极高置信度阈值 (≥0.90 → 24h Grace) */
|
|
27
|
+
highConfidenceThreshold: 0.9,
|
|
28
|
+
/** 标准 Grace Period(72h)— staging → active */
|
|
29
|
+
standardGracePeriod: 72 * 60 * 60 * 1000,
|
|
30
|
+
/** 高置信度 Grace Period(24h) */
|
|
31
|
+
highConfidenceGracePeriod: 24 * 60 * 60 * 1000,
|
|
26
32
|
};
|
|
27
33
|
export class ConfidenceRouter {
|
|
28
34
|
_config;
|
|
@@ -56,6 +62,7 @@ export class ConfidenceRouter {
|
|
|
56
62
|
action: 'reject',
|
|
57
63
|
reason: `Confidence too low: ${confidence.toFixed(2)} < ${this._config.rejectThreshold}`,
|
|
58
64
|
confidence,
|
|
65
|
+
targetState: 'deprecated',
|
|
59
66
|
};
|
|
60
67
|
}
|
|
61
68
|
// ── 阶段 3: 内容最短长度检查 ──
|
|
@@ -115,12 +122,19 @@ export class ConfidenceRouter {
|
|
|
115
122
|
action: 'pending',
|
|
116
123
|
reason: `Confidence OK (${confidence.toFixed(2)}) but quality low (${qualityScore.toFixed(2)})`,
|
|
117
124
|
confidence,
|
|
125
|
+
targetState: 'pending',
|
|
118
126
|
};
|
|
119
127
|
}
|
|
128
|
+
// 分级 Grace Period: ≥0.90 → 24h, 0.85-0.89 → 72h
|
|
129
|
+
const gracePeriod = confidence >= this._config.highConfidenceThreshold
|
|
130
|
+
? this._config.highConfidenceGracePeriod
|
|
131
|
+
: this._config.standardGracePeriod;
|
|
120
132
|
return {
|
|
121
133
|
action: 'auto_approve',
|
|
122
134
|
reason: `Confidence ${confidence.toFixed(2)} >= threshold ${threshold} (source: ${source})`,
|
|
123
135
|
confidence,
|
|
136
|
+
targetState: 'staging',
|
|
137
|
+
gracePeriod,
|
|
124
138
|
};
|
|
125
139
|
}
|
|
126
140
|
// ── 默认: 需要人工审核 ──
|
|
@@ -67,17 +67,25 @@ export class KnowledgeService {
|
|
|
67
67
|
throw new ValidationError(`SkillHook blocked: ${hookResult.reason || 'unknown'}`);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
// ── ConfidenceRouter —
|
|
70
|
+
// ── ConfidenceRouter — staging 路由 ──
|
|
71
71
|
if (this._confidenceRouter) {
|
|
72
72
|
const route = await this._confidenceRouter.route(entry);
|
|
73
73
|
if (route.action === 'auto_approve') {
|
|
74
74
|
entry.autoApprovable = true;
|
|
75
|
+
// 六态状态机:高置信度条目进入 staging
|
|
76
|
+
if (route.targetState === 'staging' && route.gracePeriod) {
|
|
77
|
+
entry.lifecycle = Lifecycle.STAGING;
|
|
78
|
+
entry.stagingDeadline = Date.now() + route.gracePeriod;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else if (route.action === 'reject' && route.targetState === 'deprecated') {
|
|
82
|
+
entry.lifecycle = Lifecycle.DEPRECATED;
|
|
75
83
|
}
|
|
76
|
-
//
|
|
84
|
+
// pending 保持不变
|
|
77
85
|
}
|
|
78
|
-
// 注意:
|
|
86
|
+
// 注意: staging 条目由 StagingManager.checkAndPromote() 在到期后自动转为 active。
|
|
79
87
|
// autoApprovable 标记保留,供前端显示「推荐批准」徽章。
|
|
80
|
-
// CursorDelivery 已支持高置信度 pending 条目的交付。
|
|
88
|
+
// CursorDelivery 已支持高置信度 staging/pending 条目的交付。
|
|
81
89
|
const saved = await this.repository.create(entry);
|
|
82
90
|
// 同步 relations → knowledge_edges
|
|
83
91
|
this._syncRelationsToGraph(saved.id, saved.relations);
|
|
@@ -583,6 +591,16 @@ export class KnowledgeService {
|
|
|
583
591
|
to: entry.lifecycle,
|
|
584
592
|
actor: context.userId,
|
|
585
593
|
});
|
|
594
|
+
// EventBus: 通知生命周期状态转换(Dashboard 实时更新 + SignalBus)
|
|
595
|
+
if (this._eventBus) {
|
|
596
|
+
this._eventBus.emit('lifecycle:transition', {
|
|
597
|
+
entryId: id,
|
|
598
|
+
from: prevLifecycle,
|
|
599
|
+
to: entry.lifecycle,
|
|
600
|
+
method,
|
|
601
|
+
actor: context.userId,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
586
604
|
return updated;
|
|
587
605
|
}
|
|
588
606
|
catch (error) {
|
|
@@ -366,19 +366,9 @@ export class ModuleService {
|
|
|
366
366
|
if (!Array.isArray(recipes)) {
|
|
367
367
|
recipes = [];
|
|
368
368
|
}
|
|
369
|
-
// 3.5
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
const HeaderResolver = await import('../../platform/ios/xcode/HeaderResolver.js');
|
|
373
|
-
const targetRootDir = await PathFinder.findTargetRootDir(files[0].path);
|
|
374
|
-
for (const recipe of recipes) {
|
|
375
|
-
const headerList = (recipe.headers || []);
|
|
376
|
-
recipe.headerPaths = await Promise.all(headerList.map((h) => HeaderResolver.resolveHeaderRelativePath(h, targetRootDir)));
|
|
377
|
-
recipe.moduleName = targetName;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
catch (err) {
|
|
381
|
-
this.#logger.warn(`[ModuleService] Header resolution failed: ${err.message}`);
|
|
369
|
+
// 3.5 moduleName 注入
|
|
370
|
+
for (const recipe of recipes) {
|
|
371
|
+
recipe.moduleName = targetName;
|
|
382
372
|
}
|
|
383
373
|
// 4. 工具增强
|
|
384
374
|
onProgress?.({ type: 'scan:enriching', recipeCount: recipes.length });
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CouplingAnalyzer — 模块耦合分析
|
|
3
|
+
*
|
|
4
|
+
* 三边融合 (import + call + dataFlow) 构建加权依赖图,
|
|
5
|
+
* 使用 Tarjan SCC 检测循环依赖,计算 fanIn/fanOut。
|
|
6
|
+
*
|
|
7
|
+
* @module CouplingAnalyzer
|
|
8
|
+
*/
|
|
9
|
+
import type { CeDbLike, CyclicDependency, Edge } from './PanoramaTypes.js';
|
|
10
|
+
export interface CouplingMetrics {
|
|
11
|
+
fanIn: number;
|
|
12
|
+
fanOut: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CouplingResult {
|
|
15
|
+
cycles: CyclicDependency[];
|
|
16
|
+
metrics: Map<string, CouplingMetrics>;
|
|
17
|
+
edges: Edge[];
|
|
18
|
+
}
|
|
19
|
+
export declare class CouplingAnalyzer {
|
|
20
|
+
#private;
|
|
21
|
+
constructor(db: CeDbLike, projectRoot: string);
|
|
22
|
+
/**
|
|
23
|
+
* 分析模块间耦合关系
|
|
24
|
+
* @param moduleFiles - Map<moduleName, filePaths[]>
|
|
25
|
+
*/
|
|
26
|
+
analyze(moduleFiles: Map<string, string[]>): CouplingResult;
|
|
27
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CouplingAnalyzer — 模块耦合分析
|
|
3
|
+
*
|
|
4
|
+
* 三边融合 (import + call + dataFlow) 构建加权依赖图,
|
|
5
|
+
* 使用 Tarjan SCC 检测循环依赖,计算 fanIn/fanOut。
|
|
6
|
+
*
|
|
7
|
+
* @module CouplingAnalyzer
|
|
8
|
+
*/
|
|
9
|
+
/* ═══ Edge Weights ════════════════════════════════════════ */
|
|
10
|
+
const EDGE_WEIGHTS = {
|
|
11
|
+
depends_on: 0.5,
|
|
12
|
+
calls: 1.0,
|
|
13
|
+
data_flow: 0.8,
|
|
14
|
+
};
|
|
15
|
+
/* ═══ CouplingAnalyzer Class ══════════════════════════════ */
|
|
16
|
+
export class CouplingAnalyzer {
|
|
17
|
+
#db;
|
|
18
|
+
#projectRoot;
|
|
19
|
+
constructor(db, projectRoot) {
|
|
20
|
+
this.#db = db;
|
|
21
|
+
this.#projectRoot = projectRoot;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 分析模块间耦合关系
|
|
25
|
+
* @param moduleFiles - Map<moduleName, filePaths[]>
|
|
26
|
+
*/
|
|
27
|
+
analyze(moduleFiles) {
|
|
28
|
+
// 1. 构建 file → module 反向索引
|
|
29
|
+
const fileToModule = new Map();
|
|
30
|
+
for (const [mod, files] of moduleFiles) {
|
|
31
|
+
for (const f of files) {
|
|
32
|
+
fileToModule.set(f, mod);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// 2. 从 knowledge_edges 聚合模块间边
|
|
36
|
+
const edges = this.#buildModuleEdges(moduleFiles, fileToModule);
|
|
37
|
+
// 3. 建图
|
|
38
|
+
const adjacency = new Map();
|
|
39
|
+
const allModules = new Set(moduleFiles.keys());
|
|
40
|
+
for (const edge of edges) {
|
|
41
|
+
allModules.add(edge.from);
|
|
42
|
+
allModules.add(edge.to);
|
|
43
|
+
if (!adjacency.has(edge.from)) {
|
|
44
|
+
adjacency.set(edge.from, new Map());
|
|
45
|
+
}
|
|
46
|
+
const existing = adjacency.get(edge.from).get(edge.to) ?? 0;
|
|
47
|
+
adjacency.get(edge.from).set(edge.to, existing + edge.weight);
|
|
48
|
+
}
|
|
49
|
+
// 4. Tarjan SCC
|
|
50
|
+
const cycles = this.#tarjanSCC(adjacency, allModules);
|
|
51
|
+
// 5. fanIn / fanOut
|
|
52
|
+
const metrics = new Map();
|
|
53
|
+
for (const mod of allModules) {
|
|
54
|
+
metrics.set(mod, { fanIn: 0, fanOut: 0 });
|
|
55
|
+
}
|
|
56
|
+
for (const edge of edges) {
|
|
57
|
+
if (edge.from === edge.to) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const fromM = metrics.get(edge.from);
|
|
61
|
+
const toM = metrics.get(edge.to);
|
|
62
|
+
if (fromM) {
|
|
63
|
+
fromM.fanOut++;
|
|
64
|
+
}
|
|
65
|
+
if (toM) {
|
|
66
|
+
toM.fanIn++;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// 去重边 (同 from→to 聚合)
|
|
70
|
+
const dedupEdges = this.#deduplicateEdges(edges);
|
|
71
|
+
return { cycles, metrics, edges: dedupEdges };
|
|
72
|
+
}
|
|
73
|
+
/* ─── Internal helpers ──────────────────────────── */
|
|
74
|
+
#buildModuleEdges(moduleFiles, fileToModule) {
|
|
75
|
+
const edges = [];
|
|
76
|
+
const relations = ['depends_on', 'calls', 'data_flow'];
|
|
77
|
+
for (const relation of relations) {
|
|
78
|
+
const weight = EDGE_WEIGHTS[relation] ?? 0.5;
|
|
79
|
+
// 查询该类型的边(仅限当前项目:至少 from 侧实体属于本项目)
|
|
80
|
+
const rows = this.#db
|
|
81
|
+
.prepare(`SELECT ke.from_id, ke.from_type, ke.to_id, ke.to_type
|
|
82
|
+
FROM knowledge_edges ke
|
|
83
|
+
WHERE ke.relation = ?
|
|
84
|
+
AND (
|
|
85
|
+
ke.from_type = 'module'
|
|
86
|
+
OR EXISTS (
|
|
87
|
+
SELECT 1 FROM code_entities ce
|
|
88
|
+
WHERE ce.entity_id = ke.from_id AND ce.project_root = ?
|
|
89
|
+
)
|
|
90
|
+
)`)
|
|
91
|
+
.all(relation, this.#projectRoot);
|
|
92
|
+
for (const row of rows) {
|
|
93
|
+
const fromId = row.from_id;
|
|
94
|
+
const toId = row.to_id;
|
|
95
|
+
const fromType = row.from_type;
|
|
96
|
+
const toType = row.to_type;
|
|
97
|
+
// module-to-module 直接边 (depends_on)
|
|
98
|
+
if (fromType === 'module' && toType === 'module') {
|
|
99
|
+
if (fromId !== toId && moduleFiles.has(fromId) && moduleFiles.has(toId)) {
|
|
100
|
+
edges.push({ from: fromId, to: toId, weight, relation });
|
|
101
|
+
}
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
// entity-to-entity 边 → 解析 file → module
|
|
105
|
+
const fromModule = this.#resolveEntityModule(fromId, fromType, fileToModule);
|
|
106
|
+
const toModule = this.#resolveEntityModule(toId, toType, fileToModule);
|
|
107
|
+
if (fromModule && toModule && fromModule !== toModule) {
|
|
108
|
+
edges.push({ from: fromModule, to: toModule, weight, relation });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return edges;
|
|
113
|
+
}
|
|
114
|
+
#resolveEntityModule(entityId, _entityType, fileToModule) {
|
|
115
|
+
// 先查实体所在文件
|
|
116
|
+
const row = this.#db
|
|
117
|
+
.prepare(`SELECT file_path FROM code_entities
|
|
118
|
+
WHERE entity_id = ? AND project_root = ? LIMIT 1`)
|
|
119
|
+
.get(entityId, this.#projectRoot);
|
|
120
|
+
if (!row?.file_path) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
return fileToModule.get(row.file_path) ?? null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Tarjan 强连通分量算法
|
|
127
|
+
*/
|
|
128
|
+
#tarjanSCC(adjacency, allNodes) {
|
|
129
|
+
let index = 0;
|
|
130
|
+
const stack = [];
|
|
131
|
+
const onStack = new Set();
|
|
132
|
+
const indices = new Map();
|
|
133
|
+
const lowlinks = new Map();
|
|
134
|
+
const sccs = [];
|
|
135
|
+
const strongConnect = (v) => {
|
|
136
|
+
indices.set(v, index);
|
|
137
|
+
lowlinks.set(v, index);
|
|
138
|
+
index++;
|
|
139
|
+
stack.push(v);
|
|
140
|
+
onStack.add(v);
|
|
141
|
+
const neighbors = adjacency.get(v);
|
|
142
|
+
if (neighbors) {
|
|
143
|
+
for (const w of neighbors.keys()) {
|
|
144
|
+
if (!indices.has(w)) {
|
|
145
|
+
strongConnect(w);
|
|
146
|
+
lowlinks.set(v, Math.min(lowlinks.get(v), lowlinks.get(w)));
|
|
147
|
+
}
|
|
148
|
+
else if (onStack.has(w)) {
|
|
149
|
+
lowlinks.set(v, Math.min(lowlinks.get(v), indices.get(w)));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (lowlinks.get(v) === indices.get(v)) {
|
|
154
|
+
const scc = [];
|
|
155
|
+
let w;
|
|
156
|
+
do {
|
|
157
|
+
w = stack.pop();
|
|
158
|
+
onStack.delete(w);
|
|
159
|
+
scc.push(w);
|
|
160
|
+
} while (w !== v);
|
|
161
|
+
sccs.push(scc);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
for (const node of allNodes) {
|
|
165
|
+
if (!indices.has(node)) {
|
|
166
|
+
strongConnect(node);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// 过滤出 size > 1 的 SCC (即循环依赖)
|
|
170
|
+
return sccs
|
|
171
|
+
.filter((scc) => scc.length > 1)
|
|
172
|
+
.map((cycle) => ({
|
|
173
|
+
cycle: cycle.reverse(),
|
|
174
|
+
severity: cycle.length > 3 ? 'error' : 'warning',
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
#deduplicateEdges(edges) {
|
|
178
|
+
const key = (e) => `${e.from}→${e.to}`;
|
|
179
|
+
const map = new Map();
|
|
180
|
+
for (const e of edges) {
|
|
181
|
+
const k = key(e);
|
|
182
|
+
const existing = map.get(k);
|
|
183
|
+
if (existing) {
|
|
184
|
+
existing.weight = Math.max(existing.weight, e.weight);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
map.set(k, { ...e });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return [...map.values()];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DimensionAnalyzer — 多维度知识健康分析
|
|
3
|
+
*
|
|
4
|
+
* 灵感来源:
|
|
5
|
+
* - ISO/IEC 25010 质量模型 (8 大特性: 可靠性、安全性、可维护性…)
|
|
6
|
+
* - ThoughtWorks Tech Radar (Adopt/Trial/Assess/Hold 四环)
|
|
7
|
+
* - 雷达图/蛛网图可视化模型
|
|
8
|
+
*
|
|
9
|
+
* 核心思路: 不再按「模块 × 文件数」衡量覆盖,
|
|
10
|
+
* 而是按「知识维度」衡量项目在各工程方向上的规范成熟度。
|
|
11
|
+
* 某维度 Recipe 为 0 → 该方向完全空白,标示为 gap。
|
|
12
|
+
*
|
|
13
|
+
* @module DimensionAnalyzer
|
|
14
|
+
*/
|
|
15
|
+
import type { CeDbLike, HealthRadar, KnowledgeGap } from './PanoramaTypes.js';
|
|
16
|
+
export declare class DimensionAnalyzer {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(db: CeDbLike);
|
|
19
|
+
/**
|
|
20
|
+
* 分析项目知识健康雷达
|
|
21
|
+
*
|
|
22
|
+
* @param moduleRoles — 项目中存在的模块角色 (用于 gap 优先级推断)
|
|
23
|
+
*/
|
|
24
|
+
analyze(moduleRoles: string[]): {
|
|
25
|
+
radar: HealthRadar;
|
|
26
|
+
gaps: KnowledgeGap[];
|
|
27
|
+
};
|
|
28
|
+
}
|