@oneuptime/common 11.5.4 → 11.5.5
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/Models/DatabaseModels/AIAgentTaskPullRequest.ts +56 -45
- package/Models/DatabaseModels/AIInsight.ts +748 -0
- package/Models/DatabaseModels/AIRun.ts +262 -0
- package/Models/DatabaseModels/CodeRepository.ts +42 -0
- package/Models/DatabaseModels/GlobalConfig.ts +105 -0
- package/Models/DatabaseModels/Index.ts +4 -8
- package/Models/DatabaseModels/InstanceHealthLog.ts +277 -0
- package/Models/DatabaseModels/LlmLog.ts +33 -0
- package/Models/DatabaseModels/Project.ts +123 -6
- package/Models/DatabaseModels/Runbook.ts +1 -1
- package/Server/API/AIAgentDataAPI.ts +802 -140
- package/Server/API/AIAgentTaskAPI.ts +132 -69
- package/Server/API/AIAgentTaskLogAPI.ts +65 -41
- package/Server/API/AIAgentTaskPullRequestAPI.ts +41 -0
- package/Server/API/AIInsightAPI.ts +220 -0
- package/Server/API/AIInvestigationAPI.ts +363 -1
- package/Server/API/CodeFixRunAPI.ts +251 -0
- package/Server/API/GitHubAPI.ts +246 -3
- package/Server/API/TelemetryExceptionAPI.ts +193 -48
- package/Server/EnvironmentConfig.ts +1 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783943300000-DropServiceCodeRepository.ts +26 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783947444597-CodeFixRunsOnAIRun.ts +73 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783950962813-AddCodeFixTaskType.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783954040984-AddInstrumentationFixTasksFlag.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783957160597-MigrationName.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783958542237-AddTaskContextToAIRun.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783965945957-AddInvestigationVerdictAndGrade.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783970619301-AddFixGuardrailColumns.ts +53 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783970619302-DropLegacyAIAgentTaskTables.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783977781677-AddCiStatusToFixPullRequests.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783990000000-AddCompletionTokensToLlmLog.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784010274993-AddSentinelInsight.ts +75 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784010274994-AddSentinelInsightFlags.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784030612266-RenameSentinelToAI.ts +203 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784033837629-MigrationName.ts +163 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +30 -0
- package/Server/Infrastructure/Queue.ts +82 -4
- package/Server/Infrastructure/Semaphore.ts +62 -1
- package/Server/Services/AIAgentService.ts +32 -0
- package/Server/Services/AIAgentTaskPullRequestService.ts +117 -0
- package/Server/Services/AIInsightService.ts +174 -0
- package/Server/Services/AIRunEventService.ts +63 -0
- package/Server/Services/AIRunService.ts +259 -1
- package/Server/Services/AIService.ts +249 -7
- package/Server/Services/AlertService.ts +4 -4
- package/Server/Services/CodeRepositoryService.ts +209 -0
- package/Server/Services/GlobalConfigService.ts +148 -0
- package/Server/Services/IncidentService.ts +183 -38
- package/Server/Services/IncidentStateTimelineService.ts +24 -4
- package/Server/Services/Index.ts +4 -4
- package/Server/Services/{AIAgentTaskLogService.ts → InstanceHealthLogService.ts} +1 -1
- package/Server/Services/LlmLogService.ts +27 -0
- package/Server/Services/LlmProviderService.ts +108 -0
- package/Server/Services/MetricBaselineService.ts +123 -0
- package/Server/Services/MonitorService.ts +15 -0
- package/Server/Services/TelemetryExceptionService.ts +323 -116
- package/Server/Services/TraceAggregationService.ts +176 -0
- package/Server/Types/Workflow/ComponentCode.ts +6 -0
- package/Server/Types/Workflow/Components/AI/GenerateText.ts +326 -0
- package/Server/Types/Workflow/Components/Index.ts +2 -0
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +1 -1
- package/Server/Utils/AI/CodeFix/CodeAgentWorkspaceGuard.ts +71 -0
- package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +243 -0
- package/Server/Utils/AI/CodeFix/CodeFixRunQueue.ts +131 -0
- package/Server/Utils/AI/CodeFix/FixRunBudget.ts +148 -0
- package/Server/Utils/AI/CodeFix/OpenPullRequestCap.ts +117 -0
- package/Server/Utils/AI/Eval/EvalCorpus.ts +369 -0
- package/Server/Utils/AI/Eval/EvalScores.ts +172 -0
- package/Server/Utils/AI/Eval/ReplayInvestigation.ts +87 -0
- package/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.ts +676 -0
- package/Server/Utils/AI/{Sentinel/SentinelInvestigationEngine.ts → SRE/AIInvestigationEngine.ts} +58 -37
- package/Server/Utils/AI/{Sentinel/SentinelMemory.ts → SRE/AIMemory.ts} +3 -3
- package/Server/Utils/AI/{Sentinel → SRE}/AlertInvestigationRunner.ts +50 -20
- package/Server/Utils/AI/SRE/ConfidenceSignal.ts +293 -0
- package/Server/Utils/AI/SRE/FixFromIncidentTaskTrigger.ts +115 -0
- package/Server/Utils/AI/SRE/FixPerformanceTaskTrigger.ts +223 -0
- package/Server/Utils/AI/{Sentinel → SRE}/IncidentInvestigationRunner.ts +71 -21
- package/Server/Utils/AI/{Sentinel → SRE}/IncidentPostmortemRunner.ts +8 -8
- package/Server/Utils/AI/SRE/Insights/Detectors/ErrorLogSpikeDetector.ts +364 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.ts +317 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/Index.ts +27 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/MetricDriftDetector.ts +221 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.ts +238 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/TraceLatencyRegressionDetector.ts +521 -0
- package/Server/Utils/AI/SRE/Insights/FixRouting.ts +242 -0
- package/Server/Utils/AI/SRE/Insights/InsightScanner.ts +290 -0
- package/Server/Utils/AI/SRE/Insights/InsightStore.ts +283 -0
- package/Server/Utils/AI/SRE/Insights/InsightTriageRunner.ts +242 -0
- package/Server/Utils/AI/SRE/Insights/Triage.ts +162 -0
- package/Server/Utils/AI/SRE/Insights/Types.ts +49 -0
- package/Server/Utils/AI/SRE/InstrumentationTaskTrigger.ts +212 -0
- package/Server/Utils/AI/SRE/InvestigationGrader.ts +282 -0
- package/Server/Utils/AI/{Sentinel → SRE}/InvestigationQueue.ts +114 -19
- package/Server/Utils/AI/{Sentinel → SRE}/README.md +4 -4
- package/Server/Utils/AI/SRE/SubjectCodeFixRun.ts +172 -0
- package/Server/Utils/AI/Toolbox/{SentinelActionTools.ts → AIActionTools.ts} +22 -1
- package/Server/Utils/AI/Toolbox/Index.ts +2 -2
- package/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.ts +526 -0
- package/Server/Utils/CodeRepository/GitHub/GitHub.ts +319 -1
- package/Server/Utils/CodeRepository/ServiceRepoLinkSuggester.ts +221 -0
- package/Server/Utils/CodeRepository/StackTraceRepoResolver.ts +571 -0
- package/Server/Utils/Execute.ts +2 -1
- package/Server/Utils/LLM/LLMService.ts +160 -30
- package/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.ts +152 -0
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +29 -0
- package/Tests/Server/Infrastructure/Queue.test.ts +227 -0
- package/Tests/Server/Infrastructure/SemaphorePermit.test.ts +159 -0
- package/Tests/Server/Services/AIAgentTaskPullRequestOutcomeStats.test.ts +154 -0
- package/Tests/Server/Services/AIInsightService.test.ts +324 -0
- package/Tests/Server/Services/AIRunCodeFixClaim.test.ts +401 -0
- package/Tests/Server/Services/AIRunHumanVerdict.test.ts +161 -0
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +95 -5
- package/Tests/Server/Services/AIServiceProjectAccess.test.ts +259 -0
- package/Tests/Server/Services/FixFromIncidentTaskTrigger.test.ts +249 -0
- package/Tests/Server/Services/FixPerformanceTaskTrigger.test.ts +274 -0
- package/Tests/Server/Services/GlobalConfigService.test.ts +80 -0
- package/Tests/Server/Services/IncidentInternalNoteAnnouncement.test.ts +1 -1
- package/Tests/Server/Services/InstrumentationTaskTrigger.test.ts +313 -0
- package/Tests/Server/Services/LlmProviderProjectOwned.test.ts +132 -0
- package/Tests/Server/Services/TelemetryExceptionAIFixReadiness.test.ts +405 -0
- package/Tests/Server/Services/TelemetryExceptionCodeFixRun.test.ts +322 -0
- package/Tests/Server/Services/TraceServiceLatencyProfile.test.ts +278 -0
- package/Tests/Server/Types/Workflow/Components/AIGenerateText.test.ts +722 -0
- package/Tests/Server/Utils/AI/{SentinelAlertGating.test.ts → AIAlertGating.test.ts} +19 -19
- package/Tests/Server/Utils/AI/AIConfidenceSignal.test.ts +362 -0
- package/Tests/Server/Utils/AI/{SentinelInvestigationQueue.test.ts → AIInvestigationQueue.test.ts} +19 -19
- package/Tests/Server/Utils/AI/CodeAgentWorkspaceGuard.test.ts +138 -0
- package/Tests/Server/Utils/AI/CodeFixAgentCompletion.test.ts +335 -0
- package/Tests/Server/Utils/AI/CodeFixRunQueue.test.ts +134 -0
- package/Tests/Server/Utils/AI/EvalCorpus.test.ts +209 -0
- package/Tests/Server/Utils/AI/EvalScores.test.ts +343 -0
- package/Tests/Server/Utils/AI/FixRunBudget.test.ts +218 -0
- package/Tests/Server/Utils/AI/Insights/ErrorLogSpikeDetector.test.ts +437 -0
- package/Tests/Server/Utils/AI/Insights/ExceptionSpikeDetector.test.ts +287 -0
- package/Tests/Server/Utils/AI/Insights/InsightDetectorsIndex.test.ts +34 -0
- package/Tests/Server/Utils/AI/Insights/InsightFixRouting.test.ts +572 -0
- package/Tests/Server/Utils/AI/Insights/InsightNeverThrowsHardening.test.ts +344 -0
- package/Tests/Server/Utils/AI/Insights/InsightScanner.test.ts +720 -0
- package/Tests/Server/Utils/AI/Insights/InsightStore.test.ts +467 -0
- package/Tests/Server/Utils/AI/Insights/InsightStoreHardening.test.ts +370 -0
- package/Tests/Server/Utils/AI/Insights/InsightTriage.test.ts +210 -0
- package/Tests/Server/Utils/AI/Insights/InsightTriageRunner.test.ts +221 -0
- package/Tests/Server/Utils/AI/Insights/InvestigationQueueInsightSubject.test.ts +328 -0
- package/Tests/Server/Utils/AI/Insights/MetricBaselineDrift.test.ts +182 -0
- package/Tests/Server/Utils/AI/Insights/MetricDriftDetector.test.ts +280 -0
- package/Tests/Server/Utils/AI/Insights/NewExceptionDetector.test.ts +259 -0
- package/Tests/Server/Utils/AI/Insights/TraceLatencyRegressionDetector.test.ts +770 -0
- package/Tests/Server/Utils/AI/InvestigationGrader.test.ts +343 -0
- package/Tests/Server/Utils/AI/LLMServiceRequestPolicy.test.ts +307 -0
- package/Tests/Server/Utils/AI/OpenPullRequestCap.test.ts +170 -0
- package/Tests/Server/Utils/AI/SpanTreeAnalyzer.test.ts +559 -0
- package/Tests/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.test.ts +158 -0
- package/Tests/Server/Utils/GitHubCheckRunsConclusion.test.ts +100 -0
- package/Tests/Server/Utils/GitHubPullRequestStateMapping.test.ts +50 -0
- package/Tests/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.test.ts +266 -0
- package/Tests/Server/Utils/ServiceRepoLinkSuggester.test.ts +167 -0
- package/Tests/Server/Utils/StackTraceRepoResolver.test.ts +527 -0
- package/Tests/Types/AI/AIChatPermissionMode.test.ts +112 -0
- package/Tests/Types/AI/CodeFixTaskType.test.ts +152 -0
- package/Tests/Types/AI/FixPullRequestCiStatus.test.ts +181 -0
- package/Tests/Types/Monitor/MonitorStepSqlMonitor.test.ts +110 -0
- package/Tests/Types/Monitor/SqlDatabaseType.test.ts +55 -0
- package/Tests/Types/Workflow/AIGenerateTextMetadata.test.ts +180 -0
- package/Tests/UI/Components/TableBulkCsvExport.test.tsx +168 -0
- package/Tests/UI/Utils/TableColumnsToCsv.test.ts +523 -0
- package/Types/AI/AIChatTypes.ts +8 -0
- package/Types/AI/AIInsightEvidence.ts +77 -0
- package/Types/AI/AIInsightHumanVerdict.ts +15 -0
- package/Types/AI/AIInsightSeverity.ts +13 -0
- package/Types/AI/AIInsightStatus.ts +38 -0
- package/Types/AI/AIInsightType.ts +41 -0
- package/Types/AI/AIRunAutoGrade.ts +18 -0
- package/Types/AI/AIRunEventType.ts +5 -0
- package/Types/AI/AIRunHumanVerdict.ts +17 -0
- package/Types/AI/AIRunType.ts +6 -0
- package/Types/AI/CodeFixTaskContext.ts +88 -0
- package/Types/AI/CodeFixTaskType.ts +132 -0
- package/Types/AI/FixPullRequestCiStatus.ts +132 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.ts +67 -0
- package/Types/Incident/IncidentMetricType.ts +7 -0
- package/Types/Monitor/CriteriaFilter.ts +8 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +67 -0
- package/Types/Monitor/MonitorStep.ts +38 -0
- package/Types/Monitor/MonitorStepSqlMonitor.ts +141 -0
- package/Types/Monitor/MonitorType.ts +17 -0
- package/Types/Monitor/SqlDatabaseType.ts +49 -0
- package/Types/Monitor/SqlMonitor/SqlMonitorResponse.ts +28 -0
- package/Types/Permission.ts +11 -95
- package/Types/Probe/ProbeMonitorResponse.ts +2 -0
- package/Types/Runbook/RunbookStep.ts +26 -2
- package/Types/Runbook/RunbookStepType.ts +1 -0
- package/Types/Workflow/Component.ts +13 -0
- package/Types/Workflow/ComponentID.ts +1 -0
- package/Types/Workflow/Components/AI.ts +148 -0
- package/Types/Workflow/Components.ts +8 -0
- package/UI/Components/AI/GenerateFromAIModal.tsx +1 -1
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +11 -0
- package/UI/Components/MoreMenu/MoreMenu.tsx +1 -1
- package/UI/Components/Table/Table.tsx +38 -2
- package/UI/Utils/TableColumnsToCsv.ts +385 -0
- package/Utils/Monitor/MonitorMetricType.ts +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js +59 -45
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIInsight.js +795 -0
- package/build/dist/Models/DatabaseModels/AIInsight.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIRun.js +274 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CodeRepository.js +43 -0
- package/build/dist/Models/DatabaseModels/CodeRepository.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +110 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +4 -8
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/InstanceHealthLog.js +304 -0
- package/build/dist/Models/DatabaseModels/InstanceHealthLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js +35 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +127 -6
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Runbook.js +1 -1
- package/build/dist/Models/DatabaseModels/Runbook.js.map +1 -1
- package/build/dist/Server/API/AIAgentDataAPI.js +568 -85
- package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskAPI.js +100 -44
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskLogAPI.js +49 -25
- package/build/dist/Server/API/AIAgentTaskLogAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js +27 -0
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js.map +1 -1
- package/build/dist/Server/API/AIInsightAPI.js +140 -0
- package/build/dist/Server/API/AIInsightAPI.js.map +1 -0
- package/build/dist/Server/API/AIInvestigationAPI.js +257 -1
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/CodeFixRunAPI.js +181 -0
- package/build/dist/Server/API/CodeFixRunAPI.js.map +1 -0
- package/build/dist/Server/API/GitHubAPI.js +164 -2
- package/build/dist/Server/API/GitHubAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryExceptionAPI.js +148 -43
- package/build/dist/Server/API/TelemetryExceptionAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +1 -1
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783943300000-DropServiceCodeRepository.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783943300000-DropServiceCodeRepository.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783947444597-CodeFixRunsOnAIRun.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783947444597-CodeFixRunsOnAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783950962813-AddCodeFixTaskType.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783950962813-AddCodeFixTaskType.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783954040984-AddInstrumentationFixTasksFlag.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783954040984-AddInstrumentationFixTasksFlag.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783957160597-MigrationName.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783957160597-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783958542237-AddTaskContextToAIRun.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783958542237-AddTaskContextToAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783965945957-AddInvestigationVerdictAndGrade.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783965945957-AddInvestigationVerdictAndGrade.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619301-AddFixGuardrailColumns.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619301-AddFixGuardrailColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619302-DropLegacyAIAgentTaskTables.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619302-DropLegacyAIAgentTaskTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783977781677-AddCiStatusToFixPullRequests.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783977781677-AddCiStatusToFixPullRequests.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783990000000-AddCompletionTokensToLlmLog.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783990000000-AddCompletionTokensToLlmLog.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274993-AddSentinelInsight.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274993-AddSentinelInsight.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274994-AddSentinelInsightFlags.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274994-AddSentinelInsightFlags.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784030612266-RenameSentinelToAI.js +125 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784030612266-RenameSentinelToAI.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784033837629-MigrationName.js +62 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784033837629-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Queue.js +73 -3
- package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
- package/build/dist/Server/Infrastructure/Semaphore.js +44 -1
- package/build/dist/Server/Infrastructure/Semaphore.js.map +1 -1
- package/build/dist/Server/Services/AIAgentService.js +29 -0
- package/build/dist/Server/Services/AIAgentService.js.map +1 -1
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js +78 -0
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js.map +1 -1
- package/build/dist/Server/Services/AIInsightService.js +164 -0
- package/build/dist/Server/Services/AIInsightService.js.map +1 -0
- package/build/dist/Server/Services/AIRunEventService.js +49 -0
- package/build/dist/Server/Services/AIRunEventService.js.map +1 -1
- package/build/dist/Server/Services/AIRunService.js +221 -0
- package/build/dist/Server/Services/AIRunService.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +198 -11
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +4 -4
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/CodeRepositoryService.js +180 -0
- package/build/dist/Server/Services/CodeRepositoryService.js.map +1 -1
- package/build/dist/Server/Services/GlobalConfigService.js +84 -0
- package/build/dist/Server/Services/GlobalConfigService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +149 -37
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +24 -4
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +4 -4
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/{AIAgentTaskLogService.js → InstanceHealthLogService.js} +2 -2
- package/build/dist/Server/Services/InstanceHealthLogService.js.map +1 -0
- package/build/dist/Server/Services/LlmLogService.js +23 -0
- package/build/dist/Server/Services/LlmLogService.js.map +1 -1
- package/build/dist/Server/Services/LlmProviderService.js +96 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
- package/build/dist/Server/Services/MetricBaselineService.js +65 -0
- package/build/dist/Server/Services/MetricBaselineService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +9 -1
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryExceptionService.js +243 -82
- package/build/dist/Server/Services/TelemetryExceptionService.js.map +1 -1
- package/build/dist/Server/Services/TraceAggregationService.js +124 -0
- package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
- package/build/dist/Server/Types/Workflow/ComponentCode.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/AI/GenerateText.js +240 -0
- package/build/dist/Server/Types/Workflow/Components/AI/GenerateText.js.map +1 -0
- package/build/dist/Server/Types/Workflow/Components/Index.js +2 -0
- package/build/dist/Server/Types/Workflow/Components/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeAgentWorkspaceGuard.js +48 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeAgentWorkspaceGuard.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +174 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixRunQueue.js +126 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixRunQueue.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js +131 -0
- package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/OpenPullRequestCap.js +99 -0
- package/build/dist/Server/Utils/AI/CodeFix/OpenPullRequestCap.js.map +1 -0
- package/build/dist/Server/Utils/AI/Eval/EvalCorpus.js +245 -0
- package/build/dist/Server/Utils/AI/Eval/EvalCorpus.js.map +1 -0
- package/build/dist/Server/Utils/AI/Eval/EvalScores.js +83 -0
- package/build/dist/Server/Utils/AI/Eval/EvalScores.js.map +1 -0
- package/build/dist/Server/Utils/AI/Eval/ReplayInvestigation.js +12 -0
- package/build/dist/Server/Utils/AI/Eval/ReplayInvestigation.js.map +1 -0
- package/build/dist/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.js +439 -0
- package/build/dist/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel/SentinelInvestigationEngine.js → SRE/AIInvestigationEngine.js} +47 -31
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel/SentinelMemory.js → SRE/AIMemory.js} +5 -5
- package/build/dist/Server/Utils/AI/SRE/AIMemory.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/AlertInvestigationRunner.js +42 -19
- package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/ConfidenceSignal.js +226 -0
- package/build/dist/Server/Utils/AI/SRE/ConfidenceSignal.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/FixFromIncidentTaskTrigger.js +100 -0
- package/build/dist/Server/Utils/AI/SRE/FixFromIncidentTaskTrigger.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/FixPerformanceTaskTrigger.js +174 -0
- package/build/dist/Server/Utils/AI/SRE/FixPerformanceTaskTrigger.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/IncidentInvestigationRunner.js +60 -22
- package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/IncidentPostmortemRunner.js +9 -9
- package/build/dist/Server/Utils/AI/SRE/IncidentPostmortemRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ErrorLogSpikeDetector.js +268 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ErrorLogSpikeDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.js +226 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/Index.js +26 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/Index.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/MetricDriftDetector.js +159 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/MetricDriftDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.js +177 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/TraceLatencyRegressionDetector.js +384 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/TraceLatencyRegressionDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/FixRouting.js +180 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/FixRouting.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightScanner.js +269 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightScanner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightStore.js +231 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightStore.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightTriageRunner.js +206 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightTriageRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Triage.js +121 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Triage.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Types.js +2 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Types.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/InstrumentationTaskTrigger.js +148 -0
- package/build/dist/Server/Utils/AI/SRE/InstrumentationTaskTrigger.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js +231 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/InvestigationQueue.js +102 -23
- package/build/dist/Server/Utils/AI/SRE/InvestigationQueue.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/SubjectCodeFixRun.js +167 -0
- package/build/dist/Server/Utils/AI/SRE/SubjectCodeFixRun.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/{SentinelActionTools.js → AIActionTools.js} +18 -2
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +2 -2
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js +301 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js.map +1 -0
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +240 -2
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/ServiceRepoLinkSuggester.js +127 -0
- package/build/dist/Server/Utils/CodeRepository/ServiceRepoLinkSuggester.js.map +1 -0
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js +336 -0
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js.map +1 -0
- package/build/dist/Server/Utils/Execute.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +125 -25
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.js +120 -0
- package/build/dist/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +21 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Types/AI/AIInsightEvidence.js +2 -0
- package/build/dist/Types/AI/AIInsightEvidence.js.map +1 -0
- package/build/dist/Types/AI/AIInsightHumanVerdict.js +16 -0
- package/build/dist/Types/AI/AIInsightHumanVerdict.js.map +1 -0
- package/build/dist/Types/AI/AIInsightSeverity.js +14 -0
- package/build/dist/Types/AI/AIInsightSeverity.js.map +1 -0
- package/build/dist/Types/AI/AIInsightStatus.js +36 -0
- package/build/dist/Types/AI/AIInsightStatus.js.map +1 -0
- package/build/dist/Types/AI/AIInsightType.js +42 -0
- package/build/dist/Types/AI/AIInsightType.js.map +1 -0
- package/build/dist/Types/AI/AIRunAutoGrade.js +19 -0
- package/build/dist/Types/AI/AIRunAutoGrade.js.map +1 -0
- package/build/dist/Types/AI/AIRunEventType.js +5 -0
- package/build/dist/Types/AI/AIRunEventType.js.map +1 -1
- package/build/dist/Types/AI/AIRunHumanVerdict.js +18 -0
- package/build/dist/Types/AI/AIRunHumanVerdict.js.map +1 -0
- package/build/dist/Types/AI/AIRunType.js +6 -0
- package/build/dist/Types/AI/AIRunType.js.map +1 -1
- package/build/dist/Types/AI/CodeFixTaskContext.js +29 -0
- package/build/dist/Types/AI/CodeFixTaskContext.js.map +1 -0
- package/build/dist/Types/AI/CodeFixTaskType.js +122 -0
- package/build/dist/Types/AI/CodeFixTaskType.js.map +1 -0
- package/build/dist/Types/AI/FixPullRequestCiStatus.js +102 -0
- package/build/dist/Types/AI/FixPullRequestCiStatus.js.map +1 -0
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +55 -0
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -1
- package/build/dist/Types/Incident/IncidentMetricType.js +7 -0
- package/build/dist/Types/Incident/IncidentMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +7 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +62 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +28 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js +93 -0
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorType.js +15 -0
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SqlDatabaseType.js +47 -0
- package/build/dist/Types/Monitor/SqlDatabaseType.js.map +1 -0
- package/build/dist/Types/Monitor/SqlMonitor/SqlMonitorResponse.js +2 -0
- package/build/dist/Types/Monitor/SqlMonitor/SqlMonitorResponse.js.map +1 -0
- package/build/dist/Types/Permission.js +10 -84
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Runbook/RunbookStepType.js +1 -0
- package/build/dist/Types/Runbook/RunbookStepType.js.map +1 -1
- package/build/dist/Types/Workflow/ComponentID.js +1 -0
- package/build/dist/Types/Workflow/ComponentID.js.map +1 -1
- package/build/dist/Types/Workflow/Components/AI.js +135 -0
- package/build/dist/Types/Workflow/Components/AI.js.map +1 -0
- package/build/dist/Types/Workflow/Components.js +7 -0
- package/build/dist/Types/Workflow/Components.js.map +1 -1
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js +1 -1
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +9 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js +1 -1
- package/build/dist/UI/Components/Table/Table.js +28 -2
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Utils/TableColumnsToCsv.js +291 -0
- package/build/dist/UI/Utils/TableColumnsToCsv.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js +1 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/package.json +1 -1
- package/Models/DatabaseModels/AIAgentTask.ts +0 -660
- package/Models/DatabaseModels/AIAgentTaskLog.ts +0 -426
- package/Models/DatabaseModels/AIAgentTaskTelemetryException.ts +0 -399
- package/Models/DatabaseModels/ServiceCodeRepository.ts +0 -647
- package/Server/Services/AIAgentTaskService.ts +0 -240
- package/Server/Services/AIAgentTaskTelemetryExceptionService.ts +0 -39
- package/Server/Services/ServiceCodeRepositoryService.ts +0 -55
- package/Tests/Server/Services/AIAgentTaskServiceClaim.test.ts +0 -146
- package/Types/AI/AIAgentTaskMetadata.ts +0 -25
- package/Types/AI/AIAgentTaskType.ts +0 -40
- package/build/dist/Models/DatabaseModels/AIAgentTask.js +0 -691
- package/build/dist/Models/DatabaseModels/AIAgentTask.js.map +0 -1
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js +0 -447
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js.map +0 -1
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js +0 -415
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js.map +0 -1
- package/build/dist/Models/DatabaseModels/ServiceCodeRepository.js +0 -665
- package/build/dist/Models/DatabaseModels/ServiceCodeRepository.js.map +0 -1
- package/build/dist/Server/Services/AIAgentTaskLogService.js.map +0 -1
- package/build/dist/Server/Services/AIAgentTaskService.js +0 -217
- package/build/dist/Server/Services/AIAgentTaskService.js.map +0 -1
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js +0 -36
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js.map +0 -1
- package/build/dist/Server/Services/ServiceCodeRepositoryService.js +0 -54
- package/build/dist/Server/Services/ServiceCodeRepositoryService.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/IncidentPostmortemRunner.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/SentinelMemory.js.map +0 -1
- package/build/dist/Server/Utils/AI/Toolbox/SentinelActionTools.js.map +0 -1
- package/build/dist/Types/AI/AIAgentTaskMetadata.js +0 -6
- package/build/dist/Types/AI/AIAgentTaskMetadata.js.map +0 -1
- package/build/dist/Types/AI/AIAgentTaskType.js +0 -29
- package/build/dist/Types/AI/AIAgentTaskType.js.map +0 -1
|
@@ -13,7 +13,7 @@ import logger from "../../Logger";
|
|
|
13
13
|
import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
14
14
|
|
|
15
15
|
/*
|
|
16
|
-
*
|
|
16
|
+
* AI SRE — the durable investigation queue (Phase 2's first item; Q1
|
|
17
17
|
* decided as the DB-claim pattern on AIRun rows, no new infrastructure).
|
|
18
18
|
*
|
|
19
19
|
* The problem it replaces: investigations ran as detached in-process
|
|
@@ -61,6 +61,30 @@ export const DEFAULT_MAX_CONCURRENT_INVESTIGATIONS: number = 3;
|
|
|
61
61
|
const MIN_CONCURRENT_INVESTIGATIONS: number = 1;
|
|
62
62
|
const MAX_CONCURRENT_INVESTIGATIONS: number = 25;
|
|
63
63
|
|
|
64
|
+
/*
|
|
65
|
+
* Lane priority. Two kinds of run share this queue and the per-project
|
|
66
|
+
* concurrency cap above:
|
|
67
|
+
* - the INTERACTIVE lane (incident/alert RCA) — a human is waiting;
|
|
68
|
+
* - the PREVENTIVE lane (AI-insight triage, identified by
|
|
69
|
+
* triggeredByAiInsightId) — nobody is waiting, and one scan tick
|
|
70
|
+
* can file up to MAX_NEW_INSIGHTS_PER_PROJECT_PER_SCAN (10) of them.
|
|
71
|
+
*
|
|
72
|
+
* Without a sub-cap the preventive lane can hold every slot, and since the
|
|
73
|
+
* poller drains oldest-first, an incident that fires after a scan queues
|
|
74
|
+
* BEHIND that backlog — the exact RCA latency the product promises.
|
|
75
|
+
*
|
|
76
|
+
* So the preventive lane may hold at most (cap - RESERVED) slots: at least
|
|
77
|
+
* one slot is always unreachable by triage. Combined with the inline kick
|
|
78
|
+
* that enqueue() fires for every run, that reserved slot is enough on its
|
|
79
|
+
* own — an incident/alert enqueue calls processRun immediately, passes the
|
|
80
|
+
* gates against a cap that triage cannot have saturated, and dispatches
|
|
81
|
+
* without ever touching the poller (so it can also never be TTL-expired
|
|
82
|
+
* behind triage). Splitting the poller's oldest-first query into two lane
|
|
83
|
+
* queries would therefore only re-order runs that are ALREADY late, at the
|
|
84
|
+
* cost of an extra query every tick — deliberately not done.
|
|
85
|
+
*/
|
|
86
|
+
export const INSIGHT_TRIAGE_RESERVED_SLOTS: number = 1;
|
|
87
|
+
|
|
64
88
|
/*
|
|
65
89
|
* A first-pass RCA is only useful while the incident is fresh. Queued runs
|
|
66
90
|
* older than this are expired rather than run late — this also caps queue
|
|
@@ -77,14 +101,19 @@ export interface QueuedRunRef {
|
|
|
77
101
|
attemptCount: number;
|
|
78
102
|
triggeredByIncidentId?: ObjectID | undefined;
|
|
79
103
|
triggeredByAlertId?: ObjectID | undefined;
|
|
104
|
+
triggeredByAiInsightId?: ObjectID | undefined;
|
|
80
105
|
}
|
|
81
106
|
|
|
82
|
-
export default class
|
|
107
|
+
export default class AIInvestigationQueue {
|
|
83
108
|
/*
|
|
84
109
|
* Record the durable intent to investigate, then try to process it
|
|
85
110
|
* immediately (detached — the poller is the safety net if this pod dies).
|
|
86
111
|
* Callers have already passed the subject-specific gates (opt-in,
|
|
87
112
|
* severity floor, dedupe window).
|
|
113
|
+
*
|
|
114
|
+
* Returns the created run's id (so subject rows can link back to it), or
|
|
115
|
+
* null when the enqueue was quiet-skipped (budget) or failed — enqueue
|
|
116
|
+
* itself never throws.
|
|
88
117
|
*/
|
|
89
118
|
@CaptureSpan()
|
|
90
119
|
public static async enqueue(data: {
|
|
@@ -92,7 +121,8 @@ export default class SentinelInvestigationQueue {
|
|
|
92
121
|
subjectIncidentId?: ObjectID | undefined;
|
|
93
122
|
subjectAlertId?: ObjectID | undefined;
|
|
94
123
|
subjectMonitorId?: ObjectID | undefined;
|
|
95
|
-
|
|
124
|
+
subjectAIInsightId?: ObjectID | undefined;
|
|
125
|
+
}): Promise<ObjectID | null> {
|
|
96
126
|
const { projectId } = data;
|
|
97
127
|
|
|
98
128
|
/*
|
|
@@ -106,15 +136,15 @@ export default class SentinelInvestigationQueue {
|
|
|
106
136
|
|
|
107
137
|
if (budget.exhausted) {
|
|
108
138
|
logger.debug(
|
|
109
|
-
`
|
|
139
|
+
`AI: not enqueueing investigation for project ${projectId.toString()} — daily autonomous token budget exhausted (${budget.usedTokensToday} of ${budget.limitInTokens} tokens used today).`,
|
|
110
140
|
);
|
|
111
|
-
return;
|
|
141
|
+
return null;
|
|
112
142
|
}
|
|
113
143
|
} catch (error) {
|
|
114
144
|
logger.error(
|
|
115
|
-
`
|
|
145
|
+
`AI: budget check failed, not enqueueing investigation: ${error}`,
|
|
116
146
|
);
|
|
117
|
-
return;
|
|
147
|
+
return null;
|
|
118
148
|
}
|
|
119
149
|
|
|
120
150
|
const run: AIRun = new AIRun();
|
|
@@ -131,6 +161,9 @@ export default class SentinelInvestigationQueue {
|
|
|
131
161
|
if (data.subjectMonitorId) {
|
|
132
162
|
run.monitorId = data.subjectMonitorId;
|
|
133
163
|
}
|
|
164
|
+
if (data.subjectAIInsightId) {
|
|
165
|
+
run.triggeredByAiInsightId = data.subjectAIInsightId;
|
|
166
|
+
}
|
|
134
167
|
|
|
135
168
|
let createdRun: AIRun;
|
|
136
169
|
try {
|
|
@@ -139,8 +172,8 @@ export default class SentinelInvestigationQueue {
|
|
|
139
172
|
props: { isRoot: true },
|
|
140
173
|
});
|
|
141
174
|
} catch (error) {
|
|
142
|
-
logger.error(`
|
|
143
|
-
return;
|
|
175
|
+
logger.error(`AI: failed to enqueue investigation run: ${error}`);
|
|
176
|
+
return null;
|
|
144
177
|
}
|
|
145
178
|
|
|
146
179
|
// Inline kick — preserves the 1-3 minute RCA latency on the happy path.
|
|
@@ -150,11 +183,14 @@ export default class SentinelInvestigationQueue {
|
|
|
150
183
|
attemptCount: 0,
|
|
151
184
|
triggeredByIncidentId: data.subjectIncidentId,
|
|
152
185
|
triggeredByAlertId: data.subjectAlertId,
|
|
186
|
+
triggeredByAiInsightId: data.subjectAIInsightId,
|
|
153
187
|
}).catch((error: Error) => {
|
|
154
188
|
logger.error(
|
|
155
|
-
`
|
|
189
|
+
`AI: inline processing of queued run ${createdRun.id?.toString()} failed: ${error}`,
|
|
156
190
|
);
|
|
157
191
|
});
|
|
192
|
+
|
|
193
|
+
return createdRun.id || null;
|
|
158
194
|
}
|
|
159
195
|
|
|
160
196
|
/*
|
|
@@ -179,7 +215,7 @@ export default class SentinelInvestigationQueue {
|
|
|
179
215
|
await this.dispatch(run, attempt);
|
|
180
216
|
} catch (error) {
|
|
181
217
|
logger.error(
|
|
182
|
-
`
|
|
218
|
+
`AI: failed to process queued run ${run.id.toString()}: ${error}`,
|
|
183
219
|
);
|
|
184
220
|
}
|
|
185
221
|
}
|
|
@@ -233,6 +269,7 @@ export default class SentinelInvestigationQueue {
|
|
|
233
269
|
attemptCount: true,
|
|
234
270
|
triggeredByIncidentId: true,
|
|
235
271
|
triggeredByAlertId: true,
|
|
272
|
+
triggeredByAiInsightId: true,
|
|
236
273
|
},
|
|
237
274
|
sort: { createdAt: SortOrder.Ascending },
|
|
238
275
|
limit: POLLER_BATCH_SIZE,
|
|
@@ -247,6 +284,7 @@ export default class SentinelInvestigationQueue {
|
|
|
247
284
|
attemptCount: queued.attemptCount || 0,
|
|
248
285
|
triggeredByIncidentId: queued.triggeredByIncidentId,
|
|
249
286
|
triggeredByAlertId: queued.triggeredByAlertId,
|
|
287
|
+
triggeredByAiInsightId: queued.triggeredByAiInsightId,
|
|
250
288
|
};
|
|
251
289
|
|
|
252
290
|
try {
|
|
@@ -266,12 +304,12 @@ export default class SentinelInvestigationQueue {
|
|
|
266
304
|
*/
|
|
267
305
|
this.dispatch(ref, attempt).catch((error: Error) => {
|
|
268
306
|
logger.error(
|
|
269
|
-
`
|
|
307
|
+
`AI: detached execution of run ${ref.id.toString()} failed: ${error}`,
|
|
270
308
|
);
|
|
271
309
|
});
|
|
272
310
|
} catch (error) {
|
|
273
311
|
logger.error(
|
|
274
|
-
`
|
|
312
|
+
`AI: poller failed on queued run ${ref.id.toString()}: ${error}`,
|
|
275
313
|
);
|
|
276
314
|
}
|
|
277
315
|
}
|
|
@@ -304,7 +342,7 @@ export default class SentinelInvestigationQueue {
|
|
|
304
342
|
|
|
305
343
|
if (requeued > 0) {
|
|
306
344
|
logger.debug(
|
|
307
|
-
`
|
|
345
|
+
`AI: requeued run ${data.aiRunId.toString()} after attempt ${data.attemptCount} failed.`,
|
|
308
346
|
);
|
|
309
347
|
}
|
|
310
348
|
return;
|
|
@@ -361,9 +399,10 @@ export default class SentinelInvestigationQueue {
|
|
|
361
399
|
}
|
|
362
400
|
|
|
363
401
|
/*
|
|
364
|
-
* The claim-time cost gates: concurrency cap
|
|
365
|
-
* failing these stays Queued — the poller
|
|
366
|
-
* what never fits. Fails cheap (skip) on gate
|
|
402
|
+
* The claim-time cost gates: concurrency cap, the preventive-lane sub-cap
|
|
403
|
+
* and the daily budget. A run failing these stays Queued — the poller
|
|
404
|
+
* retries and the TTL expires what never fits. Fails cheap (skip) on gate
|
|
405
|
+
* errors.
|
|
367
406
|
*/
|
|
368
407
|
private static async passesClaimGates(run: QueuedRunRef): Promise<boolean> {
|
|
369
408
|
// Per-project cap override, defaulting to 3 and clamped to [1, 25].
|
|
@@ -395,17 +434,53 @@ export default class SentinelInvestigationQueue {
|
|
|
395
434
|
|
|
396
435
|
if (runningCount >= concurrencyCap) {
|
|
397
436
|
logger.debug(
|
|
398
|
-
`
|
|
437
|
+
`AI: leaving run ${run.id.toString()} queued — ${runningCount} investigations already running (cap: ${concurrencyCap}).`,
|
|
399
438
|
);
|
|
400
439
|
return false;
|
|
401
440
|
}
|
|
402
441
|
|
|
442
|
+
/*
|
|
443
|
+
* The preventive lane's sub-cap: insight triage may never occupy the
|
|
444
|
+
* slot(s) reserved for incident/alert RCA (see
|
|
445
|
+
* INSIGHT_TRIAGE_RESERVED_SLOTS). Floored at 1 so a project running at
|
|
446
|
+
* the minimum cap of 1 still triages its insights (slower, one at a
|
|
447
|
+
* time) instead of deadlocking the lane entirely — the interactive lane
|
|
448
|
+
* keeps its priority through the global cap check above, which a single
|
|
449
|
+
* running triage run cannot outlast for long (triage is read-only and
|
|
450
|
+
* short).
|
|
451
|
+
*/
|
|
452
|
+
if (run.triggeredByAiInsightId) {
|
|
453
|
+
const triageCap: number = Math.max(
|
|
454
|
+
1,
|
|
455
|
+
concurrencyCap - INSIGHT_TRIAGE_RESERVED_SLOTS,
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
const runningTriageCount: number = (
|
|
459
|
+
await AIRunService.countBy({
|
|
460
|
+
query: {
|
|
461
|
+
projectId: run.projectId,
|
|
462
|
+
runType: AIRunType.Investigation,
|
|
463
|
+
status: AIRunStatus.Running,
|
|
464
|
+
triggeredByAiInsightId: QueryHelper.notNull(),
|
|
465
|
+
},
|
|
466
|
+
props: { isRoot: true },
|
|
467
|
+
})
|
|
468
|
+
).toNumber();
|
|
469
|
+
|
|
470
|
+
if (runningTriageCount >= triageCap) {
|
|
471
|
+
logger.debug(
|
|
472
|
+
`AI: leaving insight triage run ${run.id.toString()} queued — ${runningTriageCount} triage runs already running (triage lane cap: ${triageCap} of ${concurrencyCap}).`,
|
|
473
|
+
);
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
403
478
|
const budget: AutonomousBudgetStatus =
|
|
404
479
|
await AIService.getAutonomousDailyBudgetStatus(run.projectId);
|
|
405
480
|
|
|
406
481
|
if (budget.exhausted) {
|
|
407
482
|
logger.debug(
|
|
408
|
-
`
|
|
483
|
+
`AI: leaving run ${run.id.toString()} queued — daily autonomous token budget exhausted.`,
|
|
409
484
|
);
|
|
410
485
|
return false;
|
|
411
486
|
}
|
|
@@ -479,6 +554,26 @@ export default class SentinelInvestigationQueue {
|
|
|
479
554
|
return;
|
|
480
555
|
}
|
|
481
556
|
|
|
557
|
+
/*
|
|
558
|
+
* AI-insight triage runs carry their subject in
|
|
559
|
+
* triggeredByAiInsightId — they must be recognized here as
|
|
560
|
+
* subject-BEARING, or the fallthrough below would fail every one of
|
|
561
|
+
* them as subject-less.
|
|
562
|
+
*/
|
|
563
|
+
if (run.triggeredByAiInsightId) {
|
|
564
|
+
const insightTriageRunner: typeof import("./Insights/InsightTriageRunner").default =
|
|
565
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
566
|
+
require("./Insights/InsightTriageRunner").default;
|
|
567
|
+
|
|
568
|
+
await insightTriageRunner.executeTriage({
|
|
569
|
+
aiRunId: run.id,
|
|
570
|
+
projectId: run.projectId,
|
|
571
|
+
sentinelInsightId: run.triggeredByAiInsightId,
|
|
572
|
+
attemptCount: attempt,
|
|
573
|
+
});
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
|
|
482
577
|
// A queued investigation without a subject cannot be executed.
|
|
483
578
|
await AIRunService.attemptStatusTransition({
|
|
484
579
|
aiRunId: run.id,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AI SRE — autonomous investigation engine
|
|
2
2
|
|
|
3
|
-
Wake-on-signal AI SRE: when an incident or alert is created (and the project has opted in),
|
|
3
|
+
Wake-on-signal AI SRE: when an incident or alert is created (and the project has opted in), AI runs a read-only, budgeted, citation-minting investigation over the project's own telemetry and posts a root-cause analysis to the subject's feed, with a glass-box `AIRun`/`AIRunEvent` trail behind a live dashboard panel.
|
|
4
4
|
|
|
5
|
-
- `
|
|
5
|
+
- `AIInvestigationEngine.ts` — shared run lifecycle, budgets, persona, quiet-mode confidence gate
|
|
6
6
|
- `IncidentInvestigationRunner.ts` / `AlertInvestigationRunner.ts` — per-subject context assembly + result posting
|
|
7
7
|
- `IncidentPostmortemRunner.ts` — auto-draft postmortem when an incident resolves
|
|
8
|
-
- `
|
|
8
|
+
- `AIMemory.ts` — recurrence context from past resolved incidents (retrieval-only v1)
|
|
9
9
|
|
|
10
10
|
**Roadmap & status:** [Internal/Roadmap/AISentinelExecution.md](../../../../../Internal/Roadmap/AISentinelExecution.md) (tracker — update it in the same PR when you change behavior here) and [Internal/Roadmap/AISentinelVision.md](../../../../../Internal/Roadmap/AISentinelVision.md) (strategy).
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import ObjectID from "../../../../Types/ObjectID";
|
|
2
|
+
import AIRunType from "../../../../Types/AI/AIRunType";
|
|
3
|
+
import AIRunStatus from "../../../../Types/AI/AIRunStatus";
|
|
4
|
+
import CodeFixTaskType from "../../../../Types/AI/CodeFixTaskType";
|
|
5
|
+
import CodeFixTaskContext from "../../../../Types/AI/CodeFixTaskContext";
|
|
6
|
+
import CodeRepositoryType from "../../../../Types/CodeRepository/CodeRepositoryType";
|
|
7
|
+
import { LIMIT_PER_PROJECT } from "../../../../Types/Database/LimitMax";
|
|
8
|
+
import AIRun from "../../../../Models/DatabaseModels/AIRun";
|
|
9
|
+
import AIRunService from "../../../Services/AIRunService";
|
|
10
|
+
import CodeRepositoryService from "../../../Services/CodeRepositoryService";
|
|
11
|
+
import FixRunBudget from "../CodeFix/FixRunBudget";
|
|
12
|
+
import QueryHelper from "../../../Types/Database/QueryHelper";
|
|
13
|
+
import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* Shared plumbing for the non-exception CodeFix recipes: the incident/alert
|
|
17
|
+
* subject recipes (ImproveInstrumentation, FixFromIncident) and the
|
|
18
|
+
* trace-evidence recipe (FixPerformance). All enqueue AIRun(CodeFix) rows
|
|
19
|
+
* keyed to something other than a telemetry exception, all need a
|
|
20
|
+
* GitHub-App-connected repository the agent can actually clone and push,
|
|
21
|
+
* and all dedupe to at most one non-terminal run per (context, recipe).
|
|
22
|
+
* The triggers differ (automatic-after-inconclusive vs. user button) — the
|
|
23
|
+
* enqueue idiom must not.
|
|
24
|
+
*/
|
|
25
|
+
export default class SubjectCodeFixRun {
|
|
26
|
+
/*
|
|
27
|
+
* Only GitHub-App-connected repositories can be cloned and pushed by the
|
|
28
|
+
* agent (mirrors CodeRepositoryService.resolveRepositoryForException).
|
|
29
|
+
*/
|
|
30
|
+
@CaptureSpan()
|
|
31
|
+
public static async hasGitHubAppConnectedRepository(
|
|
32
|
+
projectId: ObjectID,
|
|
33
|
+
): Promise<boolean> {
|
|
34
|
+
const connectedRepositoryCount: number = (
|
|
35
|
+
await CodeRepositoryService.countBy({
|
|
36
|
+
query: {
|
|
37
|
+
projectId,
|
|
38
|
+
repositoryHostedAt: CodeRepositoryType.GitHub,
|
|
39
|
+
gitHubAppInstallationId: QueryHelper.notNull(),
|
|
40
|
+
},
|
|
41
|
+
props: { isRoot: true },
|
|
42
|
+
})
|
|
43
|
+
).toNumber();
|
|
44
|
+
|
|
45
|
+
return connectedRepositoryCount > 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* Per-(subject, recipe) dedupe guard (mirrors the per-(exception,
|
|
50
|
+
* taskType) guard in TelemetryExceptionService): at most one non-terminal
|
|
51
|
+
* run of a recipe per incident/alert, so repeated triggers on the same
|
|
52
|
+
* subject never fan out into duplicate PRs. Exactly one of
|
|
53
|
+
* incidentId/alertId is expected.
|
|
54
|
+
*/
|
|
55
|
+
@CaptureSpan()
|
|
56
|
+
public static async findNonTerminalRunForSubject(data: {
|
|
57
|
+
taskType: CodeFixTaskType;
|
|
58
|
+
incidentId?: ObjectID | undefined;
|
|
59
|
+
alertId?: ObjectID | undefined;
|
|
60
|
+
}): Promise<AIRun | null> {
|
|
61
|
+
return AIRunService.findOneBy({
|
|
62
|
+
query: {
|
|
63
|
+
runType: AIRunType.CodeFix,
|
|
64
|
+
codeFixTaskType: data.taskType,
|
|
65
|
+
...(data.incidentId
|
|
66
|
+
? { triggeredByIncidentId: data.incidentId }
|
|
67
|
+
: { triggeredByAlertId: data.alertId! }),
|
|
68
|
+
status: QueryHelper.notIn([
|
|
69
|
+
AIRunStatus.Completed,
|
|
70
|
+
AIRunStatus.Error,
|
|
71
|
+
AIRunStatus.Cancelled,
|
|
72
|
+
AIRunStatus.Stale,
|
|
73
|
+
]),
|
|
74
|
+
},
|
|
75
|
+
select: { _id: true },
|
|
76
|
+
props: { isRoot: true },
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
* Per-trace dedupe for the FixPerformance recipe: at most one
|
|
82
|
+
* non-terminal FixPerformance run per (project, traceId). The traceId
|
|
83
|
+
* lives inside the JSON taskContext, which the Query layer cannot filter
|
|
84
|
+
* on — so this scans the project's non-terminal FixPerformance runs
|
|
85
|
+
* (bounded and rare: they exist only between a user click and the PR)
|
|
86
|
+
* and matches the traceId in memory. Honest per-trace dedupe without a
|
|
87
|
+
* dedicated column.
|
|
88
|
+
*/
|
|
89
|
+
@CaptureSpan()
|
|
90
|
+
public static async findNonTerminalPerformanceFixRunForTrace(data: {
|
|
91
|
+
projectId: ObjectID;
|
|
92
|
+
traceId: string;
|
|
93
|
+
}): Promise<AIRun | null> {
|
|
94
|
+
const activeRuns: Array<AIRun> = await AIRunService.findBy({
|
|
95
|
+
query: {
|
|
96
|
+
projectId: data.projectId,
|
|
97
|
+
runType: AIRunType.CodeFix,
|
|
98
|
+
codeFixTaskType: CodeFixTaskType.FixPerformance,
|
|
99
|
+
status: QueryHelper.notIn([
|
|
100
|
+
AIRunStatus.Completed,
|
|
101
|
+
AIRunStatus.Error,
|
|
102
|
+
AIRunStatus.Cancelled,
|
|
103
|
+
AIRunStatus.Stale,
|
|
104
|
+
]),
|
|
105
|
+
},
|
|
106
|
+
select: { _id: true, taskContext: true },
|
|
107
|
+
limit: LIMIT_PER_PROJECT,
|
|
108
|
+
skip: 0,
|
|
109
|
+
props: { isRoot: true },
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
activeRuns.find((run: AIRun): boolean => {
|
|
114
|
+
return run.taskContext?.traceId === data.traceId;
|
|
115
|
+
}) || null
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/*
|
|
120
|
+
* Record the durable intent as a Queued CodeFix AIRun that the external
|
|
121
|
+
* agent worker claims via /ai-agent-task/get-pending-task. `userId` is
|
|
122
|
+
* attribution for human-triggered recipes (who clicked the button);
|
|
123
|
+
* automatic triggers pass none and stay system-authored. Subject-less
|
|
124
|
+
* recipes (FixPerformance) pass neither incidentId nor alertId and carry
|
|
125
|
+
* their trigger-time evidence in `taskContext` instead.
|
|
126
|
+
*
|
|
127
|
+
* Created as root: AIRun rows are server-written only (empty create ACL);
|
|
128
|
+
* callers must have gated access before enqueueing.
|
|
129
|
+
*
|
|
130
|
+
* Throws BadDataException when the project is over its daily fix-run
|
|
131
|
+
* budget (G11 guardrail, enforced here so EVERY subject/perf recipe is
|
|
132
|
+
* covered). User-triggered callers surface the message; the automatic
|
|
133
|
+
* instrumentation trigger pre-checks the budget and skips quietly, with
|
|
134
|
+
* its never-throws wrapper as the backstop.
|
|
135
|
+
*/
|
|
136
|
+
@CaptureSpan()
|
|
137
|
+
public static async enqueueSubjectCodeFixRun(data: {
|
|
138
|
+
projectId: ObjectID;
|
|
139
|
+
taskType: CodeFixTaskType;
|
|
140
|
+
incidentId?: ObjectID | undefined;
|
|
141
|
+
alertId?: ObjectID | undefined;
|
|
142
|
+
userId?: ObjectID | undefined;
|
|
143
|
+
taskContext?: CodeFixTaskContext | undefined;
|
|
144
|
+
}): Promise<AIRun> {
|
|
145
|
+
await FixRunBudget.assertWithinBudget(data.projectId);
|
|
146
|
+
|
|
147
|
+
const run: AIRun = new AIRun();
|
|
148
|
+
run.projectId = data.projectId;
|
|
149
|
+
run.runType = AIRunType.CodeFix;
|
|
150
|
+
run.codeFixTaskType = data.taskType;
|
|
151
|
+
run.status = AIRunStatus.Queued;
|
|
152
|
+
|
|
153
|
+
if (data.incidentId) {
|
|
154
|
+
run.triggeredByIncidentId = data.incidentId;
|
|
155
|
+
} else if (data.alertId) {
|
|
156
|
+
run.triggeredByAlertId = data.alertId;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (data.userId) {
|
|
160
|
+
run.userId = data.userId;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (data.taskContext) {
|
|
164
|
+
run.taskContext = data.taskContext;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return AIRunService.create({
|
|
168
|
+
data: run,
|
|
169
|
+
props: { isRoot: true },
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "./ToolTypes";
|
|
29
29
|
|
|
30
30
|
/*
|
|
31
|
-
*
|
|
31
|
+
* AI "action belt" — Phase 0.
|
|
32
32
|
*
|
|
33
33
|
* Mutating tools that let the copilot OPERATE the platform (not just answer
|
|
34
34
|
* questions), each a thin wrapper over an already-RBAC-tested service method.
|
|
@@ -261,6 +261,27 @@ export const RunRunbookTool: ObservabilityTool = {
|
|
|
261
261
|
);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
/*
|
|
265
|
+
* Only link an incident the caller can actually read in this project.
|
|
266
|
+
* Looking it up under the user's RBAC (not isRoot) rejects both a
|
|
267
|
+
* cross-tenant id and one the user has no access to — so the tool cannot
|
|
268
|
+
* be used to staple another project's incident onto an execution.
|
|
269
|
+
*/
|
|
270
|
+
if (incidentId) {
|
|
271
|
+
const linkedIncident: Incident | null = await IncidentService.findOneById(
|
|
272
|
+
{
|
|
273
|
+
id: incidentId,
|
|
274
|
+
select: { _id: true },
|
|
275
|
+
props: ctx.props,
|
|
276
|
+
},
|
|
277
|
+
);
|
|
278
|
+
if (!linkedIncident) {
|
|
279
|
+
throw new BadDataException(
|
|
280
|
+
"Incident not found (or you do not have access to it).",
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
264
285
|
const execution: RunbookExecution | null =
|
|
265
286
|
await RunbookRuleEngineService.startRunbookFor({
|
|
266
287
|
projectId: ctx.projectId,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
RunRunbookTool,
|
|
34
34
|
PostIncidentStatusUpdateTool,
|
|
35
35
|
ChangeIncidentSeverityTool,
|
|
36
|
-
} from "./
|
|
36
|
+
} from "./AIActionTools";
|
|
37
37
|
import AIChatPermissionMode from "../../../../Types/AI/AIChatPermissionMode";
|
|
38
38
|
|
|
39
39
|
export interface ToolCallOutcome {
|
|
@@ -77,7 +77,7 @@ export default class AIToolbox {
|
|
|
77
77
|
ResolveIncidentTool,
|
|
78
78
|
AcknowledgeAlertTool,
|
|
79
79
|
ResolveAlertTool,
|
|
80
|
-
//
|
|
80
|
+
// AI action belt (Phase 0) — operate the platform, not just answer.
|
|
81
81
|
PageOnCallPolicyTool,
|
|
82
82
|
RunRunbookTool,
|
|
83
83
|
PostIncidentStatusUpdateTool,
|