@hongmaple0820/med-scale-research-os 0.43.0
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/.scale/mcp-servers.yaml +144 -0
- package/.scale/skills.json +830 -0
- package/.scale/verification.json +52 -0
- package/LICENSE +15 -0
- package/README.en.md +156 -0
- package/README.md +156 -0
- package/dist/adapters/AiderAdapter.d.ts +22 -0
- package/dist/adapters/AiderAdapter.js +262 -0
- package/dist/adapters/AiderAdapter.js.map +1 -0
- package/dist/adapters/AntigravityAdapter.d.ts +4 -0
- package/dist/adapters/AntigravityAdapter.js +21 -0
- package/dist/adapters/AntigravityAdapter.js.map +1 -0
- package/dist/adapters/ClaudeCodeAdapter.d.ts +54 -0
- package/dist/adapters/ClaudeCodeAdapter.js +185 -0
- package/dist/adapters/ClaudeCodeAdapter.js.map +1 -0
- package/dist/adapters/ClineAdapter.d.ts +4 -0
- package/dist/adapters/ClineAdapter.js +20 -0
- package/dist/adapters/ClineAdapter.js.map +1 -0
- package/dist/adapters/CodexAdapter.d.ts +15 -0
- package/dist/adapters/CodexAdapter.js +160 -0
- package/dist/adapters/CodexAdapter.js.map +1 -0
- package/dist/adapters/CursorAdapter.d.ts +14 -0
- package/dist/adapters/CursorAdapter.js +171 -0
- package/dist/adapters/CursorAdapter.js.map +1 -0
- package/dist/adapters/DeepSeekTuiAdapter.d.ts +19 -0
- package/dist/adapters/DeepSeekTuiAdapter.js +263 -0
- package/dist/adapters/DeepSeekTuiAdapter.js.map +1 -0
- package/dist/adapters/DoubaoAdapter.d.ts +14 -0
- package/dist/adapters/DoubaoAdapter.js +184 -0
- package/dist/adapters/DoubaoAdapter.js.map +1 -0
- package/dist/adapters/GeminiAdapter.d.ts +14 -0
- package/dist/adapters/GeminiAdapter.js +163 -0
- package/dist/adapters/GeminiAdapter.js.map +1 -0
- package/dist/adapters/GenericProjectAgentAdapter.d.ts +29 -0
- package/dist/adapters/GenericProjectAgentAdapter.js +204 -0
- package/dist/adapters/GenericProjectAgentAdapter.js.map +1 -0
- package/dist/adapters/HermesAdapter.d.ts +14 -0
- package/dist/adapters/HermesAdapter.js +163 -0
- package/dist/adapters/HermesAdapter.js.map +1 -0
- package/dist/adapters/JCodeAdapter.d.ts +4 -0
- package/dist/adapters/JCodeAdapter.js +19 -0
- package/dist/adapters/JCodeAdapter.js.map +1 -0
- package/dist/adapters/KiloCodeAdapter.d.ts +4 -0
- package/dist/adapters/KiloCodeAdapter.js +20 -0
- package/dist/adapters/KiloCodeAdapter.js.map +1 -0
- package/dist/adapters/KimiAdapter.d.ts +14 -0
- package/dist/adapters/KimiAdapter.js +183 -0
- package/dist/adapters/KimiAdapter.js.map +1 -0
- package/dist/adapters/KiroAdapter.d.ts +14 -0
- package/dist/adapters/KiroAdapter.js +180 -0
- package/dist/adapters/KiroAdapter.js.map +1 -0
- package/dist/adapters/OpenClawAdapter.d.ts +14 -0
- package/dist/adapters/OpenClawAdapter.js +163 -0
- package/dist/adapters/OpenClawAdapter.js.map +1 -0
- package/dist/adapters/OpenCodeAdapter.d.ts +14 -0
- package/dist/adapters/OpenCodeAdapter.js +172 -0
- package/dist/adapters/OpenCodeAdapter.js.map +1 -0
- package/dist/adapters/QCoderAdapter.d.ts +14 -0
- package/dist/adapters/QCoderAdapter.js +159 -0
- package/dist/adapters/QCoderAdapter.js.map +1 -0
- package/dist/adapters/QoderAdapter.d.ts +4 -0
- package/dist/adapters/QoderAdapter.js +21 -0
- package/dist/adapters/QoderAdapter.js.map +1 -0
- package/dist/adapters/TraeAdapter.d.ts +14 -0
- package/dist/adapters/TraeAdapter.js +159 -0
- package/dist/adapters/TraeAdapter.js.map +1 -0
- package/dist/adapters/VSCAdapter.d.ts +14 -0
- package/dist/adapters/VSCAdapter.js +159 -0
- package/dist/adapters/VSCAdapter.js.map +1 -0
- package/dist/adapters/WindsurfAdapter.d.ts +14 -0
- package/dist/adapters/WindsurfAdapter.js +185 -0
- package/dist/adapters/WindsurfAdapter.js.map +1 -0
- package/dist/adapters/WorkBuddyAdapter.d.ts +14 -0
- package/dist/adapters/WorkBuddyAdapter.js +159 -0
- package/dist/adapters/WorkBuddyAdapter.js.map +1 -0
- package/dist/adapters/index.d.ts +32 -0
- package/dist/adapters/index.js +87 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/agents/AgentChannel.d.ts +43 -0
- package/dist/agents/AgentChannel.js +136 -0
- package/dist/agents/AgentChannel.js.map +1 -0
- package/dist/agents/AgentCoordinator.d.ts +29 -0
- package/dist/agents/AgentCoordinator.js +136 -0
- package/dist/agents/AgentCoordinator.js.map +1 -0
- package/dist/agents/AgentDispatcher.d.ts +24 -0
- package/dist/agents/AgentDispatcher.js +112 -0
- package/dist/agents/AgentDispatcher.js.map +1 -0
- package/dist/agents/AgentManager.d.ts +14 -0
- package/dist/agents/AgentManager.js +85 -0
- package/dist/agents/AgentManager.js.map +1 -0
- package/dist/agents/AgentPool.d.ts +59 -0
- package/dist/agents/AgentPool.js +192 -0
- package/dist/agents/AgentPool.js.map +1 -0
- package/dist/agents/AgentRegistry.d.ts +20 -0
- package/dist/agents/AgentRegistry.js +36 -0
- package/dist/agents/AgentRegistry.js.map +1 -0
- package/dist/agents/AgentSourceLoader.d.ts +73 -0
- package/dist/agents/AgentSourceLoader.js +103 -0
- package/dist/agents/AgentSourceLoader.js.map +1 -0
- package/dist/agents/IAgent.d.ts +53 -0
- package/dist/agents/IAgent.js +4 -0
- package/dist/agents/IAgent.js.map +1 -0
- package/dist/agents/LeadershipPresets.d.ts +16 -0
- package/dist/agents/LeadershipPresets.js +152 -0
- package/dist/agents/LeadershipPresets.js.map +1 -0
- package/dist/agents/definitions/debugger.d.ts +2 -0
- package/dist/agents/definitions/debugger.js +6 -0
- package/dist/agents/definitions/debugger.js.map +1 -0
- package/dist/agents/definitions/doc-writer.d.ts +2 -0
- package/dist/agents/definitions/doc-writer.js +6 -0
- package/dist/agents/definitions/doc-writer.js.map +1 -0
- package/dist/agents/definitions/implementer.d.ts +2 -0
- package/dist/agents/definitions/implementer.js +6 -0
- package/dist/agents/definitions/implementer.js.map +1 -0
- package/dist/agents/definitions/planner.d.ts +2 -0
- package/dist/agents/definitions/planner.js +6 -0
- package/dist/agents/definitions/planner.js.map +1 -0
- package/dist/agents/definitions/researcher.d.ts +2 -0
- package/dist/agents/definitions/researcher.js +6 -0
- package/dist/agents/definitions/researcher.js.map +1 -0
- package/dist/agents/definitions/reviewer.d.ts +2 -0
- package/dist/agents/definitions/reviewer.js +6 -0
- package/dist/agents/definitions/reviewer.js.map +1 -0
- package/dist/agents/definitions/security.d.ts +2 -0
- package/dist/agents/definitions/security.js +6 -0
- package/dist/agents/definitions/security.js.map +1 -0
- package/dist/agents/definitions/tester.d.ts +2 -0
- package/dist/agents/definitions/tester.js +6 -0
- package/dist/agents/definitions/tester.js.map +1 -0
- package/dist/agents/index.d.ts +23 -0
- package/dist/agents/index.js +44 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/profiles.d.ts +26 -0
- package/dist/agents/profiles.js +197 -0
- package/dist/agents/profiles.js.map +1 -0
- package/dist/agents/types.d.ts +262 -0
- package/dist/agents/types.js +4 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/api/cli.d.ts +2 -0
- package/dist/api/cli.js +6678 -0
- package/dist/api/cli.js.map +1 -0
- package/dist/api/doctor.d.ts +83 -0
- package/dist/api/doctor.js +982 -0
- package/dist/api/doctor.js.map +1 -0
- package/dist/api/mcp.d.ts +32 -0
- package/dist/api/mcp.js +223 -0
- package/dist/api/mcp.js.map +1 -0
- package/dist/api/medscale.d.ts +2 -0
- package/dist/api/medscale.js +20 -0
- package/dist/api/medscale.js.map +1 -0
- package/dist/api/quickstart.d.ts +86 -0
- package/dist/api/quickstart.js +291 -0
- package/dist/api/quickstart.js.map +1 -0
- package/dist/artifact/fsm.d.ts +41 -0
- package/dist/artifact/fsm.js +221 -0
- package/dist/artifact/fsm.js.map +1 -0
- package/dist/artifact/fsmDefinitions.d.ts +18 -0
- package/dist/artifact/fsmDefinitions.js +296 -0
- package/dist/artifact/fsmDefinitions.js.map +1 -0
- package/dist/artifact/sqliteStore.d.ts +61 -0
- package/dist/artifact/sqliteStore.js +381 -0
- package/dist/artifact/sqliteStore.js.map +1 -0
- package/dist/artifact/store.d.ts +49 -0
- package/dist/artifact/store.js +116 -0
- package/dist/artifact/store.js.map +1 -0
- package/dist/artifact/types.d.ts +535 -0
- package/dist/artifact/types.js +74 -0
- package/dist/artifact/types.js.map +1 -0
- package/dist/bootstrap/DependencyBootstrap.d.ts +112 -0
- package/dist/bootstrap/DependencyBootstrap.js +1046 -0
- package/dist/bootstrap/DependencyBootstrap.js.map +1 -0
- package/dist/bootstrap/DependencyBootstrapRenderer.d.ts +3 -0
- package/dist/bootstrap/DependencyBootstrapRenderer.js +138 -0
- package/dist/bootstrap/DependencyBootstrapRenderer.js.map +1 -0
- package/dist/bridge/PythonBridge.d.ts +80 -0
- package/dist/bridge/PythonBridge.js +437 -0
- package/dist/bridge/PythonBridge.js.map +1 -0
- package/dist/bridge/index.d.ts +2 -0
- package/dist/bridge/index.js +7 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge/medicalWorkflows.d.ts +29 -0
- package/dist/bridge/medicalWorkflows.js +156 -0
- package/dist/bridge/medicalWorkflows.js.map +1 -0
- package/dist/bridge/types.d.ts +381 -0
- package/dist/bridge/types.js +113 -0
- package/dist/bridge/types.js.map +1 -0
- package/dist/cache/ScanCache.d.ts +41 -0
- package/dist/cache/ScanCache.js +120 -0
- package/dist/cache/ScanCache.js.map +1 -0
- package/dist/capabilities/BrowserCapability.d.ts +30 -0
- package/dist/capabilities/BrowserCapability.js +73 -0
- package/dist/capabilities/BrowserCapability.js.map +1 -0
- package/dist/capabilities/BrowserQACapability.d.ts +165 -0
- package/dist/capabilities/BrowserQACapability.js +438 -0
- package/dist/capabilities/BrowserQACapability.js.map +1 -0
- package/dist/capabilities/CapabilityRegistry.d.ts +17 -0
- package/dist/capabilities/CapabilityRegistry.js +65 -0
- package/dist/capabilities/CapabilityRegistry.js.map +1 -0
- package/dist/capabilities/ComputerCapability.d.ts +28 -0
- package/dist/capabilities/ComputerCapability.js +40 -0
- package/dist/capabilities/ComputerCapability.js.map +1 -0
- package/dist/capabilities/InstalledSkillsIntegration.d.ts +69 -0
- package/dist/capabilities/InstalledSkillsIntegration.js +240 -0
- package/dist/capabilities/InstalledSkillsIntegration.js.map +1 -0
- package/dist/capabilities/SearchCapability.d.ts +46 -0
- package/dist/capabilities/SearchCapability.js +88 -0
- package/dist/capabilities/SearchCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +6 -0
- package/dist/capabilities/index.js +9 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/types.d.ts +92 -0
- package/dist/capabilities/types.js +7 -0
- package/dist/capabilities/types.js.map +1 -0
- package/dist/cli/autofixCommands.d.ts +22 -0
- package/dist/cli/autofixCommands.js +32 -0
- package/dist/cli/autofixCommands.js.map +1 -0
- package/dist/cli/cortexCommands.d.ts +71 -0
- package/dist/cli/cortexCommands.js +335 -0
- package/dist/cli/cortexCommands.js.map +1 -0
- package/dist/cli/costCommands.d.ts +13 -0
- package/dist/cli/costCommands.js +48 -0
- package/dist/cli/costCommands.js.map +1 -0
- package/dist/cli/evolutionCommands.d.ts +112 -0
- package/dist/cli/evolutionCommands.js +246 -0
- package/dist/cli/evolutionCommands.js.map +1 -0
- package/dist/cli/gateStatusCommands.d.ts +1 -0
- package/dist/cli/gateStatusCommands.js +52 -0
- package/dist/cli/gateStatusCommands.js.map +1 -0
- package/dist/cli/liteCommands.d.ts +81 -0
- package/dist/cli/liteCommands.js +148 -0
- package/dist/cli/liteCommands.js.map +1 -0
- package/dist/cli/orchCommands.d.ts +43 -0
- package/dist/cli/orchCommands.js +135 -0
- package/dist/cli/orchCommands.js.map +1 -0
- package/dist/cli/phaseCommands.d.ts +248 -0
- package/dist/cli/phaseCommands.js +1878 -0
- package/dist/cli/phaseCommands.js.map +1 -0
- package/dist/cli/promptCommands.d.ts +1 -0
- package/dist/cli/promptCommands.js +57 -0
- package/dist/cli/promptCommands.js.map +1 -0
- package/dist/cli/qaCommands.d.ts +22 -0
- package/dist/cli/qaCommands.js +84 -0
- package/dist/cli/qaCommands.js.map +1 -0
- package/dist/cli/quickstartCommands.d.ts +17 -0
- package/dist/cli/quickstartCommands.js +47 -0
- package/dist/cli/quickstartCommands.js.map +1 -0
- package/dist/cli/runCommand.d.ts +39 -0
- package/dist/cli/runCommand.js +113 -0
- package/dist/cli/runCommand.js.map +1 -0
- package/dist/cli/scoreCommands.d.ts +1 -0
- package/dist/cli/scoreCommands.js +112 -0
- package/dist/cli/scoreCommands.js.map +1 -0
- package/dist/cli/shieldCommands.d.ts +30 -0
- package/dist/cli/shieldCommands.js +212 -0
- package/dist/cli/shieldCommands.js.map +1 -0
- package/dist/cli/targetCommands.d.ts +552 -0
- package/dist/cli/targetCommands.js +3173 -0
- package/dist/cli/targetCommands.js.map +1 -0
- package/dist/cli/tuiCommands.d.ts +7 -0
- package/dist/cli/tuiCommands.js +33 -0
- package/dist/cli/tuiCommands.js.map +1 -0
- package/dist/cli/vibeCommands.d.ts +64 -0
- package/dist/cli/vibeCommands.js +221 -0
- package/dist/cli/vibeCommands.js.map +1 -0
- package/dist/codegraph/CodeIntelligence.d.ts +147 -0
- package/dist/codegraph/CodeIntelligence.js +681 -0
- package/dist/codegraph/CodeIntelligence.js.map +1 -0
- package/dist/config/profiles.d.ts +64 -0
- package/dist/config/profiles.js +223 -0
- package/dist/config/profiles.js.map +1 -0
- package/dist/context/AntiPatternRegistry.d.ts +38 -0
- package/dist/context/AntiPatternRegistry.js +203 -0
- package/dist/context/AntiPatternRegistry.js.map +1 -0
- package/dist/context/CavemanCompressor.d.ts +20 -0
- package/dist/context/CavemanCompressor.js +14 -0
- package/dist/context/CavemanCompressor.js.map +1 -0
- package/dist/context/ContextBudget.d.ts +128 -0
- package/dist/context/ContextBudget.js +423 -0
- package/dist/context/ContextBudget.js.map +1 -0
- package/dist/context/ContextBuilder.d.ts +71 -0
- package/dist/context/ContextBuilder.js +372 -0
- package/dist/context/ContextBuilder.js.map +1 -0
- package/dist/context/ContextCompiler.d.ts +34 -0
- package/dist/context/ContextCompiler.js +120 -0
- package/dist/context/ContextCompiler.js.map +1 -0
- package/dist/context/ProjectAnatomy.d.ts +18 -0
- package/dist/context/ProjectAnatomy.js +287 -0
- package/dist/context/ProjectAnatomy.js.map +1 -0
- package/dist/context/SessionStartSequence.d.ts +54 -0
- package/dist/context/SessionStartSequence.js +162 -0
- package/dist/context/SessionStartSequence.js.map +1 -0
- package/dist/core/ExternalCommand.d.ts +9 -0
- package/dist/core/ExternalCommand.js +70 -0
- package/dist/core/ExternalCommand.js.map +1 -0
- package/dist/core/GbrainRuntime.d.ts +25 -0
- package/dist/core/GbrainRuntime.js +270 -0
- package/dist/core/GbrainRuntime.js.map +1 -0
- package/dist/core/container.d.ts +14 -0
- package/dist/core/container.js +35 -0
- package/dist/core/container.js.map +1 -0
- package/dist/core/eventBus.d.ts +60 -0
- package/dist/core/eventBus.js +157 -0
- package/dist/core/eventBus.js.map +1 -0
- package/dist/core/logger.d.ts +5 -0
- package/dist/core/logger.js +51 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/cortex/GovernanceMetrics.d.ts +66 -0
- package/dist/cortex/GovernanceMetrics.js +230 -0
- package/dist/cortex/GovernanceMetrics.js.map +1 -0
- package/dist/cortex/InstinctExtractor.d.ts +61 -0
- package/dist/cortex/InstinctExtractor.js +184 -0
- package/dist/cortex/InstinctExtractor.js.map +1 -0
- package/dist/cortex/InstinctStore.d.ts +54 -0
- package/dist/cortex/InstinctStore.js +266 -0
- package/dist/cortex/InstinctStore.js.map +1 -0
- package/dist/cortex/ReflexionEngine.d.ts +34 -0
- package/dist/cortex/ReflexionEngine.js +157 -0
- package/dist/cortex/ReflexionEngine.js.map +1 -0
- package/dist/cortex/SessionInjector.d.ts +44 -0
- package/dist/cortex/SessionInjector.js +127 -0
- package/dist/cortex/SessionInjector.js.map +1 -0
- package/dist/cortex/adapters/ClaudeAdapter.d.ts +17 -0
- package/dist/cortex/adapters/ClaudeAdapter.js +61 -0
- package/dist/cortex/adapters/ClaudeAdapter.js.map +1 -0
- package/dist/cortex/adapters/CodexAdapter.d.ts +10 -0
- package/dist/cortex/adapters/CodexAdapter.js +52 -0
- package/dist/cortex/adapters/CodexAdapter.js.map +1 -0
- package/dist/cortex/adapters/CursorAdapter.d.ts +10 -0
- package/dist/cortex/adapters/CursorAdapter.js +46 -0
- package/dist/cortex/adapters/CursorAdapter.js.map +1 -0
- package/dist/cortex/adapters/GeminiAdapter.d.ts +11 -0
- package/dist/cortex/adapters/GeminiAdapter.js +48 -0
- package/dist/cortex/adapters/GeminiAdapter.js.map +1 -0
- package/dist/dashboard/DashboardServer.d.ts +86 -0
- package/dist/dashboard/DashboardServer.js +380 -0
- package/dist/dashboard/DashboardServer.js.map +1 -0
- package/dist/dashboard/MedicalWorkflowData.d.ts +155 -0
- package/dist/dashboard/MedicalWorkflowData.js +664 -0
- package/dist/dashboard/MedicalWorkflowData.js.map +1 -0
- package/dist/dashboard/MetricsAggregator.d.ts +38 -0
- package/dist/dashboard/MetricsAggregator.js +99 -0
- package/dist/dashboard/MetricsAggregator.js.map +1 -0
- package/dist/dashboard/index.d.ts +4 -0
- package/dist/dashboard/index.js +3 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/dashboard/server.d.ts +52 -0
- package/dist/dashboard/server.js +84 -0
- package/dist/dashboard/server.js.map +1 -0
- package/dist/env/EnvironmentDoctor.d.ts +66 -0
- package/dist/env/EnvironmentDoctor.js +581 -0
- package/dist/env/EnvironmentDoctor.js.map +1 -0
- package/dist/eval/BenchmarkPublisher.d.ts +25 -0
- package/dist/eval/BenchmarkPublisher.js +27 -0
- package/dist/eval/BenchmarkPublisher.js.map +1 -0
- package/dist/eval/WorkflowEval.d.ts +161 -0
- package/dist/eval/WorkflowEval.js +377 -0
- package/dist/eval/WorkflowEval.js.map +1 -0
- package/dist/evolution/AutoDefectCreator.d.ts +43 -0
- package/dist/evolution/AutoDefectCreator.js +157 -0
- package/dist/evolution/AutoDefectCreator.js.map +1 -0
- package/dist/evolution/BehaviorTracker.d.ts +46 -0
- package/dist/evolution/BehaviorTracker.js +67 -0
- package/dist/evolution/BehaviorTracker.js.map +1 -0
- package/dist/evolution/EvolutionEngine.d.ts +102 -0
- package/dist/evolution/EvolutionEngine.js +326 -0
- package/dist/evolution/EvolutionEngine.js.map +1 -0
- package/dist/evolution/EvolutionEvaluator.d.ts +61 -0
- package/dist/evolution/EvolutionEvaluator.js +118 -0
- package/dist/evolution/EvolutionEvaluator.js.map +1 -0
- package/dist/evolution/LessonValidator.d.ts +36 -0
- package/dist/evolution/LessonValidator.js +132 -0
- package/dist/evolution/LessonValidator.js.map +1 -0
- package/dist/evolution/PatternExtractor.d.ts +40 -0
- package/dist/evolution/PatternExtractor.js +83 -0
- package/dist/evolution/PatternExtractor.js.map +1 -0
- package/dist/evolution/RuleMaturity.d.ts +39 -0
- package/dist/evolution/RuleMaturity.js +70 -0
- package/dist/evolution/RuleMaturity.js.map +1 -0
- package/dist/evolution/SessionLearnings.d.ts +70 -0
- package/dist/evolution/SessionLearnings.js +217 -0
- package/dist/evolution/SessionLearnings.js.map +1 -0
- package/dist/evolution/SkillCreator.d.ts +75 -0
- package/dist/evolution/SkillCreator.js +219 -0
- package/dist/evolution/SkillCreator.js.map +1 -0
- package/dist/fsm/FSMAgentBridge.d.ts +59 -0
- package/dist/fsm/FSMAgentBridge.js +193 -0
- package/dist/fsm/FSMAgentBridge.js.map +1 -0
- package/dist/fsm/index.d.ts +2 -0
- package/dist/fsm/index.js +3 -0
- package/dist/fsm/index.js.map +1 -0
- package/dist/governance/GovernanceRoi.d.ts +30 -0
- package/dist/governance/GovernanceRoi.js +102 -0
- package/dist/governance/GovernanceRoi.js.map +1 -0
- package/dist/governance/ProgressiveGovernance.d.ts +22 -0
- package/dist/governance/ProgressiveGovernance.js +159 -0
- package/dist/governance/ProgressiveGovernance.js.map +1 -0
- package/dist/guardrails/ActiveRedTeam.d.ts +46 -0
- package/dist/guardrails/ActiveRedTeam.js +203 -0
- package/dist/guardrails/ActiveRedTeam.js.map +1 -0
- package/dist/guardrails/DependencyAuditor.d.ts +68 -0
- package/dist/guardrails/DependencyAuditor.js +378 -0
- package/dist/guardrails/DependencyAuditor.js.map +1 -0
- package/dist/guardrails/DetectorEnhanced.d.ts +111 -0
- package/dist/guardrails/DetectorEnhanced.js +202 -0
- package/dist/guardrails/DetectorEnhanced.js.map +1 -0
- package/dist/guardrails/GateEvaluator.d.ts +18 -0
- package/dist/guardrails/GateEvaluator.js +129 -0
- package/dist/guardrails/GateEvaluator.js.map +1 -0
- package/dist/guardrails/Gateway.d.ts +26 -0
- package/dist/guardrails/Gateway.js +56 -0
- package/dist/guardrails/Gateway.js.map +1 -0
- package/dist/guardrails/OWASPDetector.d.ts +58 -0
- package/dist/guardrails/OWASPDetector.js +508 -0
- package/dist/guardrails/OWASPDetector.js.map +1 -0
- package/dist/guardrails/ReviewEnforcer.d.ts +52 -0
- package/dist/guardrails/ReviewEnforcer.js +117 -0
- package/dist/guardrails/ReviewEnforcer.js.map +1 -0
- package/dist/guardrails/advancedDetectors.d.ts +38 -0
- package/dist/guardrails/advancedDetectors.js +188 -0
- package/dist/guardrails/advancedDetectors.js.map +1 -0
- package/dist/guardrails/detectors.d.ts +34 -0
- package/dist/guardrails/detectors.js +332 -0
- package/dist/guardrails/detectors.js.map +1 -0
- package/dist/guardrails/roles.d.ts +4 -0
- package/dist/guardrails/roles.js +54 -0
- package/dist/guardrails/roles.js.map +1 -0
- package/dist/hooks/BugPatternDetector.d.ts +36 -0
- package/dist/hooks/BugPatternDetector.js +207 -0
- package/dist/hooks/BugPatternDetector.js.map +1 -0
- package/dist/hooks/HookDeployer.d.ts +44 -0
- package/dist/hooks/HookDeployer.js +144 -0
- package/dist/hooks/HookDeployer.js.map +1 -0
- package/dist/hooks/HookGeneratorEnhanced.d.ts +67 -0
- package/dist/hooks/HookGeneratorEnhanced.js +641 -0
- package/dist/hooks/HookGeneratorEnhanced.js.map +1 -0
- package/dist/hooks/WorkflowHooksManager.d.ts +30 -0
- package/dist/hooks/WorkflowHooksManager.js +160 -0
- package/dist/hooks/WorkflowHooksManager.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/i18n/Language.d.ts +9 -0
- package/dist/i18n/Language.js +38 -0
- package/dist/i18n/Language.js.map +1 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge/CerebrumManager.d.ts +25 -0
- package/dist/knowledge/CerebrumManager.js +127 -0
- package/dist/knowledge/CerebrumManager.js.map +1 -0
- package/dist/knowledge/GraphifyKnowledgeBase.d.ts +38 -0
- package/dist/knowledge/GraphifyKnowledgeBase.js +409 -0
- package/dist/knowledge/GraphifyKnowledgeBase.js.map +1 -0
- package/dist/knowledge/KnowledgeBase.d.ts +51 -0
- package/dist/knowledge/KnowledgeBase.js +182 -0
- package/dist/knowledge/KnowledgeBase.js.map +1 -0
- package/dist/knowledge/SQLiteKnowledgeBase.d.ts +29 -0
- package/dist/knowledge/SQLiteKnowledgeBase.js +203 -0
- package/dist/knowledge/SQLiteKnowledgeBase.js.map +1 -0
- package/dist/knowledge/TfidfIndex.d.ts +50 -0
- package/dist/knowledge/TfidfIndex.js +177 -0
- package/dist/knowledge/TfidfIndex.js.map +1 -0
- package/dist/knowledge/UbiquitousLanguageManager.d.ts +49 -0
- package/dist/knowledge/UbiquitousLanguageManager.js +133 -0
- package/dist/knowledge/UbiquitousLanguageManager.js.map +1 -0
- package/dist/memory/MemoryBrain.d.ts +146 -0
- package/dist/memory/MemoryBrain.js +679 -0
- package/dist/memory/MemoryBrain.js.map +1 -0
- package/dist/memory/MemoryFabric.d.ts +130 -0
- package/dist/memory/MemoryFabric.js +317 -0
- package/dist/memory/MemoryFabric.js.map +1 -0
- package/dist/memory/MemoryIntelligence.d.ts +42 -0
- package/dist/memory/MemoryIntelligence.js +215 -0
- package/dist/memory/MemoryIntelligence.js.map +1 -0
- package/dist/memory/MemoryLearning.d.ts +62 -0
- package/dist/memory/MemoryLearning.js +209 -0
- package/dist/memory/MemoryLearning.js.map +1 -0
- package/dist/memory/MemoryProviders.d.ts +165 -0
- package/dist/memory/MemoryProviders.js +940 -0
- package/dist/memory/MemoryProviders.js.map +1 -0
- package/dist/memory/MemoryReview.d.ts +65 -0
- package/dist/memory/MemoryReview.js +260 -0
- package/dist/memory/MemoryReview.js.map +1 -0
- package/dist/memory/index.d.ts +6 -0
- package/dist/memory/index.js +7 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/orchestration/EffectsWiring.d.ts +8 -0
- package/dist/orchestration/EffectsWiring.js +87 -0
- package/dist/orchestration/EffectsWiring.js.map +1 -0
- package/dist/orchestrator/OrchestratorDaemon.d.ts +44 -0
- package/dist/orchestrator/OrchestratorDaemon.js +150 -0
- package/dist/orchestrator/OrchestratorDaemon.js.map +1 -0
- package/dist/orchestrator/PolicyLoader.d.ts +80 -0
- package/dist/orchestrator/PolicyLoader.js +229 -0
- package/dist/orchestrator/PolicyLoader.js.map +1 -0
- package/dist/orchestrator/ReconciliationLoop.d.ts +71 -0
- package/dist/orchestrator/ReconciliationLoop.js +266 -0
- package/dist/orchestrator/ReconciliationLoop.js.map +1 -0
- package/dist/orchestrator/TrackerAdapter.d.ts +60 -0
- package/dist/orchestrator/TrackerAdapter.js +147 -0
- package/dist/orchestrator/TrackerAdapter.js.map +1 -0
- package/dist/orchestrator/WorkspaceManager.d.ts +66 -0
- package/dist/orchestrator/WorkspaceManager.js +257 -0
- package/dist/orchestrator/WorkspaceManager.js.map +1 -0
- package/dist/output/BrandThemeLoader.d.ts +54 -0
- package/dist/output/BrandThemeLoader.js +340 -0
- package/dist/output/BrandThemeLoader.js.map +1 -0
- package/dist/output/GovernanceDashboard.d.ts +59 -0
- package/dist/output/GovernanceDashboard.js +281 -0
- package/dist/output/GovernanceDashboard.js.map +1 -0
- package/dist/output/HTMLArtifactLayer.d.ts +97 -0
- package/dist/output/HTMLArtifactLayer.js +576 -0
- package/dist/output/HTMLArtifactLayer.js.map +1 -0
- package/dist/output/HTMLDocumentRenderer.d.ts +83 -0
- package/dist/output/HTMLDocumentRenderer.js +718 -0
- package/dist/output/HTMLDocumentRenderer.js.map +1 -0
- package/dist/output/UIPrototypeRenderer.d.ts +61 -0
- package/dist/output/UIPrototypeRenderer.js +500 -0
- package/dist/output/UIPrototypeRenderer.js.map +1 -0
- package/dist/output/index.d.ts +10 -0
- package/dist/output/index.js +8 -0
- package/dist/output/index.js.map +1 -0
- package/dist/prompts/PhasePromptRegistry.d.ts +53 -0
- package/dist/prompts/PhasePromptRegistry.js +517 -0
- package/dist/prompts/PhasePromptRegistry.js.map +1 -0
- package/dist/prompts/PromptOptimizer.d.ts +42 -0
- package/dist/prompts/PromptOptimizer.js +309 -0
- package/dist/prompts/PromptOptimizer.js.map +1 -0
- package/dist/prompts/VibeTemplateGallery.d.ts +25 -0
- package/dist/prompts/VibeTemplateGallery.js +295 -0
- package/dist/prompts/VibeTemplateGallery.js.map +1 -0
- package/dist/qa/BrowserDaemon.d.ts +23 -0
- package/dist/qa/BrowserDaemon.js +79 -0
- package/dist/qa/BrowserDaemon.js.map +1 -0
- package/dist/qa/E2ETestOrchestrator.d.ts +14 -0
- package/dist/qa/E2ETestOrchestrator.js +19 -0
- package/dist/qa/E2ETestOrchestrator.js.map +1 -0
- package/dist/review/CrossModelReviewer.d.ts +35 -0
- package/dist/review/CrossModelReviewer.js +75 -0
- package/dist/review/CrossModelReviewer.js.map +1 -0
- package/dist/review/ReviewAggregator.d.ts +13 -0
- package/dist/review/ReviewAggregator.js +28 -0
- package/dist/review/ReviewAggregator.js.map +1 -0
- package/dist/review/reviewCommands.d.ts +15 -0
- package/dist/review/reviewCommands.js +24 -0
- package/dist/review/reviewCommands.js.map +1 -0
- package/dist/routing/LocalModelProvider.d.ts +11 -0
- package/dist/routing/LocalModelProvider.js +21 -0
- package/dist/routing/LocalModelProvider.js.map +1 -0
- package/dist/routing/ModelRouter.d.ts +42 -0
- package/dist/routing/ModelRouter.js +94 -0
- package/dist/routing/ModelRouter.js.map +1 -0
- package/dist/routing/PromptCachePolicy.d.ts +37 -0
- package/dist/routing/PromptCachePolicy.js +97 -0
- package/dist/routing/PromptCachePolicy.js.map +1 -0
- package/dist/runtime/AiOsRuntime.d.ts +485 -0
- package/dist/runtime/AiOsRuntime.js +1846 -0
- package/dist/runtime/AiOsRuntime.js.map +1 -0
- package/dist/runtime/CostAnalyzer.d.ts +53 -0
- package/dist/runtime/CostAnalyzer.js +160 -0
- package/dist/runtime/CostAnalyzer.js.map +1 -0
- package/dist/runtime/CostOptimizer.d.ts +11 -0
- package/dist/runtime/CostOptimizer.js +21 -0
- package/dist/runtime/CostOptimizer.js.map +1 -0
- package/dist/runtime/ExecutionLedger.d.ts +46 -0
- package/dist/runtime/ExecutionLedger.js +71 -0
- package/dist/runtime/ExecutionLedger.js.map +1 -0
- package/dist/runtime/FinalReportGuard.d.ts +16 -0
- package/dist/runtime/FinalReportGuard.js +14 -0
- package/dist/runtime/FinalReportGuard.js.map +1 -0
- package/dist/runtime/ModelUsageLedger.d.ts +101 -0
- package/dist/runtime/ModelUsageLedger.js +296 -0
- package/dist/runtime/ModelUsageLedger.js.map +1 -0
- package/dist/runtime/RuntimeDoctor.d.ts +23 -0
- package/dist/runtime/RuntimeDoctor.js +151 -0
- package/dist/runtime/RuntimeDoctor.js.map +1 -0
- package/dist/runtime/RuntimeEvidenceLedger.d.ts +50 -0
- package/dist/runtime/RuntimeEvidenceLedger.js +89 -0
- package/dist/runtime/RuntimeEvidenceLedger.js.map +1 -0
- package/dist/runtime/SessionLedger.d.ts +53 -0
- package/dist/runtime/SessionLedger.js +104 -0
- package/dist/runtime/SessionLedger.js.map +1 -0
- package/dist/runtime/index.d.ts +7 -0
- package/dist/runtime/index.js +8 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/setup/SetupVerification.d.ts +42 -0
- package/dist/setup/SetupVerification.js +180 -0
- package/dist/setup/SetupVerification.js.map +1 -0
- package/dist/setup/SetupWizard.d.ts +45 -0
- package/dist/setup/SetupWizard.js +216 -0
- package/dist/setup/SetupWizard.js.map +1 -0
- package/dist/shield/PolicyCompiler.d.ts +70 -0
- package/dist/shield/PolicyCompiler.js +540 -0
- package/dist/shield/PolicyCompiler.js.map +1 -0
- package/dist/shield/ProtectedPaths.d.ts +39 -0
- package/dist/shield/ProtectedPaths.js +179 -0
- package/dist/shield/ProtectedPaths.js.map +1 -0
- package/dist/shield/ShieldProtocol.d.ts +50 -0
- package/dist/shield/ShieldProtocol.js +103 -0
- package/dist/shield/ShieldProtocol.js.map +1 -0
- package/dist/skills/ExternalSkills.d.ts +3 -0
- package/dist/skills/ExternalSkills.js +27 -0
- package/dist/skills/ExternalSkills.js.map +1 -0
- package/dist/skills/GrillingSessionSkill.d.ts +65 -0
- package/dist/skills/GrillingSessionSkill.js +113 -0
- package/dist/skills/GrillingSessionSkill.js.map +1 -0
- package/dist/skills/GrillingTemplates.d.ts +7 -0
- package/dist/skills/GrillingTemplates.js +38 -0
- package/dist/skills/GrillingTemplates.js.map +1 -0
- package/dist/skills/RoleSkills.d.ts +20 -0
- package/dist/skills/RoleSkills.js +154 -0
- package/dist/skills/RoleSkills.js.map +1 -0
- package/dist/skills/SkillCatalog.d.ts +13 -0
- package/dist/skills/SkillCatalog.js +184 -0
- package/dist/skills/SkillCatalog.js.map +1 -0
- package/dist/skills/SkillDiscovery.d.ts +84 -0
- package/dist/skills/SkillDiscovery.js +402 -0
- package/dist/skills/SkillDiscovery.js.map +1 -0
- package/dist/skills/SkillDoctor.d.ts +37 -0
- package/dist/skills/SkillDoctor.js +267 -0
- package/dist/skills/SkillDoctor.js.map +1 -0
- package/dist/skills/SkillExecutor.d.ts +38 -0
- package/dist/skills/SkillExecutor.js +237 -0
- package/dist/skills/SkillExecutor.js.map +1 -0
- package/dist/skills/SkillFrontmatter.d.ts +28 -0
- package/dist/skills/SkillFrontmatter.js +152 -0
- package/dist/skills/SkillFrontmatter.js.map +1 -0
- package/dist/skills/SkillInstaller.d.ts +40 -0
- package/dist/skills/SkillInstaller.js +117 -0
- package/dist/skills/SkillInstaller.js.map +1 -0
- package/dist/skills/SkillMdStandard.d.ts +33 -0
- package/dist/skills/SkillMdStandard.js +88 -0
- package/dist/skills/SkillMdStandard.js.map +1 -0
- package/dist/skills/SkillRadar.d.ts +83 -0
- package/dist/skills/SkillRadar.js +404 -0
- package/dist/skills/SkillRadar.js.map +1 -0
- package/dist/skills/SkillRegistry.d.ts +112 -0
- package/dist/skills/SkillRegistry.js +161 -0
- package/dist/skills/SkillRegistry.js.map +1 -0
- package/dist/skills/SkillRepository.d.ts +71 -0
- package/dist/skills/SkillRepository.js +435 -0
- package/dist/skills/SkillRepository.js.map +1 -0
- package/dist/skills/TriggerEngine.d.ts +43 -0
- package/dist/skills/TriggerEngine.js +142 -0
- package/dist/skills/TriggerEngine.js.map +1 -0
- package/dist/skills/coreSkills.d.ts +6 -0
- package/dist/skills/coreSkills.js +41 -0
- package/dist/skills/coreSkills.js.map +1 -0
- package/dist/skills/index.d.ts +10 -0
- package/dist/skills/index.js +12 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/interop/GStackInterop.d.ts +15 -0
- package/dist/skills/interop/GStackInterop.js +34 -0
- package/dist/skills/interop/GStackInterop.js.map +1 -0
- package/dist/skills/interop/OMCInterop.d.ts +15 -0
- package/dist/skills/interop/OMCInterop.js +34 -0
- package/dist/skills/interop/OMCInterop.js.map +1 -0
- package/dist/skills/routing/SkillGate.d.ts +12 -0
- package/dist/skills/routing/SkillGate.js +117 -0
- package/dist/skills/routing/SkillGate.js.map +1 -0
- package/dist/skills/routing/SkillPlanner.d.ts +8 -0
- package/dist/skills/routing/SkillPlanner.js +179 -0
- package/dist/skills/routing/SkillPlanner.js.map +1 -0
- package/dist/skills/routing/SkillPolicy.d.ts +6 -0
- package/dist/skills/routing/SkillPolicy.js +336 -0
- package/dist/skills/routing/SkillPolicy.js.map +1 -0
- package/dist/skills/routing/SkillRoutingTypes.d.ts +89 -0
- package/dist/skills/routing/SkillRoutingTypes.js +2 -0
- package/dist/skills/routing/SkillRoutingTypes.js.map +1 -0
- package/dist/skills/routing/TaskIntentClassifier.d.ts +6 -0
- package/dist/skills/routing/TaskIntentClassifier.js +79 -0
- package/dist/skills/routing/TaskIntentClassifier.js.map +1 -0
- package/dist/skills/routing/index.d.ts +5 -0
- package/dist/skills/routing/index.js +6 -0
- package/dist/skills/routing/index.js.map +1 -0
- package/dist/tasks/IssueTriageFSM.d.ts +26 -0
- package/dist/tasks/IssueTriageFSM.js +107 -0
- package/dist/tasks/IssueTriageFSM.js.map +1 -0
- package/dist/tasks/TaskEngine.d.ts +97 -0
- package/dist/tasks/TaskEngine.js +289 -0
- package/dist/tasks/TaskEngine.js.map +1 -0
- package/dist/testing/DiffTestSelector.d.ts +22 -0
- package/dist/testing/DiffTestSelector.js +114 -0
- package/dist/testing/DiffTestSelector.js.map +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tools/CommandOutputCompressor.d.ts +28 -0
- package/dist/tools/CommandOutputCompressor.js +242 -0
- package/dist/tools/CommandOutputCompressor.js.map +1 -0
- package/dist/tools/CommandRunLedger.d.ts +77 -0
- package/dist/tools/CommandRunLedger.js +111 -0
- package/dist/tools/CommandRunLedger.js.map +1 -0
- package/dist/tools/RtkRuntime.d.ts +9 -0
- package/dist/tools/RtkRuntime.js +43 -0
- package/dist/tools/RtkRuntime.js.map +1 -0
- package/dist/tools/SafeCommandRunner.d.ts +16 -0
- package/dist/tools/SafeCommandRunner.js +83 -0
- package/dist/tools/SafeCommandRunner.js.map +1 -0
- package/dist/tools/ToolCapabilityRegistry.d.ts +51 -0
- package/dist/tools/ToolCapabilityRegistry.js +295 -0
- package/dist/tools/ToolCapabilityRegistry.js.map +1 -0
- package/dist/tools/ToolEvidenceGate.d.ts +39 -0
- package/dist/tools/ToolEvidenceGate.js +117 -0
- package/dist/tools/ToolEvidenceGate.js.map +1 -0
- package/dist/tools/ToolEvidenceStore.d.ts +58 -0
- package/dist/tools/ToolEvidenceStore.js +129 -0
- package/dist/tools/ToolEvidenceStore.js.map +1 -0
- package/dist/tools/ToolOrchestrator.d.ts +67 -0
- package/dist/tools/ToolOrchestrator.js +252 -0
- package/dist/tools/ToolOrchestrator.js.map +1 -0
- package/dist/tools/ToolPolicy.d.ts +33 -0
- package/dist/tools/ToolPolicy.js +172 -0
- package/dist/tools/ToolPolicy.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tui/TuiDashboard.d.ts +3 -0
- package/dist/tui/TuiDashboard.js +120 -0
- package/dist/tui/TuiDashboard.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.js +15 -0
- package/dist/version.js.map +1 -0
- package/dist/workflow/AdaptiveWorkflowRouter.d.ts +38 -0
- package/dist/workflow/AdaptiveWorkflowRouter.js +214 -0
- package/dist/workflow/AdaptiveWorkflowRouter.js.map +1 -0
- package/dist/workflow/CommitDiscipline.d.ts +68 -0
- package/dist/workflow/CommitDiscipline.js +328 -0
- package/dist/workflow/CommitDiscipline.js.map +1 -0
- package/dist/workflow/ContextGovernance.d.ts +51 -0
- package/dist/workflow/ContextGovernance.js +233 -0
- package/dist/workflow/ContextGovernance.js.map +1 -0
- package/dist/workflow/CrossRepoOrchestrator.d.ts +92 -0
- package/dist/workflow/CrossRepoOrchestrator.js +408 -0
- package/dist/workflow/CrossRepoOrchestrator.js.map +1 -0
- package/dist/workflow/DiagnosticLoop.d.ts +40 -0
- package/dist/workflow/DiagnosticLoop.js +105 -0
- package/dist/workflow/DiagnosticLoop.js.map +1 -0
- package/dist/workflow/EngineeringStandards.d.ts +212 -0
- package/dist/workflow/EngineeringStandards.js +1113 -0
- package/dist/workflow/EngineeringStandards.js.map +1 -0
- package/dist/workflow/EvidenceStore.d.ts +20 -0
- package/dist/workflow/EvidenceStore.js +48 -0
- package/dist/workflow/EvidenceStore.js.map +1 -0
- package/dist/workflow/EvolutionShadowPromoter.d.ts +46 -0
- package/dist/workflow/EvolutionShadowPromoter.js +73 -0
- package/dist/workflow/EvolutionShadowPromoter.js.map +1 -0
- package/dist/workflow/GateCatalog.d.ts +63 -0
- package/dist/workflow/GateCatalog.js +268 -0
- package/dist/workflow/GateCatalog.js.map +1 -0
- package/dist/workflow/GovernanceLock.d.ts +35 -0
- package/dist/workflow/GovernanceLock.js +58 -0
- package/dist/workflow/GovernanceLock.js.map +1 -0
- package/dist/workflow/GovernanceRoi.d.ts +52 -0
- package/dist/workflow/GovernanceRoi.js +204 -0
- package/dist/workflow/GovernanceRoi.js.map +1 -0
- package/dist/workflow/GovernanceTemplatePacks.d.ts +24 -0
- package/dist/workflow/GovernanceTemplatePacks.js +2134 -0
- package/dist/workflow/GovernanceTemplatePacks.js.map +1 -0
- package/dist/workflow/GovernanceTemplates.d.ts +19 -0
- package/dist/workflow/GovernanceTemplates.js +1291 -0
- package/dist/workflow/GovernanceTemplates.js.map +1 -0
- package/dist/workflow/McpGovernance.d.ts +63 -0
- package/dist/workflow/McpGovernance.js +198 -0
- package/dist/workflow/McpGovernance.js.map +1 -0
- package/dist/workflow/OutOfScopeStore.d.ts +37 -0
- package/dist/workflow/OutOfScopeStore.js +164 -0
- package/dist/workflow/OutOfScopeStore.js.map +1 -0
- package/dist/workflow/PhaseMarkerTracker.d.ts +63 -0
- package/dist/workflow/PhaseMarkerTracker.js +291 -0
- package/dist/workflow/PhaseMarkerTracker.js.map +1 -0
- package/dist/workflow/ResourceGovernance.d.ts +120 -0
- package/dist/workflow/ResourceGovernance.js +531 -0
- package/dist/workflow/ResourceGovernance.js.map +1 -0
- package/dist/workflow/ReviewAnalyzer.d.ts +80 -0
- package/dist/workflow/ReviewAnalyzer.js +438 -0
- package/dist/workflow/ReviewAnalyzer.js.map +1 -0
- package/dist/workflow/ReviewStore.d.ts +36 -0
- package/dist/workflow/ReviewStore.js +42 -0
- package/dist/workflow/ReviewStore.js.map +1 -0
- package/dist/workflow/SecurityAudit.d.ts +27 -0
- package/dist/workflow/SecurityAudit.js +294 -0
- package/dist/workflow/SecurityAudit.js.map +1 -0
- package/dist/workflow/SessionCoordinator.d.ts +103 -0
- package/dist/workflow/SessionCoordinator.js +401 -0
- package/dist/workflow/SessionCoordinator.js.map +1 -0
- package/dist/workflow/SessionPreamble.d.ts +19 -0
- package/dist/workflow/SessionPreamble.js +130 -0
- package/dist/workflow/SessionPreamble.js.map +1 -0
- package/dist/workflow/SessionStateTracker.d.ts +74 -0
- package/dist/workflow/SessionStateTracker.js +270 -0
- package/dist/workflow/SessionStateTracker.js.map +1 -0
- package/dist/workflow/ShipPipeline.d.ts +30 -0
- package/dist/workflow/ShipPipeline.js +366 -0
- package/dist/workflow/ShipPipeline.js.map +1 -0
- package/dist/workflow/TaskArtifactScaffolder.d.ts +69 -0
- package/dist/workflow/TaskArtifactScaffolder.js +333 -0
- package/dist/workflow/TaskArtifactScaffolder.js.map +1 -0
- package/dist/workflow/TaskDependencyGraph.d.ts +73 -0
- package/dist/workflow/TaskDependencyGraph.js +245 -0
- package/dist/workflow/TaskDependencyGraph.js.map +1 -0
- package/dist/workflow/TaskLevelDetector.d.ts +41 -0
- package/dist/workflow/TaskLevelDetector.js +219 -0
- package/dist/workflow/TaskLevelDetector.js.map +1 -0
- package/dist/workflow/TaskMetricsStore.d.ts +49 -0
- package/dist/workflow/TaskMetricsStore.js +149 -0
- package/dist/workflow/TaskMetricsStore.js.map +1 -0
- package/dist/workflow/TaskScoreEngine.d.ts +42 -0
- package/dist/workflow/TaskScoreEngine.js +181 -0
- package/dist/workflow/TaskScoreEngine.js.map +1 -0
- package/dist/workflow/TddLoop.d.ts +49 -0
- package/dist/workflow/TddLoop.js +78 -0
- package/dist/workflow/TddLoop.js.map +1 -0
- package/dist/workflow/UpgradeManager.d.ts +178 -0
- package/dist/workflow/UpgradeManager.js +665 -0
- package/dist/workflow/UpgradeManager.js.map +1 -0
- package/dist/workflow/VerificationCommands.d.ts +36 -0
- package/dist/workflow/VerificationCommands.js +123 -0
- package/dist/workflow/VerificationCommands.js.map +1 -0
- package/dist/workflow/VerificationProfile.d.ts +67 -0
- package/dist/workflow/VerificationProfile.js +241 -0
- package/dist/workflow/VerificationProfile.js.map +1 -0
- package/dist/workflow/VerificationSchema.d.ts +46 -0
- package/dist/workflow/VerificationSchema.js +97 -0
- package/dist/workflow/VerificationSchema.js.map +1 -0
- package/dist/workflow/WorkflowArtifactWriter.d.ts +113 -0
- package/dist/workflow/WorkflowArtifactWriter.js +242 -0
- package/dist/workflow/WorkflowArtifactWriter.js.map +1 -0
- package/dist/workflow/WorkflowEngine.d.ts +83 -0
- package/dist/workflow/WorkflowEngine.js +183 -0
- package/dist/workflow/WorkflowEngine.js.map +1 -0
- package/dist/workflow/WorkflowGuidance.d.ts +30 -0
- package/dist/workflow/WorkflowGuidance.js +204 -0
- package/dist/workflow/WorkflowGuidance.js.map +1 -0
- package/dist/workflow/WorkflowOpenTasks.d.ts +16 -0
- package/dist/workflow/WorkflowOpenTasks.js +37 -0
- package/dist/workflow/WorkflowOpenTasks.js.map +1 -0
- package/dist/workflow/WorkflowOrchestrator.d.ts +59 -0
- package/dist/workflow/WorkflowOrchestrator.js +326 -0
- package/dist/workflow/WorkflowOrchestrator.js.map +1 -0
- package/dist/workflow/WorkflowTemplates.d.ts +38 -0
- package/dist/workflow/WorkflowTemplates.js +371 -0
- package/dist/workflow/WorkflowTemplates.js.map +1 -0
- package/dist/workflow/WorkspaceLifecycle.d.ts +71 -0
- package/dist/workflow/WorkspaceLifecycle.js +401 -0
- package/dist/workflow/WorkspaceLifecycle.js.map +1 -0
- package/dist/workflow/WorkspacePolicy.d.ts +46 -0
- package/dist/workflow/WorkspacePolicy.js +141 -0
- package/dist/workflow/WorkspacePolicy.js.map +1 -0
- package/dist/workflow/WorkspaceSafety.d.ts +9 -0
- package/dist/workflow/WorkspaceSafety.js +49 -0
- package/dist/workflow/WorkspaceSafety.js.map +1 -0
- package/dist/workflow/WorkspaceTopology.d.ts +58 -0
- package/dist/workflow/WorkspaceTopology.js +176 -0
- package/dist/workflow/WorkspaceTopology.js.map +1 -0
- package/dist/workflow/autofix/AutoFixEngine.d.ts +37 -0
- package/dist/workflow/autofix/AutoFixEngine.js +169 -0
- package/dist/workflow/autofix/AutoFixEngine.js.map +1 -0
- package/dist/workflow/autonomous/AutonomousDevLoop.d.ts +88 -0
- package/dist/workflow/autonomous/AutonomousDevLoop.js +381 -0
- package/dist/workflow/autonomous/AutonomousDevLoop.js.map +1 -0
- package/dist/workflow/autonomous/BackgroundHunter.d.ts +74 -0
- package/dist/workflow/autonomous/BackgroundHunter.js +220 -0
- package/dist/workflow/autonomous/BackgroundHunter.js.map +1 -0
- package/dist/workflow/autonomous/WorklogManager.d.ts +50 -0
- package/dist/workflow/autonomous/WorklogManager.js +264 -0
- package/dist/workflow/autonomous/WorklogManager.js.map +1 -0
- package/dist/workflow/autonomous/index.d.ts +3 -0
- package/dist/workflow/autonomous/index.js +5 -0
- package/dist/workflow/autonomous/index.js.map +1 -0
- package/dist/workflow/cognitive/AmbiguityScorer.d.ts +17 -0
- package/dist/workflow/cognitive/AmbiguityScorer.js +107 -0
- package/dist/workflow/cognitive/AmbiguityScorer.js.map +1 -0
- package/dist/workflow/cognitive/ConsensusPlanner.d.ts +26 -0
- package/dist/workflow/cognitive/ConsensusPlanner.js +141 -0
- package/dist/workflow/cognitive/ConsensusPlanner.js.map +1 -0
- package/dist/workflow/cognitive/SocraticQuestioner.d.ts +33 -0
- package/dist/workflow/cognitive/SocraticQuestioner.js +276 -0
- package/dist/workflow/cognitive/SocraticQuestioner.js.map +1 -0
- package/dist/workflow/evolution/LessonExtractor.d.ts +90 -0
- package/dist/workflow/evolution/LessonExtractor.js +317 -0
- package/dist/workflow/evolution/LessonExtractor.js.map +1 -0
- package/dist/workflow/evolution/SelfImproveEngine.d.ts +156 -0
- package/dist/workflow/evolution/SelfImproveEngine.js +361 -0
- package/dist/workflow/evolution/SelfImproveEngine.js.map +1 -0
- package/dist/workflow/execution/RalphEngine.d.ts +54 -0
- package/dist/workflow/execution/RalphEngine.js +145 -0
- package/dist/workflow/execution/RalphEngine.js.map +1 -0
- package/dist/workflow/execution/UltraworkEngine.d.ts +43 -0
- package/dist/workflow/execution/UltraworkEngine.js +135 -0
- package/dist/workflow/execution/UltraworkEngine.js.map +1 -0
- package/dist/workflow/gates/EnhancedGates.d.ts +74 -0
- package/dist/workflow/gates/EnhancedGates.js +653 -0
- package/dist/workflow/gates/EnhancedGates.js.map +1 -0
- package/dist/workflow/gates/GateSystem.d.ts +180 -0
- package/dist/workflow/gates/GateSystem.js +1279 -0
- package/dist/workflow/gates/GateSystem.js.map +1 -0
- package/dist/workflow/gates/MetaGovernanceGates.d.ts +70 -0
- package/dist/workflow/gates/MetaGovernanceGates.js +617 -0
- package/dist/workflow/gates/MetaGovernanceGates.js.map +1 -0
- package/dist/workflow/gates/VisualGate.d.ts +41 -0
- package/dist/workflow/gates/VisualGate.js +174 -0
- package/dist/workflow/gates/VisualGate.js.map +1 -0
- package/dist/workflow/index.d.ts +45 -0
- package/dist/workflow/index.js +47 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/qa/E2ETestRunner.d.ts +102 -0
- package/dist/workflow/qa/E2ETestRunner.js +227 -0
- package/dist/workflow/qa/E2ETestRunner.js.map +1 -0
- package/dist/workflow/quality/HonestDelivery.d.ts +19 -0
- package/dist/workflow/quality/HonestDelivery.js +77 -0
- package/dist/workflow/quality/HonestDelivery.js.map +1 -0
- package/dist/workflow/quality/KarpathyEvaluator.d.ts +18 -0
- package/dist/workflow/quality/KarpathyEvaluator.js +76 -0
- package/dist/workflow/quality/KarpathyEvaluator.js.map +1 -0
- package/dist/workflow/types.d.ts +151 -0
- package/dist/workflow/types.js +4 -0
- package/dist/workflow/types.js.map +1 -0
- package/dist/workflows/DAGBuilder.d.ts +52 -0
- package/dist/workflows/DAGBuilder.js +169 -0
- package/dist/workflows/DAGBuilder.js.map +1 -0
- package/dist/workflows/GateParser.d.ts +55 -0
- package/dist/workflows/GateParser.js +73 -0
- package/dist/workflows/GateParser.js.map +1 -0
- package/dist/workflows/WorkflowExecutor.d.ts +56 -0
- package/dist/workflows/WorkflowExecutor.js +143 -0
- package/dist/workflows/WorkflowExecutor.js.map +1 -0
- package/dist/workflows/WorkflowOrchestrator.d.ts +81 -0
- package/dist/workflows/WorkflowOrchestrator.js +337 -0
- package/dist/workflows/WorkflowOrchestrator.js.map +1 -0
- package/dist/workflows/index.d.ts +2 -0
- package/dist/workflows/index.js +5 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/presets.d.ts +34 -0
- package/dist/workflows/presets.js +224 -0
- package/dist/workflows/presets.js.map +1 -0
- package/docs/README.md +105 -0
- package/docs/guides/DEVELOPMENT_WORKFLOW.md +99 -0
- package/docs/guides/GETTING_STARTED.md +93 -0
- package/docs/guides/MEDICAL_AGENT_OPERATING_GUIDE.md +61 -0
- package/docs/guides/MEDICAL_RESEARCH_DELIVERY.md +217 -0
- package/docs/guides/MIGRATION.md +119 -0
- package/docs/reference/cli.md +2921 -0
- package/docs/start/README.md +79 -0
- package/docs/start/agent-governance-demo.md +107 -0
- package/docs/start/artifact-lifecycle.md +326 -0
- package/docs/start/quickstart.md +191 -0
- package/docs/start/workflow-upgrade.md +198 -0
- package/docs/workflow/GATES_AND_SCORE.md +89 -0
- package/docs/workflow/PROMPT_OPTIMIZATION.md +44 -0
- package/docs/workflow/README.md +123 -0
- package/docs/workflow/node-library.md +52 -0
- package/docs/workflow/templates/api-contract.md +29 -0
- package/docs/workflow/templates/architecture-review.md +23 -0
- package/docs/workflow/templates/db-change-plan.md +20 -0
- package/docs/workflow/templates/docs-impact.md +17 -0
- package/docs/workflow/templates/e2e-plan.md +20 -0
- package/docs/workflow/templates/explore.md +16 -0
- package/docs/workflow/templates/github-actions-scale-preflight.yml +32 -0
- package/docs/workflow/templates/mini-prd.md +16 -0
- package/docs/workflow/templates/plan.md +37 -0
- package/docs/workflow/templates/pre-push-scale-preflight.sh +8 -0
- package/docs/workflow/templates/product-smoke.md +61 -0
- package/docs/workflow/templates/reality-check.md +28 -0
- package/docs/workflow/templates/resource-cleanup.md +17 -0
- package/docs/workflow/templates/resource-impact.md +25 -0
- package/docs/workflow/templates/review.md +12 -0
- package/docs/workflow/templates/runtime.md +23 -0
- package/docs/workflow/templates/security-review.md +26 -0
- package/docs/workflow/templates/skill-evidence.md +33 -0
- package/docs/workflow/templates/skill-plan.md +39 -0
- package/docs/workflow/templates/spec.md +17 -0
- package/docs/workflow/templates/standards-impact.md +28 -0
- package/docs/workflow/templates/summary.md +16 -0
- package/docs/workflow/templates/tasks.md +8 -0
- package/docs/workflow/templates/ui-spec.md +29 -0
- package/docs/workflow/templates/verification.md +20 -0
- package/docs/workflow/templates/visual-review.md +20 -0
- package/docs/zh/quickstart.md +108 -0
- package/examples/demo-projects/agent-governance-demo/CONTEXT.md +14 -0
- package/examples/demo-projects/agent-governance-demo/README.md +48 -0
- package/examples/demo-projects/agent-governance-demo/docs/CONTEXT-MAP.md +14 -0
- package/examples/demo-projects/agent-governance-demo/package.json +22 -0
- package/examples/demo-projects/agent-governance-demo/src/oauth-state.ts +39 -0
- package/examples/demo-projects/agent-governance-demo/tests/oauth-state.test.ts +52 -0
- package/mcp-configs/_INDEX.md +55 -0
- package/mcp-configs/context7/config.json +9 -0
- package/mcp-configs/fetch/config.json +9 -0
- package/mcp-configs/filesystem/config.json +9 -0
- package/mcp-configs/github/config.json +11 -0
- package/mcp-configs/memory/config.json +9 -0
- package/mcp-configs/neon/config.json +11 -0
- package/mcp-configs/playwright/config.json +9 -0
- package/mcp-configs/postgres/config.json +11 -0
- package/mcp-configs/puppeteer/config.json +9 -0
- package/mcp-configs/sequential-thinking/config.json +9 -0
- package/package.json +113 -0
- package/scripts/workflow/lib/gbrain-runtime.mjs +185 -0
- package/scripts/workflow/lib/report-output.mjs +107 -0
- package/scripts/workflow/medscale-release-smoke.mjs +338 -0
- package/scripts/workflow/provider-rehearsal.mjs +597 -0
- package/scripts/workflow/setup-smoke.mjs +433 -0
- package/target-research-platform/bridge_runner.py +310 -0
- package/target-research-platform/config.yaml +148 -0
- package/target-research-platform/data/immune_infiltration/ACC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/BLCA.csv +201 -0
- package/target-research-platform/data/immune_infiltration/BRCA.csv +201 -0
- package/target-research-platform/data/immune_infiltration/CESC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/CHOL.csv +201 -0
- package/target-research-platform/data/immune_infiltration/COAD.csv +201 -0
- package/target-research-platform/data/immune_infiltration/DLBC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/ESCA.csv +201 -0
- package/target-research-platform/data/immune_infiltration/GBM.csv +201 -0
- package/target-research-platform/data/immune_infiltration/HNSC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/KICH.csv +201 -0
- package/target-research-platform/data/immune_infiltration/KIRC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/KIRP.csv +201 -0
- package/target-research-platform/data/immune_infiltration/LAML.csv +201 -0
- package/target-research-platform/data/immune_infiltration/LGG.csv +201 -0
- package/target-research-platform/data/immune_infiltration/LIHC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/LUAD.csv +201 -0
- package/target-research-platform/data/immune_infiltration/LUSC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/MESO.csv +201 -0
- package/target-research-platform/data/immune_infiltration/OV.csv +201 -0
- package/target-research-platform/data/immune_infiltration/PAAD.csv +201 -0
- package/target-research-platform/data/immune_infiltration/PCPG.csv +201 -0
- package/target-research-platform/data/immune_infiltration/PRAD.csv +201 -0
- package/target-research-platform/data/immune_infiltration/READ.csv +201 -0
- package/target-research-platform/data/immune_infiltration/SARC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/SKCM.csv +201 -0
- package/target-research-platform/data/immune_infiltration/STAD.csv +201 -0
- package/target-research-platform/data/immune_infiltration/TGCT.csv +201 -0
- package/target-research-platform/data/immune_infiltration/THCA.csv +201 -0
- package/target-research-platform/data/immune_infiltration/THYM.csv +201 -0
- package/target-research-platform/data/immune_infiltration/UCEC.csv +201 -0
- package/target-research-platform/data/immune_infiltration/UCS.csv +201 -0
- package/target-research-platform/data/immune_infiltration/UVM.csv +201 -0
- package/target-research-platform/docs/JSON_SCHEMA.md +352 -0
- package/target-research-platform/docs/PROGRESS_2026-06-09.md +140 -0
- package/target-research-platform/main.py +755 -0
- package/target-research-platform/pyproject.toml +54 -0
- package/target-research-platform/requirements.txt +9 -0
- package/target-research-platform/run_dashboard.py +5 -0
- package/target-research-platform/run_real_medical_workflow.py +28 -0
- package/target-research-platform/scripts/demo_report.py +481 -0
- package/target-research-platform/scripts/generate_evidence_package.py +75 -0
- package/target-research-platform/scripts/prepare_immune_data.py +386 -0
- package/target-research-platform/src/__init__.py +4 -0
- package/target-research-platform/src/analysis/__init__.py +3 -0
- package/target-research-platform/src/analysis/stage1_expression/__init__.py +12 -0
- package/target-research-platform/src/analysis/stage1_expression/immune_correlation.py +366 -0
- package/target-research-platform/src/analysis/stage1_expression/pipeline.py +579 -0
- package/target-research-platform/src/analysis/stage1_expression/survival_analysis.py +382 -0
- package/target-research-platform/src/analysis/stage2_screening/__init__.py +12 -0
- package/target-research-platform/src/analysis/stage2_screening/differential_expression.py +451 -0
- package/target-research-platform/src/analysis/stage2_screening/druggability_score.py +477 -0
- package/target-research-platform/src/analysis/stage2_screening/pipeline.py +822 -0
- package/target-research-platform/src/analysis/stage3_deep_research/__init__.py +12 -0
- package/target-research-platform/src/analysis/stage3_deep_research/competitive_landscape.py +479 -0
- package/target-research-platform/src/analysis/stage3_deep_research/pipeline.py +763 -0
- package/target-research-platform/src/analysis/stage3_deep_research/target_function.py +290 -0
- package/target-research-platform/src/analysis/stage4_business/__init__.py +12 -0
- package/target-research-platform/src/analysis/stage4_business/business_plan.py +816 -0
- package/target-research-platform/src/analysis/stage4_business/milestone_planner.py +844 -0
- package/target-research-platform/src/analysis/stage4_business/pipeline.py +284 -0
- package/target-research-platform/src/api_clients/__init__.py +29 -0
- package/target-research-platform/src/api_clients/aminer_client.py +163 -0
- package/target-research-platform/src/api_clients/base_client.py +186 -0
- package/target-research-platform/src/api_clients/clinicaltrials_client.py +411 -0
- package/target-research-platform/src/api_clients/geo_client.py +1420 -0
- package/target-research-platform/src/api_clients/gtex_client.py +209 -0
- package/target-research-platform/src/api_clients/hpa_client.py +170 -0
- package/target-research-platform/src/api_clients/immune_data_manager.py +247 -0
- package/target-research-platform/src/api_clients/openalex_client.py +86 -0
- package/target-research-platform/src/api_clients/opentargets_client.py +558 -0
- package/target-research-platform/src/api_clients/pubmed_client.py +361 -0
- package/target-research-platform/src/api_clients/tcga_client.py +712 -0
- package/target-research-platform/src/api_clients/timer_client.py +169 -0
- package/target-research-platform/src/dashboard/app.py +2283 -0
- package/target-research-platform/src/dashboard/deliverables.py +710 -0
- package/target-research-platform/src/dashboard/static/artifactPreview.js +96 -0
- package/target-research-platform/src/dashboard/static/index.html +1292 -0
- package/target-research-platform/src/dashboard/status_tracker.py +237 -0
- package/target-research-platform/src/output/__init__.py +42 -0
- package/target-research-platform/src/output/agent_llm_provider.py +171 -0
- package/target-research-platform/src/output/chart_generator.py +550 -0
- package/target-research-platform/src/output/data_exporter.py +215 -0
- package/target-research-platform/src/output/delivery_packager.py +791 -0
- package/target-research-platform/src/output/evidence_package.py +230 -0
- package/target-research-platform/src/output/journal_templates.py +193 -0
- package/target-research-platform/src/output/literature_enricher.py +395 -0
- package/target-research-platform/src/output/literature_reviewer.py +420 -0
- package/target-research-platform/src/output/manuscript_fact_checker.py +279 -0
- package/target-research-platform/src/output/manuscript_generator.py +1189 -0
- package/target-research-platform/src/output/manuscript_quality.py +401 -0
- package/target-research-platform/src/output/medical_skills_bridge.py +140 -0
- package/target-research-platform/src/output/report_generator.py +542 -0
- package/target-research-platform/src/output/usage_envelope.py +193 -0
- package/target-research-platform/src/utils/__init__.py +1 -0
- package/target-research-platform/src/utils/config.py +125 -0
- package/target-research-platform/src/utils/logger.py +71 -0
- package/target-research-platform/src/validators/__init__.py +13 -0
- package/target-research-platform/src/validators/cross_validator.py +394 -0
- package/target-research-platform/src/validators/data_provenance.py +298 -0
|
@@ -0,0 +1,982 @@
|
|
|
1
|
+
// SCALE Engine — Doctor (W10)
|
|
2
|
+
// 环境诊断 + 健康检查
|
|
3
|
+
// Usage: scale doctor
|
|
4
|
+
import { existsSync, readdirSync, statSync, readFileSync } from 'node:fs';
|
|
5
|
+
import { getBootstrapPlanForProfile, getProfile } from '../config/profiles.js';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { execSync } from 'node:child_process';
|
|
8
|
+
import { computeGovernanceDrift } from '../workflow/GovernanceLock.js';
|
|
9
|
+
import { doctorEngineeringStandards } from '../workflow/EngineeringStandards.js';
|
|
10
|
+
import { doctorResourceAssets } from '../workflow/ResourceGovernance.js';
|
|
11
|
+
import { doctorRuntimeEvidence } from '../runtime/RuntimeDoctor.js';
|
|
12
|
+
import { inspectWorkspaceSafety } from '../workflow/WorkspaceSafety.js';
|
|
13
|
+
import { inspectCodeIntelligence } from '../codegraph/CodeIntelligence.js';
|
|
14
|
+
import { inspectMemoryProviders } from '../memory/MemoryProviders.js';
|
|
15
|
+
import { inspectToolCapabilities } from '../tools/ToolCapabilityRegistry.js';
|
|
16
|
+
export class Doctor {
|
|
17
|
+
constructor(projectDir = '.', scaleDir = '.scale', deps = {}) {
|
|
18
|
+
this.projectDir = projectDir;
|
|
19
|
+
this.scaleDir = scaleDir;
|
|
20
|
+
this.deps = deps;
|
|
21
|
+
}
|
|
22
|
+
async diagnose() {
|
|
23
|
+
const checks = [];
|
|
24
|
+
const bootstrapPlan = this.resolveBootstrapPlan();
|
|
25
|
+
const codeIntelligence = this.inspectCodeIntelligence();
|
|
26
|
+
const memoryProviders = this.inspectMemoryProviders();
|
|
27
|
+
const toolCapabilities = this.inspectToolCapabilities(['graphify', 'codegraph', 'gbrain']);
|
|
28
|
+
checks.push(this.checkScaleDir());
|
|
29
|
+
checks.push(this.checkEventsDir());
|
|
30
|
+
checks.push(this.checkArtifactsDir());
|
|
31
|
+
checks.push(this.checkSettingsJson());
|
|
32
|
+
checks.push(this.checkKnowledgeDoc());
|
|
33
|
+
checks.push(this.checkRulesDir());
|
|
34
|
+
checks.push(this.checkHooksDir());
|
|
35
|
+
checks.push(this.checkNodeVersion());
|
|
36
|
+
checks.push(this.checkDiskUsage());
|
|
37
|
+
checks.push(this.checkGitignore());
|
|
38
|
+
const gitWorkspaceCheck = this.checkGitWorkspace();
|
|
39
|
+
checks.push(gitWorkspaceCheck);
|
|
40
|
+
const governanceTemplatesCheck = this.checkGovernanceTemplates();
|
|
41
|
+
const verificationMatrixCheck = this.checkVerificationMatrix();
|
|
42
|
+
const skillRoutingPolicyCheck = this.checkSkillRoutingPolicy();
|
|
43
|
+
const toolPolicyCheck = this.checkToolPolicy();
|
|
44
|
+
const resourcePolicyCheck = this.checkResourcePolicy();
|
|
45
|
+
const engineeringStandardsCheck = gitWorkspaceCheck.status === 'fail'
|
|
46
|
+
? this.skippedEngineeringStandardsForWorkspaceConflict()
|
|
47
|
+
: this.checkEngineeringStandards();
|
|
48
|
+
const governanceDriftCheck = this.checkGovernanceDrift();
|
|
49
|
+
governanceTemplatesCheck.optional = true;
|
|
50
|
+
verificationMatrixCheck.optional = true;
|
|
51
|
+
skillRoutingPolicyCheck.optional = true;
|
|
52
|
+
toolPolicyCheck.optional = true;
|
|
53
|
+
resourcePolicyCheck.optional = true;
|
|
54
|
+
engineeringStandardsCheck.optional = true;
|
|
55
|
+
governanceDriftCheck.optional = true;
|
|
56
|
+
governanceTemplatesCheck.category = 'governance';
|
|
57
|
+
verificationMatrixCheck.category = 'governance';
|
|
58
|
+
skillRoutingPolicyCheck.category = 'governance';
|
|
59
|
+
toolPolicyCheck.category = 'governance';
|
|
60
|
+
resourcePolicyCheck.category = 'governance';
|
|
61
|
+
engineeringStandardsCheck.category = 'governance';
|
|
62
|
+
governanceDriftCheck.category = 'governance';
|
|
63
|
+
checks.push(governanceTemplatesCheck);
|
|
64
|
+
checks.push(verificationMatrixCheck);
|
|
65
|
+
checks.push(skillRoutingPolicyCheck);
|
|
66
|
+
checks.push(toolPolicyCheck);
|
|
67
|
+
checks.push(resourcePolicyCheck);
|
|
68
|
+
checks.push(engineeringStandardsCheck);
|
|
69
|
+
checks.push(governanceDriftCheck);
|
|
70
|
+
const runtimeEvidenceCheck = this.checkRuntimeEvidence();
|
|
71
|
+
runtimeEvidenceCheck.optional = true;
|
|
72
|
+
runtimeEvidenceCheck.category = 'runtime';
|
|
73
|
+
checks.push(runtimeEvidenceCheck);
|
|
74
|
+
const configHealthCheck = this.checkConfigHealth();
|
|
75
|
+
configHealthCheck.optional = true;
|
|
76
|
+
configHealthCheck.category = 'governance';
|
|
77
|
+
checks.push(configHealthCheck);
|
|
78
|
+
// Optional knowledge graph checks (non-blocking)
|
|
79
|
+
const pythonCheck = this.checkPython(bootstrapPlan);
|
|
80
|
+
const graphifyCheck = this.checkGraphifyCli(toolCapabilities, bootstrapPlan);
|
|
81
|
+
const graphifyArtifactCheck = this.checkGraphifyArtifact(codeIntelligence);
|
|
82
|
+
const codegraphCheck = this.checkCodegraph(toolCapabilities, bootstrapPlan);
|
|
83
|
+
const codegraphProjectCheck = this.checkCodegraphProject(codeIntelligence);
|
|
84
|
+
const memoryRoutingCheck = this.checkMemoryProviders(memoryProviders, bootstrapPlan);
|
|
85
|
+
pythonCheck.optional = true;
|
|
86
|
+
graphifyCheck.optional = true;
|
|
87
|
+
graphifyArtifactCheck.optional = true;
|
|
88
|
+
codegraphCheck.optional = true;
|
|
89
|
+
codegraphProjectCheck.optional = true;
|
|
90
|
+
memoryRoutingCheck.optional = true;
|
|
91
|
+
pythonCheck.category = 'knowledge-graph';
|
|
92
|
+
graphifyCheck.category = 'knowledge-graph';
|
|
93
|
+
graphifyArtifactCheck.category = 'knowledge-graph';
|
|
94
|
+
codegraphCheck.category = 'knowledge-graph';
|
|
95
|
+
codegraphProjectCheck.category = 'knowledge-graph';
|
|
96
|
+
memoryRoutingCheck.category = 'memory';
|
|
97
|
+
checks.push(pythonCheck);
|
|
98
|
+
checks.push(graphifyCheck);
|
|
99
|
+
checks.push(graphifyArtifactCheck);
|
|
100
|
+
checks.push(codegraphCheck);
|
|
101
|
+
checks.push(codegraphProjectCheck);
|
|
102
|
+
checks.push(memoryRoutingCheck);
|
|
103
|
+
// Calculate overall health excluding optional checks
|
|
104
|
+
const coreChecks = checks.filter((c) => !c.optional);
|
|
105
|
+
const fails = coreChecks.filter((c) => c.status === 'fail').length;
|
|
106
|
+
const warns = coreChecks.filter((c) => c.status === 'warn').length;
|
|
107
|
+
const overall = fails > 0 ? 'broken' : warns > 0 ? 'degraded' : 'healthy';
|
|
108
|
+
// Knowledge graph availability metadata
|
|
109
|
+
const knowledgeGraph = {
|
|
110
|
+
available: graphifyArtifactCheck.status === 'ok' || codegraphProjectCheck.status === 'ok',
|
|
111
|
+
pythonVersion: pythonCheck.status === 'ok' ? pythonCheck.message : undefined,
|
|
112
|
+
graphifyInstalled: graphifyCheck.status === 'ok',
|
|
113
|
+
codegraphInstalled: codegraphCheck.status === 'ok',
|
|
114
|
+
codegraphProjectInitialized: codegraphProjectCheck.status === 'ok',
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
overall,
|
|
118
|
+
checks,
|
|
119
|
+
timestamp: Date.now(),
|
|
120
|
+
bootstrapPlan,
|
|
121
|
+
knowledgeGraph,
|
|
122
|
+
memoryProviders: {
|
|
123
|
+
available: memoryProviders.availableProviderCount > 0,
|
|
124
|
+
gbrainAvailable: Boolean(memoryProviders.providers.find(provider => provider.id === 'gbrain')?.available),
|
|
125
|
+
defaultOrder: [...memoryProviders.routing.defaultOrder],
|
|
126
|
+
mode: memoryProviders.routing.mode,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
checkScaleDir() {
|
|
131
|
+
const dir = join(this.projectDir, this.scaleDir);
|
|
132
|
+
if (!existsSync(dir)) {
|
|
133
|
+
return { name: '.scale directory', status: 'fail', message: 'Missing .scale/ directory', fix: 'Run: scale init' };
|
|
134
|
+
}
|
|
135
|
+
return { name: '.scale directory', status: 'ok', message: `Found at ${dir}` };
|
|
136
|
+
}
|
|
137
|
+
checkEventsDir() {
|
|
138
|
+
const dir = join(this.projectDir, this.scaleDir, 'events');
|
|
139
|
+
if (!existsSync(dir)) {
|
|
140
|
+
return { name: 'Events directory', status: 'fail', message: 'Missing events/ directory', fix: 'Run: scale init' };
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
const files = readdirSync(dir).filter((f) => f.endsWith('.jsonl'));
|
|
144
|
+
const totalSize = files.reduce((sum, f) => sum + statSync(join(dir, f)).size, 0);
|
|
145
|
+
const sizeMB = (totalSize / 1024 / 1024).toFixed(2);
|
|
146
|
+
if (totalSize > 100 * 1024 * 1024) {
|
|
147
|
+
return { name: 'Events directory', status: 'warn', message: `${files.length} files, ${sizeMB}MB — consider archiving`, fix: 'Archive old event files' };
|
|
148
|
+
}
|
|
149
|
+
return { name: 'Events directory', status: 'ok', message: `${files.length} files, ${sizeMB}MB` };
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return { name: 'Events directory', status: 'ok', message: 'Empty (fresh install)' };
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
checkArtifactsDir() {
|
|
156
|
+
const dir = join(this.projectDir, this.scaleDir, 'artifacts');
|
|
157
|
+
if (!existsSync(dir)) {
|
|
158
|
+
return { name: 'Artifacts directory', status: 'fail', message: 'Missing artifacts/ directory', fix: 'Run: scale init' };
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
const files = readdirSync(dir).filter((f) => f.endsWith('.json'));
|
|
162
|
+
return { name: 'Artifacts directory', status: 'ok', message: `${files.length} artifacts` };
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return { name: 'Artifacts directory', status: 'ok', message: 'Empty' };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
checkSettingsJson() {
|
|
169
|
+
const candidates = [
|
|
170
|
+
{ agent: 'claude-code', path: join(this.projectDir, '.claude', 'settings.json') },
|
|
171
|
+
{ agent: 'claude-code', path: join(this.projectDir, '.claude', 'settings.local.json') },
|
|
172
|
+
{ agent: 'codex', path: join(this.projectDir, '.codex', 'hooks.json') },
|
|
173
|
+
{ agent: 'cursor', path: join(this.projectDir, '.cursor', 'settings.json') },
|
|
174
|
+
{ agent: 'gemini', path: join(this.projectDir, '.gemini', 'settings.json') },
|
|
175
|
+
{ agent: 'openclaw', path: join(this.projectDir, '.openclaw', 'settings.json') },
|
|
176
|
+
{ agent: 'hermes', path: join(this.projectDir, '.hermes', 'settings.json') },
|
|
177
|
+
{ agent: 'trae', path: join(this.projectDir, '.trae', 'settings.json') },
|
|
178
|
+
{ agent: 'workbuddy', path: join(this.projectDir, '.workbuddy', 'settings.json') },
|
|
179
|
+
{ agent: 'vsc', path: join(this.projectDir, '.vscode', 'scale.json') },
|
|
180
|
+
{ agent: 'qcoder', path: join(this.projectDir, '.qwen', 'settings.json') },
|
|
181
|
+
{ agent: 'qoder', path: join(this.projectDir, '.qoder', 'settings.json') },
|
|
182
|
+
{ agent: 'jcode', path: join(this.projectDir, '.jcode', 'settings.json') },
|
|
183
|
+
{ agent: 'windsurf', path: join(this.projectDir, '.windsurf', 'settings.json') },
|
|
184
|
+
{ agent: 'kiro', path: join(this.projectDir, '.kiro', 'settings.json') },
|
|
185
|
+
{ agent: 'cline', path: join(this.projectDir, '.cline', 'settings.json') },
|
|
186
|
+
{ agent: 'kilocode', path: join(this.projectDir, '.kilocode', 'settings.json') },
|
|
187
|
+
{ agent: 'antigravity', path: join(this.projectDir, '.agents', 'hooks.json') },
|
|
188
|
+
];
|
|
189
|
+
const found = candidates.find((c) => existsSync(c.path));
|
|
190
|
+
if (!found) {
|
|
191
|
+
return {
|
|
192
|
+
name: 'Agent settings',
|
|
193
|
+
status: 'warn',
|
|
194
|
+
message: 'No agent settings found (.claude/.codex/.cursor/.gemini/.openclaw/.hermes/.trae/.workbuddy/.vscode/.qwen/.qoder/.jcode/.windsurf/.kiro/.cline/.kilocode/.agents)',
|
|
195
|
+
fix: 'Run: scale init --agent <platform>',
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const content = JSON.parse(readFileSync(found.path, 'utf-8'));
|
|
200
|
+
const collectHookEntries = (entries) => {
|
|
201
|
+
const flattened = [];
|
|
202
|
+
for (const entry of entries) {
|
|
203
|
+
if (!entry || typeof entry !== 'object')
|
|
204
|
+
continue;
|
|
205
|
+
flattened.push(entry);
|
|
206
|
+
if (Array.isArray(entry.hooks)) {
|
|
207
|
+
flattened.push(...collectHookEntries(entry.hooks ?? []));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return flattened;
|
|
211
|
+
};
|
|
212
|
+
const hookEntries = collectHookEntries(Object.values(content.hooks ?? {}).flatMap((value) => Array.isArray(value) ? value : []));
|
|
213
|
+
const hasScaleHooks = hookEntries.some((entry) => {
|
|
214
|
+
const command = typeof entry.command === 'string' ? entry.command : '';
|
|
215
|
+
const description = typeof entry.description === 'string' ? entry.description : '';
|
|
216
|
+
return /(^|\s)scale\s/.test(command)
|
|
217
|
+
|| command.includes('.claude/hooks/')
|
|
218
|
+
|| command.includes('scripts/hooks/')
|
|
219
|
+
|| /scale|workflow/i.test(description);
|
|
220
|
+
});
|
|
221
|
+
if (!hasScaleHooks) {
|
|
222
|
+
return {
|
|
223
|
+
name: 'Agent settings',
|
|
224
|
+
status: 'warn',
|
|
225
|
+
message: `${found.path} exists but no SCALE hooks`,
|
|
226
|
+
fix: `Run: scale init --agent ${found.agent} to inject hooks`,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const hookCount = Object.values(content.hooks ?? {}).flat().length;
|
|
230
|
+
return { name: 'Agent settings', status: 'ok', message: `${hookCount} hooks configured (${found.agent})` };
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
return { name: 'Agent settings', status: 'fail', message: `${found.path} is invalid JSON`, fix: 'Fix JSON syntax' };
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
checkKnowledgeDoc() {
|
|
237
|
+
const paths = ['CLAUDE.md', 'AGENTS.md', '.cursorrules', 'GEMINI.md', '.hermes.md', 'TRAE.md', 'WORKBUDDY.md', 'VSC.md', 'QWEN.md', 'JCODE.md', '.qoder/rules/SCALE.md', '.kiro/rules/SCALE.md', '.windsurf/rules.md', '.clinerules/SCALE.md', '.agents/rules/SCALE.md'];
|
|
238
|
+
for (const name of paths) {
|
|
239
|
+
const p = join(this.projectDir, name);
|
|
240
|
+
if (existsSync(p)) {
|
|
241
|
+
const lines = readFileSync(p, 'utf-8').split('\n').length;
|
|
242
|
+
if (lines > 200) {
|
|
243
|
+
return { name: 'Knowledge doc', status: 'warn', message: `${name}: ${lines} lines (>200 — compliance may drop)`, fix: 'Split low-frequency rules to .claude/rules/' };
|
|
244
|
+
}
|
|
245
|
+
return { name: 'Knowledge doc', status: 'ok', message: `${name}: ${lines} lines` };
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return { name: 'Knowledge doc', status: 'warn', message: 'No knowledge doc found', fix: 'Run: scale init' };
|
|
249
|
+
}
|
|
250
|
+
checkRulesDir() {
|
|
251
|
+
const dir = join(this.projectDir, this.scaleDir, 'rules');
|
|
252
|
+
if (!existsSync(dir)) {
|
|
253
|
+
return { name: 'Rules directory', status: 'ok', message: 'Not created yet (no evolved rules)' };
|
|
254
|
+
}
|
|
255
|
+
const files = readdirSync(dir).filter((f) => f.endsWith('.md'));
|
|
256
|
+
return { name: 'Rules directory', status: 'ok', message: `${files.length} rules` };
|
|
257
|
+
}
|
|
258
|
+
checkHooksDir() {
|
|
259
|
+
const dir = join(this.projectDir, this.scaleDir, 'hooks');
|
|
260
|
+
if (!existsSync(dir)) {
|
|
261
|
+
return { name: 'Hooks directory', status: 'ok', message: 'Not created yet (no evolved hooks)' };
|
|
262
|
+
}
|
|
263
|
+
const files = readdirSync(dir).filter((f) => f.endsWith('.sh'));
|
|
264
|
+
return { name: 'Hooks directory', status: 'ok', message: `${files.length} hooks` };
|
|
265
|
+
}
|
|
266
|
+
checkNodeVersion() {
|
|
267
|
+
const version = process.version;
|
|
268
|
+
const major = parseInt(version.slice(1).split('.')[0]);
|
|
269
|
+
if (major < 20) {
|
|
270
|
+
return { name: 'Node.js version', status: 'fail', message: `${version} — requires >=20`, fix: 'Upgrade Node.js to v20+' };
|
|
271
|
+
}
|
|
272
|
+
return { name: 'Node.js version', status: 'ok', message: version };
|
|
273
|
+
}
|
|
274
|
+
checkDiskUsage() {
|
|
275
|
+
const dir = join(this.projectDir, this.scaleDir);
|
|
276
|
+
if (!existsSync(dir))
|
|
277
|
+
return { name: 'Disk usage', status: 'ok', message: 'N/A' };
|
|
278
|
+
try {
|
|
279
|
+
let totalSize = 0;
|
|
280
|
+
const walk = (d) => {
|
|
281
|
+
for (const f of readdirSync(d)) {
|
|
282
|
+
const p = join(d, f);
|
|
283
|
+
const s = statSync(p);
|
|
284
|
+
if (s.isDirectory())
|
|
285
|
+
walk(p);
|
|
286
|
+
else
|
|
287
|
+
totalSize += s.size;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
walk(dir);
|
|
291
|
+
const mb = (totalSize / 1024 / 1024).toFixed(2);
|
|
292
|
+
if (totalSize > 500 * 1024 * 1024) {
|
|
293
|
+
return { name: 'Disk usage', status: 'warn', message: `${mb}MB — consider cleanup`, fix: 'Archive old events/checkpoints' };
|
|
294
|
+
}
|
|
295
|
+
return { name: 'Disk usage', status: 'ok', message: `${mb}MB` };
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
return { name: 'Disk usage', status: 'ok', message: 'Unable to calculate' };
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
checkGitignore() {
|
|
302
|
+
const p = join(this.projectDir, this.scaleDir, '.gitignore');
|
|
303
|
+
if (!existsSync(p)) {
|
|
304
|
+
return { name: '.scale/.gitignore', status: 'warn', message: 'Missing — runtime data may be committed', fix: 'Run: scale init' };
|
|
305
|
+
}
|
|
306
|
+
return { name: '.scale/.gitignore', status: 'ok', message: 'Present' };
|
|
307
|
+
}
|
|
308
|
+
checkGitWorkspace() {
|
|
309
|
+
const safety = inspectWorkspaceSafety(this.projectDir);
|
|
310
|
+
if (!safety.gitRepository) {
|
|
311
|
+
return {
|
|
312
|
+
name: 'Git workspace',
|
|
313
|
+
status: 'ok',
|
|
314
|
+
message: safety.message,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
if (safety.blocked) {
|
|
318
|
+
return {
|
|
319
|
+
name: 'Git workspace',
|
|
320
|
+
status: 'fail',
|
|
321
|
+
message: safety.message,
|
|
322
|
+
fix: 'Resolve merge conflicts first, then rerun: scale doctor && scale preflight --json',
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
name: 'Git workspace',
|
|
327
|
+
status: 'ok',
|
|
328
|
+
message: safety.message,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
checkGovernanceTemplates() {
|
|
332
|
+
const required = [
|
|
333
|
+
join(this.projectDir, 'docs', 'workflow', 'README.md'),
|
|
334
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'explore.md'),
|
|
335
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'mini-prd.md'),
|
|
336
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'skill-plan.md'),
|
|
337
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'ui-spec.md'),
|
|
338
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'visual-review.md'),
|
|
339
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'api-contract.md'),
|
|
340
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'security-review.md'),
|
|
341
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'resource-impact.md'),
|
|
342
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'standards-impact.md'),
|
|
343
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'architecture-review.md'),
|
|
344
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'db-change-plan.md'),
|
|
345
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'e2e-plan.md'),
|
|
346
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'plan.md'),
|
|
347
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'verification.md'),
|
|
348
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'review.md'),
|
|
349
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'summary.md'),
|
|
350
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'github-actions-scale-preflight.yml'),
|
|
351
|
+
join(this.projectDir, 'docs', 'workflow', 'templates', 'pre-push-scale-preflight.sh'),
|
|
352
|
+
join(this.projectDir, 'docs', 'worklog', 'metrics.md'),
|
|
353
|
+
];
|
|
354
|
+
const missing = required.filter((path) => !existsSync(path));
|
|
355
|
+
if (missing.length > 0) {
|
|
356
|
+
return {
|
|
357
|
+
name: 'Governance templates',
|
|
358
|
+
status: 'warn',
|
|
359
|
+
message: `${missing.length} governance templates missing`,
|
|
360
|
+
fix: 'Run: scale init to generate workflow governance templates',
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
return { name: 'Governance templates', status: 'ok', message: `${required.length} templates present` };
|
|
364
|
+
}
|
|
365
|
+
checkVerificationMatrix() {
|
|
366
|
+
const path = join(this.projectDir, this.scaleDir, 'verification.json');
|
|
367
|
+
if (!existsSync(path)) {
|
|
368
|
+
return {
|
|
369
|
+
name: 'Verification matrix',
|
|
370
|
+
status: 'warn',
|
|
371
|
+
message: 'Missing .scale/verification.json',
|
|
372
|
+
fix: 'Run: scale init or create a service-aware verification matrix',
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
try {
|
|
376
|
+
const matrix = JSON.parse(readFileSync(path, 'utf-8'));
|
|
377
|
+
const artifactGate = matrix.policy?.artifactGate;
|
|
378
|
+
if (artifactGate && artifactGate !== 'off' && artifactGate !== 'warn' && artifactGate !== 'block') {
|
|
379
|
+
return {
|
|
380
|
+
name: 'Verification matrix',
|
|
381
|
+
status: 'warn',
|
|
382
|
+
message: 'Invalid policy.artifactGate; expected off, warn, or block',
|
|
383
|
+
fix: 'Update .scale/verification.json policy.artifactGate',
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
const serviceCount = Array.isArray(matrix.services) ? matrix.services.length : 0;
|
|
387
|
+
const profileCount = matrix.profiles && typeof matrix.profiles === 'object' ? Object.keys(matrix.profiles).length : 0;
|
|
388
|
+
return { name: 'Verification matrix', status: 'ok', message: `${profileCount} profiles, ${serviceCount} services` };
|
|
389
|
+
}
|
|
390
|
+
catch {
|
|
391
|
+
return {
|
|
392
|
+
name: 'Verification matrix',
|
|
393
|
+
status: 'fail',
|
|
394
|
+
message: '.scale/verification.json is invalid JSON',
|
|
395
|
+
fix: 'Fix JSON syntax or regenerate with scale init',
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
checkSkillRoutingPolicy() {
|
|
400
|
+
const path = join(this.projectDir, this.scaleDir, 'skills.json');
|
|
401
|
+
if (!existsSync(path)) {
|
|
402
|
+
return {
|
|
403
|
+
name: 'Skill routing policy',
|
|
404
|
+
status: 'warn',
|
|
405
|
+
message: 'Missing .scale/skills.json',
|
|
406
|
+
fix: 'Run: scale init to generate active skill routing policy',
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
try {
|
|
410
|
+
const config = JSON.parse(readFileSync(path, 'utf-8'));
|
|
411
|
+
const mode = config.policy?.mode;
|
|
412
|
+
if (mode && mode !== 'off' && mode !== 'warn' && mode !== 'block') {
|
|
413
|
+
return {
|
|
414
|
+
name: 'Skill routing policy',
|
|
415
|
+
status: 'warn',
|
|
416
|
+
message: 'Invalid policy.mode; expected off, warn, or block',
|
|
417
|
+
fix: 'Update .scale/skills.json policy.mode',
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
const domainCount = config.domains && typeof config.domains === 'object' ? Object.keys(config.domains).length : 0;
|
|
421
|
+
if (domainCount === 0) {
|
|
422
|
+
return {
|
|
423
|
+
name: 'Skill routing policy',
|
|
424
|
+
status: 'warn',
|
|
425
|
+
message: 'No skill routing domains configured',
|
|
426
|
+
fix: 'Regenerate with scale init or add domains to .scale/skills.json',
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
return { name: 'Skill routing policy', status: 'ok', message: `${domainCount} domains` };
|
|
430
|
+
}
|
|
431
|
+
catch {
|
|
432
|
+
return {
|
|
433
|
+
name: 'Skill routing policy',
|
|
434
|
+
status: 'fail',
|
|
435
|
+
message: '.scale/skills.json is invalid JSON',
|
|
436
|
+
fix: 'Fix JSON syntax or regenerate with scale init',
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
checkToolPolicy() {
|
|
441
|
+
const path = join(this.projectDir, this.scaleDir, 'tools.json');
|
|
442
|
+
if (!existsSync(path)) {
|
|
443
|
+
return {
|
|
444
|
+
name: 'Tool policy',
|
|
445
|
+
status: 'warn',
|
|
446
|
+
message: 'Missing .scale/tools.json',
|
|
447
|
+
fix: 'Run: scale init to generate active tool orchestration policy',
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
try {
|
|
451
|
+
const config = JSON.parse(readFileSync(path, 'utf-8'));
|
|
452
|
+
const mode = config.mode;
|
|
453
|
+
if (mode && mode !== 'off' && mode !== 'advisory' && mode !== 'evidence-required' && mode !== 'block') {
|
|
454
|
+
return {
|
|
455
|
+
name: 'Tool policy',
|
|
456
|
+
status: 'warn',
|
|
457
|
+
message: 'Invalid mode; expected off, advisory, evidence-required, or block',
|
|
458
|
+
fix: 'Update .scale/tools.json mode',
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
const toolCount = config.tools && typeof config.tools === 'object' ? Object.keys(config.tools).length : 0;
|
|
462
|
+
if (toolCount === 0) {
|
|
463
|
+
return {
|
|
464
|
+
name: 'Tool policy',
|
|
465
|
+
status: 'warn',
|
|
466
|
+
message: 'No tool orchestration entries configured',
|
|
467
|
+
fix: 'Regenerate with scale init or add tools to .scale/tools.json',
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
return { name: 'Tool policy', status: 'ok', message: `${toolCount} tools, mode ${String(mode ?? 'evidence-required')}` };
|
|
471
|
+
}
|
|
472
|
+
catch {
|
|
473
|
+
return {
|
|
474
|
+
name: 'Tool policy',
|
|
475
|
+
status: 'fail',
|
|
476
|
+
message: '.scale/tools.json is invalid JSON',
|
|
477
|
+
fix: 'Fix JSON syntax or regenerate with scale init',
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
checkResourcePolicy() {
|
|
482
|
+
const path = join(this.projectDir, this.scaleDir, 'resource-policy.json');
|
|
483
|
+
if (!existsSync(path)) {
|
|
484
|
+
return {
|
|
485
|
+
name: 'Resource policy',
|
|
486
|
+
status: 'warn',
|
|
487
|
+
message: 'Missing .scale/resource-policy.json',
|
|
488
|
+
fix: 'Run: scale init --governance-pack resource-governance or standard',
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
try {
|
|
492
|
+
const report = doctorResourceAssets({ projectDir: this.projectDir, scaleDir: this.scaleDir });
|
|
493
|
+
const failCount = report.findings.filter(finding => finding.severity === 'fail').length;
|
|
494
|
+
const warnCount = report.findings.filter(finding => finding.severity === 'warn').length;
|
|
495
|
+
if (failCount > 0) {
|
|
496
|
+
return {
|
|
497
|
+
name: 'Resource policy',
|
|
498
|
+
status: 'warn',
|
|
499
|
+
message: `${failCount} blocking resource issue(s), ${warnCount} warning(s)`,
|
|
500
|
+
fix: 'Run: scale assets doctor --json',
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
return { name: 'Resource policy', status: warnCount > 0 ? 'warn' : 'ok', message: `${report.scan.summary.total} resources, ${warnCount} warning(s)` };
|
|
504
|
+
}
|
|
505
|
+
catch {
|
|
506
|
+
return {
|
|
507
|
+
name: 'Resource policy',
|
|
508
|
+
status: 'fail',
|
|
509
|
+
message: '.scale/resource-policy.json is invalid or resource scan failed',
|
|
510
|
+
fix: 'Fix JSON syntax or regenerate with scale init',
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
checkEngineeringStandards() {
|
|
515
|
+
const path = join(this.projectDir, this.scaleDir, 'engineering-standards.json');
|
|
516
|
+
if (!existsSync(path)) {
|
|
517
|
+
return {
|
|
518
|
+
name: 'Engineering standards',
|
|
519
|
+
status: 'warn',
|
|
520
|
+
message: 'Missing .scale/engineering-standards.json',
|
|
521
|
+
fix: 'Run: scale init --governance-pack standard',
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
try {
|
|
525
|
+
const report = doctorEngineeringStandards({ projectDir: this.projectDir, scaleDir: this.scaleDir });
|
|
526
|
+
const failCount = report.findings.filter(finding => finding.severity === 'fail').length;
|
|
527
|
+
const warnCount = report.findings.filter(finding => finding.severity === 'warn').length;
|
|
528
|
+
if (failCount > 0) {
|
|
529
|
+
return {
|
|
530
|
+
name: 'Engineering standards',
|
|
531
|
+
status: 'warn',
|
|
532
|
+
message: `${failCount} blocking standard issue(s), ${warnCount} warning(s)`,
|
|
533
|
+
fix: 'Run: scale standards doctor --json',
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
name: 'Engineering standards',
|
|
538
|
+
status: warnCount > 0 ? 'warn' : 'ok',
|
|
539
|
+
message: `${report.scan.summary.filesScanned} files scanned, ${warnCount} warning(s)`,
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
catch {
|
|
543
|
+
return {
|
|
544
|
+
name: 'Engineering standards',
|
|
545
|
+
status: 'fail',
|
|
546
|
+
message: '.scale/engineering-standards.json is invalid or standards scan failed',
|
|
547
|
+
fix: 'Fix JSON syntax or regenerate with scale init',
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
skippedEngineeringStandardsForWorkspaceConflict() {
|
|
552
|
+
return {
|
|
553
|
+
name: 'Engineering standards',
|
|
554
|
+
status: 'warn',
|
|
555
|
+
message: 'Skipped because the git workspace has unresolved conflicts',
|
|
556
|
+
fix: 'Resolve merge conflicts first, then rerun: scale standards doctor --json',
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
checkGovernanceDrift() {
|
|
560
|
+
const drift = computeGovernanceDrift(this.projectDir);
|
|
561
|
+
if (!drift.lockExists) {
|
|
562
|
+
return {
|
|
563
|
+
name: 'Governance drift',
|
|
564
|
+
status: 'warn',
|
|
565
|
+
message: 'Missing .scale/governance.lock.json',
|
|
566
|
+
fix: 'Run: scale init --governance-pack standard',
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
if (drift.missing.length > 0 || drift.changed.length > 0) {
|
|
570
|
+
return {
|
|
571
|
+
name: 'Governance drift',
|
|
572
|
+
status: 'warn',
|
|
573
|
+
message: `${drift.missing.length} missing, ${drift.changed.length} changed generated governance files`,
|
|
574
|
+
fix: 'Run: scale governance diff',
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
return {
|
|
578
|
+
name: 'Governance drift',
|
|
579
|
+
status: 'ok',
|
|
580
|
+
message: `${drift.clean.length} generated governance files clean`,
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
checkPython(bootstrapPlan) {
|
|
584
|
+
try {
|
|
585
|
+
const version = this.runExecSync('python3 --version').trim();
|
|
586
|
+
const match = version.match(/Python (\d+)\.(\d+)/);
|
|
587
|
+
if (match) {
|
|
588
|
+
const major = parseInt(match[1]);
|
|
589
|
+
const minor = parseInt(match[2]);
|
|
590
|
+
if (major >= 3 && minor >= 8) {
|
|
591
|
+
return { name: 'Python version', status: 'ok', message: version };
|
|
592
|
+
}
|
|
593
|
+
return { name: 'Python version', status: 'warn', message: `${version} — graphify requires >=3.8`, fix: 'Upgrade Python to 3.8+' };
|
|
594
|
+
}
|
|
595
|
+
return { name: 'Python version', status: 'ok', message: version };
|
|
596
|
+
}
|
|
597
|
+
catch {
|
|
598
|
+
// Try python (without 3) for Windows
|
|
599
|
+
try {
|
|
600
|
+
const version = this.runExecSync('python --version').trim();
|
|
601
|
+
return { name: 'Python version', status: 'ok', message: version };
|
|
602
|
+
}
|
|
603
|
+
catch {
|
|
604
|
+
return {
|
|
605
|
+
name: 'Python version',
|
|
606
|
+
status: 'warn',
|
|
607
|
+
message: 'Not installed — knowledge graph requires Python',
|
|
608
|
+
fix: `Install Python 3.8+, then run: ${this.knowledgeBootstrapApplyCommand(bootstrapPlan)}`,
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
checkGraphifyCli(toolCapabilities, bootstrapPlan) {
|
|
614
|
+
const graphify = toolCapabilities.tools.find(tool => tool.id === 'graphify');
|
|
615
|
+
if (graphify?.installed) {
|
|
616
|
+
return { name: 'Graphify CLI', status: 'ok', message: graphify.version ?? graphify.detectedPath ?? 'installed' };
|
|
617
|
+
}
|
|
618
|
+
return {
|
|
619
|
+
name: 'Graphify CLI',
|
|
620
|
+
status: 'warn',
|
|
621
|
+
message: graphify?.missingReason ?? 'Graphify CLI is not installed',
|
|
622
|
+
fix: `Run: ${this.knowledgeBootstrapApplyCommand(bootstrapPlan)}`,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
checkGraphifyArtifact(codeIntelligence) {
|
|
626
|
+
const graphify = codeIntelligence.providers.find(provider => provider.id === 'graphify');
|
|
627
|
+
if (graphify?.available) {
|
|
628
|
+
return { name: 'Graphify artifact', status: 'ok', message: graphify.reason };
|
|
629
|
+
}
|
|
630
|
+
return {
|
|
631
|
+
name: 'Graphify artifact',
|
|
632
|
+
status: 'warn',
|
|
633
|
+
message: graphify?.reason ?? 'Graphify artifact is not available',
|
|
634
|
+
fix: 'Run: scale codegraph status --json and generate graphify-out/graph.json before relying on graph-backed knowledge recall',
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
checkCodegraph(toolCapabilities, bootstrapPlan) {
|
|
638
|
+
const codegraph = toolCapabilities.tools.find(tool => tool.id === 'codegraph');
|
|
639
|
+
if (codegraph?.installed) {
|
|
640
|
+
return { name: 'CodeGraph CLI', status: 'ok', message: codegraph.version ?? codegraph.detectedPath ?? 'installed' };
|
|
641
|
+
}
|
|
642
|
+
return {
|
|
643
|
+
name: 'CodeGraph CLI',
|
|
644
|
+
status: 'warn',
|
|
645
|
+
message: codegraph?.missingReason ?? 'CodeGraph CLI is not installed',
|
|
646
|
+
fix: `Run: ${this.knowledgeBootstrapApplyCommand(bootstrapPlan)}`,
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
checkCodegraphProject(codeIntelligence) {
|
|
650
|
+
if (codeIntelligence.projectIndexExists) {
|
|
651
|
+
return { name: 'CodeGraph project index', status: 'ok', message: `Found at ${codeIntelligence.projectIndexPath}` };
|
|
652
|
+
}
|
|
653
|
+
return {
|
|
654
|
+
name: 'CodeGraph project index',
|
|
655
|
+
status: 'warn',
|
|
656
|
+
message: 'Project is not initialized for CodeGraph',
|
|
657
|
+
fix: 'Run: scale codegraph init',
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
checkMemoryProviders(memoryProviders, bootstrapPlan) {
|
|
661
|
+
const gbrain = memoryProviders.providers.find(provider => provider.id === 'gbrain');
|
|
662
|
+
if (gbrain?.available) {
|
|
663
|
+
return {
|
|
664
|
+
name: 'Memory provider routing',
|
|
665
|
+
status: memoryProviders.warnings.length > 0 ? 'warn' : 'ok',
|
|
666
|
+
message: `mode=${memoryProviders.routing.mode}; order=${memoryProviders.routing.defaultOrder.join(' -> ')}; gbrain=available`,
|
|
667
|
+
fix: memoryProviders.warnings.length > 0 ? 'Run: scale memory provider status --json' : undefined,
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
return {
|
|
671
|
+
name: 'Memory provider routing',
|
|
672
|
+
status: 'warn',
|
|
673
|
+
message: `mode=${memoryProviders.routing.mode}; order=${memoryProviders.routing.defaultOrder.join(' -> ')}; gbrain=unavailable`,
|
|
674
|
+
fix: `Run: ${this.memoryBootstrapApplyCommand(bootstrapPlan)}`,
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
checkRuntimeEvidence() {
|
|
678
|
+
try {
|
|
679
|
+
const report = doctorRuntimeEvidence({
|
|
680
|
+
projectDir: this.projectDir,
|
|
681
|
+
scaleDir: this.scaleDir,
|
|
682
|
+
level: 'S',
|
|
683
|
+
});
|
|
684
|
+
const failCount = report.checks.filter(check => check.status === 'fail').length;
|
|
685
|
+
const warnCount = report.checks.filter(check => check.status === 'warn').length;
|
|
686
|
+
if (failCount > 0) {
|
|
687
|
+
return {
|
|
688
|
+
name: 'Runtime evidence',
|
|
689
|
+
status: 'warn',
|
|
690
|
+
message: `${failCount} runtime issue(s), ${warnCount} warning(s)`,
|
|
691
|
+
fix: 'Run: scale runtime doctor --json',
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
return {
|
|
695
|
+
name: 'Runtime evidence',
|
|
696
|
+
status: warnCount > 0 ? 'warn' : 'ok',
|
|
697
|
+
message: `${report.evidence.total} evidence record(s), ${warnCount} warning(s)`,
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
catch {
|
|
701
|
+
return {
|
|
702
|
+
name: 'Runtime evidence',
|
|
703
|
+
status: 'warn',
|
|
704
|
+
message: 'Runtime evidence doctor could not inspect local state',
|
|
705
|
+
fix: 'Run: scale runtime doctor --json',
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
checkConfigHealth() {
|
|
710
|
+
const configPath = join(this.projectDir, this.scaleDir, 'config.yaml');
|
|
711
|
+
if (!existsSync(configPath)) {
|
|
712
|
+
return {
|
|
713
|
+
name: 'Config health',
|
|
714
|
+
status: 'warn',
|
|
715
|
+
message: 'No config.yaml found',
|
|
716
|
+
fix: 'Run: scale init (or scale config profile --set standard)',
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
try {
|
|
720
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
721
|
+
const issues = [];
|
|
722
|
+
const recommendations = [];
|
|
723
|
+
// Check profile
|
|
724
|
+
const profileMatch = content.match(/^profile:\s*(.+)$/m);
|
|
725
|
+
const profileId = profileMatch?.[1]?.trim() || 'standard';
|
|
726
|
+
const profile = getProfile(profileId);
|
|
727
|
+
const bootstrapPlan = getBootstrapPlanForProfile(profile.id);
|
|
728
|
+
if (profile.id !== profileId) {
|
|
729
|
+
issues.push(`Unknown profile "${profileId}", falling back to standard`);
|
|
730
|
+
}
|
|
731
|
+
// Check legacy vector-search config drift
|
|
732
|
+
if (content.includes('backend: qdrant')) {
|
|
733
|
+
issues.push('Legacy Qdrant backend configured; default knowledge and recall flow now expects graphify + codegraph instead of Qdrant');
|
|
734
|
+
recommendations.push('Update .scale/config.yaml to use graphify-backed knowledge, or rerun: scale config profile --set advanced');
|
|
735
|
+
}
|
|
736
|
+
// Check evolution enabled without eval setup
|
|
737
|
+
if (content.includes('evolution:') && content.includes('enabled: true')) {
|
|
738
|
+
const evalPath = existsSync(join(this.projectDir, this.scaleDir, 'evals'))
|
|
739
|
+
? join(this.projectDir, this.scaleDir, 'evals')
|
|
740
|
+
: join(this.projectDir, this.scaleDir, 'eval');
|
|
741
|
+
if (!existsSync(evalPath)) {
|
|
742
|
+
recommendations.push('Evolution enabled but no .scale/eval/ directory — run: scale eval init');
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
// Check profile-scenario mismatch
|
|
746
|
+
const thresholdsPath = join(this.projectDir, this.scaleDir, 'thresholds.json');
|
|
747
|
+
if (existsSync(thresholdsPath)) {
|
|
748
|
+
try {
|
|
749
|
+
const thresholds = JSON.parse(readFileSync(thresholdsPath, 'utf-8'));
|
|
750
|
+
const scenario = thresholds.gates?.G7_security?.required ? 'critical' : thresholds.gates?.G3_build?.required ? 'standard' : 'sandbox';
|
|
751
|
+
const expectedProfile = scenario === 'sandbox' ? 'minimal' : scenario === 'critical' ? 'advanced' : 'standard';
|
|
752
|
+
if (profileId !== expectedProfile) {
|
|
753
|
+
recommendations.push(`Profile "${profileId}" may not match scenario "${scenario}" (suggest: ${expectedProfile})`);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
catch (error) {
|
|
757
|
+
recommendations.push(`Could not parse ${thresholdsPath}; run: scale config doctor`);
|
|
758
|
+
void error;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (bootstrapPlan.packs.length > 0 && profile.defaults.knowledge.enabled) {
|
|
762
|
+
recommendations.push(`Bootstrap profile-aligned dependencies with: ${bootstrapPlan.inspectCommand}`);
|
|
763
|
+
}
|
|
764
|
+
if (issues.length > 0) {
|
|
765
|
+
return {
|
|
766
|
+
name: 'Config health',
|
|
767
|
+
status: 'warn',
|
|
768
|
+
message: issues.join('; '),
|
|
769
|
+
fix: recommendations.length > 0 ? recommendations.join('; ') : 'Run: scale config profile --set standard',
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
const summary = `profile=${profile.name}`;
|
|
773
|
+
const recSuffix = recommendations.length > 0 ? ` — ${recommendations.join('; ')}` : '';
|
|
774
|
+
return {
|
|
775
|
+
name: 'Config health',
|
|
776
|
+
status: recommendations.length > 0 ? 'warn' : 'ok',
|
|
777
|
+
message: `${summary}${recSuffix}`,
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
catch {
|
|
781
|
+
return {
|
|
782
|
+
name: 'Config health',
|
|
783
|
+
status: 'fail',
|
|
784
|
+
message: 'config.yaml exists but could not be parsed',
|
|
785
|
+
fix: 'Run: scale config profile --set standard to regenerate',
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
resolveBootstrapPlan() {
|
|
790
|
+
return getBootstrapPlanForProfile(this.readProfileId());
|
|
791
|
+
}
|
|
792
|
+
readProfileId() {
|
|
793
|
+
const configPath = join(this.projectDir, this.scaleDir, 'config.yaml');
|
|
794
|
+
if (!existsSync(configPath))
|
|
795
|
+
return 'standard';
|
|
796
|
+
try {
|
|
797
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
798
|
+
const match = content.match(/^profile:\s*(.+)$/m);
|
|
799
|
+
return match?.[1]?.trim() || 'standard';
|
|
800
|
+
}
|
|
801
|
+
catch {
|
|
802
|
+
return 'standard';
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
inspectCodeIntelligence() {
|
|
806
|
+
return (this.deps.inspectCodeIntelligenceImpl ?? inspectCodeIntelligence)({
|
|
807
|
+
projectDir: this.projectDir,
|
|
808
|
+
scaleDir: this.scaleDir,
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
inspectMemoryProviders() {
|
|
812
|
+
return (this.deps.inspectMemoryProvidersImpl ?? inspectMemoryProviders)({
|
|
813
|
+
projectDir: this.projectDir,
|
|
814
|
+
scaleDir: this.scaleDir,
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
inspectToolCapabilities(toolIds) {
|
|
818
|
+
return (this.deps.inspectToolCapabilitiesImpl ?? inspectToolCapabilities)({
|
|
819
|
+
projectDir: this.projectDir,
|
|
820
|
+
toolIds,
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
runExecSync(command) {
|
|
824
|
+
return String((this.deps.execSyncImpl ?? execSync)(command, { encoding: 'utf-8', timeout: 5000 }));
|
|
825
|
+
}
|
|
826
|
+
knowledgeBootstrapApplyCommand(bootstrapPlan) {
|
|
827
|
+
return bootstrapPlan.packs.includes('knowledge')
|
|
828
|
+
? bootstrapPlan.applyCommand
|
|
829
|
+
: 'scale bootstrap deps --pack knowledge --apply';
|
|
830
|
+
}
|
|
831
|
+
memoryBootstrapApplyCommand(bootstrapPlan) {
|
|
832
|
+
return bootstrapPlan.packs.includes('memory')
|
|
833
|
+
? bootstrapPlan.applyCommand
|
|
834
|
+
: 'scale bootstrap deps --pack memory --apply';
|
|
835
|
+
}
|
|
836
|
+
formatReport(report) {
|
|
837
|
+
return this.formatReportAscii(report);
|
|
838
|
+
const icon = { healthy: '✅', degraded: '⚠️', broken: '❌' };
|
|
839
|
+
const statusIcon = { ok: '✅', warn: '⚠️', fail: '❌' };
|
|
840
|
+
const lines = [
|
|
841
|
+
`\n${icon[report.overall]} SCALE Engine Health: ${report.overall.toUpperCase()}`,
|
|
842
|
+
`${'─'.repeat(50)}`,
|
|
843
|
+
];
|
|
844
|
+
// Core checks first
|
|
845
|
+
for (const check of report.checks.filter((c) => !c.optional)) {
|
|
846
|
+
lines.push(` ${statusIcon[check.status]} ${check.name}: ${check.message}`);
|
|
847
|
+
if (check.fix)
|
|
848
|
+
lines.push(` 💡 Fix: ${check.fix}`);
|
|
849
|
+
}
|
|
850
|
+
lines.push(`${'─'.repeat(50)}`);
|
|
851
|
+
const governanceChecks = report.checks.filter((c) => c.optional && c.category === 'governance');
|
|
852
|
+
if (governanceChecks.length > 0) {
|
|
853
|
+
lines.push('');
|
|
854
|
+
lines.push('Project Governance (Optional):');
|
|
855
|
+
for (const check of governanceChecks) {
|
|
856
|
+
lines.push(` ${statusIcon[check.status]} ${check.name}: ${check.message}`);
|
|
857
|
+
if (check.fix)
|
|
858
|
+
lines.push(` Fix: ${check.fix}`);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
// Knowledge graph section (optional checks)
|
|
862
|
+
const optionalChecks = report.checks.filter((c) => c.optional && c.category === 'knowledge-graph');
|
|
863
|
+
if (optionalChecks.length > 0) {
|
|
864
|
+
lines.push('');
|
|
865
|
+
lines.push('📦 Knowledge Graph (Optional):');
|
|
866
|
+
for (const check of optionalChecks) {
|
|
867
|
+
lines.push(` ${statusIcon[check.status]} ${check.name}: ${check.message}`);
|
|
868
|
+
if (check.fix)
|
|
869
|
+
lines.push(` 💡 Fix: ${check.fix}`);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
const memoryChecks = report.checks.filter((c) => c.optional && c.category === 'memory');
|
|
873
|
+
if (memoryChecks.length > 0) {
|
|
874
|
+
lines.push('');
|
|
875
|
+
lines.push('Memory Providers (Optional):');
|
|
876
|
+
for (const check of memoryChecks) {
|
|
877
|
+
lines.push(` ${statusIcon[check.status]} ${check.name}: ${check.message}`);
|
|
878
|
+
if (check.fix)
|
|
879
|
+
lines.push(` Fix: ${check.fix}`);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
// Knowledge graph status summary
|
|
883
|
+
if (report.knowledgeGraph) {
|
|
884
|
+
const knowledgeGraph = report.knowledgeGraph;
|
|
885
|
+
lines.push('');
|
|
886
|
+
if (knowledgeGraph.available) {
|
|
887
|
+
lines.push(' ✅ Code knowledge graph available');
|
|
888
|
+
if (knowledgeGraph.codegraphProjectInitialized) {
|
|
889
|
+
lines.push(' → Use: scale codegraph context --symbol <Symbol>');
|
|
890
|
+
}
|
|
891
|
+
if (knowledgeGraph.graphifyInstalled) {
|
|
892
|
+
lines.push(' → Use: scale graphify .');
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
else {
|
|
896
|
+
lines.push(' ⚠️ Code knowledge graph not available (optional feature)');
|
|
897
|
+
lines.push(' → Install CodeGraph: npx @colbymchenry/codegraph');
|
|
898
|
+
lines.push(' → Install Graphify: uv tool install graphify && graphify install --platform codex');
|
|
899
|
+
}
|
|
900
|
+
lines.push(`${'─'.repeat(50)}`);
|
|
901
|
+
}
|
|
902
|
+
const runtimeChecks = report.checks.filter((c) => c.optional && c.category === 'runtime');
|
|
903
|
+
if (runtimeChecks.length > 0) {
|
|
904
|
+
lines.push('');
|
|
905
|
+
lines.push('Runtime Evidence (Optional):');
|
|
906
|
+
for (const check of runtimeChecks) {
|
|
907
|
+
lines.push(` ${statusIcon[check.status]} ${check.name}: ${check.message}`);
|
|
908
|
+
if (check.fix)
|
|
909
|
+
lines.push(` Fix: ${check.fix}`);
|
|
910
|
+
}
|
|
911
|
+
lines.push(`${'-'.repeat(50)}`);
|
|
912
|
+
}
|
|
913
|
+
const ok = report.checks.filter((c) => c.status === 'ok').length;
|
|
914
|
+
const warn = report.checks.filter((c) => c.status === 'warn').length;
|
|
915
|
+
const fail = report.checks.filter((c) => c.status === 'fail').length;
|
|
916
|
+
const optional = report.checks.filter((c) => c.optional).length;
|
|
917
|
+
lines.push(` ${ok} passed, ${warn} warnings, ${fail} failures (${optional} optional)`);
|
|
918
|
+
return lines.join('\n');
|
|
919
|
+
}
|
|
920
|
+
formatReportAscii(report) {
|
|
921
|
+
const icon = { healthy: '[OK]', degraded: '[WARN]', broken: '[FAIL]' };
|
|
922
|
+
const statusIcon = { ok: '[OK]', warn: '[WARN]', fail: '[FAIL]' };
|
|
923
|
+
const divider = '-'.repeat(50);
|
|
924
|
+
const lines = [
|
|
925
|
+
'',
|
|
926
|
+
`${icon[report.overall]} SCALE Engine Health: ${report.overall.toUpperCase()}`,
|
|
927
|
+
divider,
|
|
928
|
+
];
|
|
929
|
+
for (const check of report.checks.filter((c) => !c.optional)) {
|
|
930
|
+
lines.push(` ${statusIcon[check.status]} ${check.name}: ${check.message}`);
|
|
931
|
+
if (check.fix)
|
|
932
|
+
lines.push(` Fix: ${check.fix}`);
|
|
933
|
+
}
|
|
934
|
+
lines.push(divider);
|
|
935
|
+
const appendSection = (title, category) => {
|
|
936
|
+
const sectionChecks = report.checks.filter((c) => c.optional && c.category === category);
|
|
937
|
+
if (sectionChecks.length === 0)
|
|
938
|
+
return;
|
|
939
|
+
lines.push('');
|
|
940
|
+
lines.push(title);
|
|
941
|
+
for (const check of sectionChecks) {
|
|
942
|
+
lines.push(` ${statusIcon[check.status]} ${check.name}: ${check.message}`);
|
|
943
|
+
if (check.fix)
|
|
944
|
+
lines.push(` Fix: ${check.fix}`);
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
appendSection('Project Governance (Optional):', 'governance');
|
|
948
|
+
appendSection('Knowledge Graph (Optional):', 'knowledge-graph');
|
|
949
|
+
appendSection('Memory Providers (Optional):', 'memory');
|
|
950
|
+
appendSection('Runtime Evidence (Optional):', 'runtime');
|
|
951
|
+
if (report.knowledgeGraph) {
|
|
952
|
+
const knowledgeGraph = report.knowledgeGraph;
|
|
953
|
+
lines.push('');
|
|
954
|
+
if (knowledgeGraph.available) {
|
|
955
|
+
lines.push(' [OK] Code knowledge graph available');
|
|
956
|
+
if (report.knowledgeGraph.codegraphProjectInitialized) {
|
|
957
|
+
lines.push(' -> Use: scale codegraph context --symbol <Symbol>');
|
|
958
|
+
}
|
|
959
|
+
if (report.knowledgeGraph.graphifyInstalled) {
|
|
960
|
+
lines.push(' -> Use: scale graphify .');
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
else {
|
|
964
|
+
lines.push(' [WARN] Code knowledge graph not available (optional feature)');
|
|
965
|
+
lines.push(` -> Bootstrap inspect: ${report.bootstrapPlan?.inspectCommand ?? 'scale bootstrap deps --pack knowledge --json'}`);
|
|
966
|
+
lines.push(` -> Bootstrap apply: ${report.bootstrapPlan?.packs.includes('knowledge') ? report.bootstrapPlan.applyCommand : 'scale bootstrap deps --pack knowledge --apply'}`);
|
|
967
|
+
}
|
|
968
|
+
lines.push(divider);
|
|
969
|
+
}
|
|
970
|
+
if (report.memoryProviders && !report.memoryProviders.gbrainAvailable) {
|
|
971
|
+
lines.push(` -> Memory bootstrap: ${report.bootstrapPlan?.packs.includes('memory') ? report.bootstrapPlan.applyCommand : 'scale bootstrap deps --pack memory --apply'}`);
|
|
972
|
+
lines.push(divider);
|
|
973
|
+
}
|
|
974
|
+
const ok = report.checks.filter((c) => c.status === 'ok').length;
|
|
975
|
+
const warn = report.checks.filter((c) => c.status === 'warn').length;
|
|
976
|
+
const fail = report.checks.filter((c) => c.status === 'fail').length;
|
|
977
|
+
const optional = report.checks.filter((c) => c.optional).length;
|
|
978
|
+
lines.push(` ${ok} passed, ${warn} warnings, ${fail} failures (${optional} optional)`);
|
|
979
|
+
return lines.join('\n');
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
//# sourceMappingURL=doctor.js.map
|