@oneuptime/common 11.5.3 → 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/Dashboard.ts +3 -3
- 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/DashboardService.ts +11 -2
- 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 +34 -13
- 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/API/DashboardMasterPasswordAPI.test.ts +225 -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/Dashboard.js +3 -3
- package/build/dist/Models/DatabaseModels/Dashboard.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/DashboardService.js +8 -2
- package/build/dist/Server/Services/DashboardService.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 +21 -11
- 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
|
@@ -1,9 +1,87 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
1
10
|
import DatabaseService from "./DatabaseService";
|
|
2
11
|
import Model from "../../Models/DatabaseModels/AIAgentTaskPullRequest";
|
|
12
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
13
|
+
import PullRequestState from "../../Types/CodeRepository/PullRequestState";
|
|
14
|
+
import FixPullRequestCiStatus from "../../Types/AI/FixPullRequestCiStatus";
|
|
15
|
+
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
3
16
|
export class Service extends DatabaseService {
|
|
4
17
|
constructor() {
|
|
5
18
|
super(Model);
|
|
6
19
|
}
|
|
20
|
+
/*
|
|
21
|
+
* Outcome counts for the project's AI-authored fix PRs — the G11
|
|
22
|
+
* precision baseline (states kept current by AIAgent:SyncPullRequestStates).
|
|
23
|
+
* Queries run with the caller's props so tenant scoping and read
|
|
24
|
+
* permissions come from the model ACLs.
|
|
25
|
+
*/
|
|
26
|
+
async getOutcomeStats(props) {
|
|
27
|
+
if (!props.tenantId) {
|
|
28
|
+
throw new BadDataException("Project ID is required");
|
|
29
|
+
}
|
|
30
|
+
const countForState = (state) => {
|
|
31
|
+
return this.countBy({
|
|
32
|
+
query: {
|
|
33
|
+
projectId: props.tenantId,
|
|
34
|
+
pullRequestState: state,
|
|
35
|
+
},
|
|
36
|
+
props,
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
/*
|
|
40
|
+
* CI-verified merged PRs (B4 Tier 1). Only Green and
|
|
41
|
+
* ExpectedFailureObserved count as verified — never NoCiConfigured,
|
|
42
|
+
* null, Pending or Red (G9: absence of CI reads as unverified).
|
|
43
|
+
*/
|
|
44
|
+
const countMergedWithCiStatus = (ciStatus) => {
|
|
45
|
+
return this.countBy({
|
|
46
|
+
query: {
|
|
47
|
+
projectId: props.tenantId,
|
|
48
|
+
pullRequestState: PullRequestState.Merged,
|
|
49
|
+
ciStatus: ciStatus,
|
|
50
|
+
},
|
|
51
|
+
props,
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const [open, merged, closedUnmerged, mergedCiGreen, mergedCiExpectedFail] = await Promise.all([
|
|
55
|
+
countForState(PullRequestState.Open),
|
|
56
|
+
countForState(PullRequestState.Merged),
|
|
57
|
+
countForState(PullRequestState.Closed),
|
|
58
|
+
countMergedWithCiStatus(FixPullRequestCiStatus.Green),
|
|
59
|
+
countMergedWithCiStatus(FixPullRequestCiStatus.ExpectedFailureObserved),
|
|
60
|
+
]);
|
|
61
|
+
const mergedCount = merged.toNumber();
|
|
62
|
+
const closedCount = closedUnmerged.toNumber();
|
|
63
|
+
const terminalCount = mergedCount + closedCount;
|
|
64
|
+
const verifiedGreenCount = mergedCiGreen.toNumber() + mergedCiExpectedFail.toNumber();
|
|
65
|
+
return {
|
|
66
|
+
total: open.toNumber() + terminalCount,
|
|
67
|
+
open: open.toNumber(),
|
|
68
|
+
merged: mergedCount,
|
|
69
|
+
closedUnmerged: closedCount,
|
|
70
|
+
acceptanceRatePercent: terminalCount === 0
|
|
71
|
+
? null
|
|
72
|
+
: Math.round((mergedCount / terminalCount) * 100),
|
|
73
|
+
verifiedGreen: verifiedGreenCount,
|
|
74
|
+
verifiedGreenRatePercent: mergedCount === 0
|
|
75
|
+
? null
|
|
76
|
+
: Math.round((verifiedGreenCount / mergedCount) * 100),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
7
79
|
}
|
|
80
|
+
__decorate([
|
|
81
|
+
CaptureSpan(),
|
|
82
|
+
__metadata("design:type", Function),
|
|
83
|
+
__metadata("design:paramtypes", [Object]),
|
|
84
|
+
__metadata("design:returntype", Promise)
|
|
85
|
+
], Service.prototype, "getOutcomeStats", null);
|
|
8
86
|
export default new Service();
|
|
9
87
|
//# sourceMappingURL=AIAgentTaskPullRequestService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIAgentTaskPullRequestService.js","sourceRoot":"","sources":["../../../../Server/Services/AIAgentTaskPullRequestService.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"AIAgentTaskPullRequestService.js","sourceRoot":"","sources":["../../../../Server/Services/AIAgentTaskPullRequestService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,oDAAoD,CAAC;AACvE,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AAEtE,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAC3E,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAE3E,OAAO,WAAW,MAAM,gCAAgC,CAAC;AA4BzD,MAAM,OAAO,OAAQ,SAAQ,eAAsB;IACjD;QACE,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED;;;;;OAKG;IAEU,AAAN,KAAK,CAAC,eAAe,CAC1B,KAAqC;QAErC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpB,MAAM,IAAI,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,aAAa,GAEY,CAC7B,KAAuB,EACE,EAAE;YAC3B,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,KAAK,EAAE;oBACL,SAAS,EAAE,KAAK,CAAC,QAAS;oBAC1B,gBAAgB,EAAE,KAAK;iBACxB;gBACD,KAAK;aACN,CAAC,CAAC;QACL,CAAC,CAAC;QAEF;;;;WAIG;QACH,MAAM,uBAAuB,GAEE,CAC7B,QAAgC,EACP,EAAE;YAC3B,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,KAAK,EAAE;oBACL,SAAS,EAAE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CAAC,GAAG,GAAG,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AA7Ec;IADZ,WAAW,EAAE;;;;8CA6Eb;AAGH,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import DatabaseService from "./DatabaseService";
|
|
11
|
+
import AIRunService from "./AIRunService";
|
|
12
|
+
import AIRunEventService from "./AIRunEventService";
|
|
13
|
+
import AIInsight from "../../Models/DatabaseModels/AIInsight";
|
|
14
|
+
import OneUptimeDate from "../../Types/Date";
|
|
15
|
+
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
16
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
17
|
+
import AIInsightStatus from "../../Types/AI/AIInsightStatus";
|
|
18
|
+
import AIInsightHumanVerdict from "../../Types/AI/AIInsightHumanVerdict";
|
|
19
|
+
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
20
|
+
/*
|
|
21
|
+
* Upper bound on triage-run events returned for one insight — mirrors the
|
|
22
|
+
* investigation panel's cap (AIInvestigationAPI MAX_EVENTS). The engine's
|
|
23
|
+
* per-run step budgets keep real trails far below this; the cap only
|
|
24
|
+
* bounds pathological rows.
|
|
25
|
+
*/
|
|
26
|
+
export const MAX_TRIAGE_RUN_EVENTS = 500;
|
|
27
|
+
export class Service extends DatabaseService {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(AIInsight);
|
|
30
|
+
}
|
|
31
|
+
/*
|
|
32
|
+
* Human verdict capture — this IS the G11 precision measurement:
|
|
33
|
+
* confirm/dismiss rates per insight type tell us how precise each
|
|
34
|
+
* deterministic detector is in the field and gate any future automation.
|
|
35
|
+
*
|
|
36
|
+
* Overwriting an existing verdict is deliberate — people change their
|
|
37
|
+
* minds; the latest verdict wins (per-insight state, not an audit trail).
|
|
38
|
+
* Dismissed is a human terminal state, so it also closes the insight;
|
|
39
|
+
* Confirmed leaves the status untouched (the insight stays open until a
|
|
40
|
+
* human resolves it or a fix lands).
|
|
41
|
+
*
|
|
42
|
+
* Callers must have already access-checked the insight under the USER's
|
|
43
|
+
* permissions — insight rows are server-authored (empty update ACL), so
|
|
44
|
+
* this writes as root.
|
|
45
|
+
*/
|
|
46
|
+
async applyHumanVerdict(data) {
|
|
47
|
+
await this.updateOneById({
|
|
48
|
+
id: data.insightId,
|
|
49
|
+
data: Object.assign({ humanVerdict: data.verdict, humanVerdictAt: OneUptimeDate.getCurrentDate(), humanVerdictByUserId: data.byUserId }, (data.verdict === AIInsightHumanVerdict.Dismissed
|
|
50
|
+
? { status: AIInsightStatus.Dismissed }
|
|
51
|
+
: {})),
|
|
52
|
+
props: { isRoot: true },
|
|
53
|
+
});
|
|
54
|
+
return { insightId: data.insightId, verdict: data.verdict };
|
|
55
|
+
}
|
|
56
|
+
/*
|
|
57
|
+
* Marks the insight handled. Resolving implies the finding was real, so
|
|
58
|
+
* when no verdict was recorded yet this also stamps Confirmed (+ at/by) —
|
|
59
|
+
* the G11 measurement should count a silently-fixed insight as a true
|
|
60
|
+
* positive. An existing verdict (either value) is left untouched:
|
|
61
|
+
* resolve is a lifecycle action, not a verdict change.
|
|
62
|
+
*
|
|
63
|
+
* Callers must have already access-checked the insight under the USER's
|
|
64
|
+
* permissions — this reads and writes as root.
|
|
65
|
+
*/
|
|
66
|
+
async resolveInsight(data) {
|
|
67
|
+
const insight = await this.findOneById({
|
|
68
|
+
id: data.insightId,
|
|
69
|
+
select: { _id: true, humanVerdict: true },
|
|
70
|
+
props: { isRoot: true },
|
|
71
|
+
});
|
|
72
|
+
if (!insight || !insight.id) {
|
|
73
|
+
throw new BadDataException("AI insight not found.");
|
|
74
|
+
}
|
|
75
|
+
await this.updateOneById({
|
|
76
|
+
id: insight.id,
|
|
77
|
+
data: Object.assign({ status: AIInsightStatus.Resolved }, (insight.humanVerdict
|
|
78
|
+
? {}
|
|
79
|
+
: {
|
|
80
|
+
humanVerdict: AIInsightHumanVerdict.Confirmed,
|
|
81
|
+
humanVerdictAt: OneUptimeDate.getCurrentDate(),
|
|
82
|
+
humanVerdictByUserId: data.byUserId,
|
|
83
|
+
})),
|
|
84
|
+
props: { isRoot: true },
|
|
85
|
+
});
|
|
86
|
+
return { insightId: insight.id, status: AIInsightStatus.Resolved };
|
|
87
|
+
}
|
|
88
|
+
/*
|
|
89
|
+
* Data for the dashboard's live triage panel: the insight's triage AIRun
|
|
90
|
+
* plus its ordered event trail. Triage runs are system-authored
|
|
91
|
+
* (userId = null) and therefore hidden by the per-user privacy pin on the
|
|
92
|
+
* generic AIRun / AIRunEvent CRUD — so, mirroring AIInvestigationAPI's
|
|
93
|
+
* sendLatestInvestigation, the run and events are read as root AFTER the
|
|
94
|
+
* caller has access-checked the insight under the USER's permissions.
|
|
95
|
+
*
|
|
96
|
+
* A missing insight (raced deletion) or an insight without a triage run
|
|
97
|
+
* (no LLM provider / no budget headroom at scan time) returns the empty
|
|
98
|
+
* shape — the panel renders an empty state, not an error.
|
|
99
|
+
*/
|
|
100
|
+
async getLatestTriageRunWithEvents(data) {
|
|
101
|
+
const insight = await this.findOneById({
|
|
102
|
+
id: data.insightId,
|
|
103
|
+
select: { _id: true, triageAiRunId: true },
|
|
104
|
+
props: { isRoot: true },
|
|
105
|
+
});
|
|
106
|
+
if (!insight || !insight.triageAiRunId) {
|
|
107
|
+
return { run: null, events: [] };
|
|
108
|
+
}
|
|
109
|
+
const run = await AIRunService.findOneById({
|
|
110
|
+
id: insight.triageAiRunId,
|
|
111
|
+
select: {
|
|
112
|
+
_id: true,
|
|
113
|
+
status: true,
|
|
114
|
+
startedAt: true,
|
|
115
|
+
completedAt: true,
|
|
116
|
+
errorMessage: true,
|
|
117
|
+
llmCallCount: true,
|
|
118
|
+
toolCallCount: true,
|
|
119
|
+
totalTokens: true,
|
|
120
|
+
createdAt: true,
|
|
121
|
+
},
|
|
122
|
+
props: { isRoot: true },
|
|
123
|
+
});
|
|
124
|
+
if (!run || !run.id) {
|
|
125
|
+
return { run: null, events: [] };
|
|
126
|
+
}
|
|
127
|
+
const events = await AIRunEventService.findBy({
|
|
128
|
+
query: { aiRunId: run.id },
|
|
129
|
+
select: {
|
|
130
|
+
_id: true,
|
|
131
|
+
sequence: true,
|
|
132
|
+
eventType: true,
|
|
133
|
+
toolName: true,
|
|
134
|
+
resultSummary: true,
|
|
135
|
+
createdAt: true,
|
|
136
|
+
},
|
|
137
|
+
sort: { sequence: SortOrder.Ascending },
|
|
138
|
+
limit: MAX_TRIAGE_RUN_EVENTS,
|
|
139
|
+
skip: 0,
|
|
140
|
+
props: { isRoot: true },
|
|
141
|
+
});
|
|
142
|
+
return { run, events };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
__decorate([
|
|
146
|
+
CaptureSpan(),
|
|
147
|
+
__metadata("design:type", Function),
|
|
148
|
+
__metadata("design:paramtypes", [Object]),
|
|
149
|
+
__metadata("design:returntype", Promise)
|
|
150
|
+
], Service.prototype, "applyHumanVerdict", null);
|
|
151
|
+
__decorate([
|
|
152
|
+
CaptureSpan(),
|
|
153
|
+
__metadata("design:type", Function),
|
|
154
|
+
__metadata("design:paramtypes", [Object]),
|
|
155
|
+
__metadata("design:returntype", Promise)
|
|
156
|
+
], Service.prototype, "resolveInsight", null);
|
|
157
|
+
__decorate([
|
|
158
|
+
CaptureSpan(),
|
|
159
|
+
__metadata("design:type", Function),
|
|
160
|
+
__metadata("design:paramtypes", [Object]),
|
|
161
|
+
__metadata("design:returntype", Promise)
|
|
162
|
+
], Service.prototype, "getLatestTriageRunWithEvents", null);
|
|
163
|
+
export default new Service();
|
|
164
|
+
//# sourceMappingURL=AIInsightService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AIInsightService.js","sourceRoot":"","sources":["../../../../Server/Services/AIInsightService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAI9D,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,SAAS,MAAM,oCAAoC,CAAC;AAC3D,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AACtE,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAC7D,OAAO,qBAAqB,MAAM,sCAAsC,CAAC;AACzE,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAW,GAAG,CAAC;AAEjD,MAAM,OAAO,OAAQ,SAAQ,eAA0B;IACrD;QACE,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IAEU,AAAN,KAAK,CAAC,iBAAiB,CAAC,IAI9B;QACC,MAAM,IAAI,CAAC,aAAa,CAAC;YACvB,EAAE,EAAE,IAAI,CAAC,SAAS;YAClB,IAAI,kBACF,YAAY,EAAE,IAAI,CAAC,OAAO,EAC1B,cAAc,EAAE,aAAa,CAAC,cAAc,EAAE,EAC9C,oBAAoB,EAAE,IAAI,CAAC,QAAQ,IAChC,CAAC,IAAI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f,QAAQ,EAAE,IAAI;gBACd,aAAa,EAAE,IAAI;gBACnB,SAAS,EAAE,IAAI;aAChB;YACD,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,SAAS,EAAE;YACvC,KAAK,EAAE,qBAAqB;YAC5B,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAC;QAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IACzB,CAAC;CACF;AAhIc;IADZ,WAAW,EAAE;;;;gDAoBb;AAaY;IADZ,WAAW,EAAE;;;;6CA+Bb;AAeY;IADZ,WAAW,EAAE;;;;2DAmDb;AAGH,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -11,10 +11,53 @@ import DatabaseService from "./DatabaseService";
|
|
|
11
11
|
import Model from "../../Models/DatabaseModels/AIRunEvent";
|
|
12
12
|
import { pinQueryToRequestingUser } from "../Utils/AI/AIChatPrivacyFilter";
|
|
13
13
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
14
|
+
import logger from "../Utils/Logger";
|
|
14
15
|
export class Service extends DatabaseService {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(Model);
|
|
17
18
|
}
|
|
19
|
+
/*
|
|
20
|
+
* Append one event to a run's glass-box trail, allocating the next
|
|
21
|
+
* sequence number from the run's current event count — the same idiom
|
|
22
|
+
* AIInvestigationEngine uses, factored out for callers that emit
|
|
23
|
+
* events one at a time (the code-fix agent's HTTP protocol) rather than
|
|
24
|
+
* holding a sequence counter across a whole in-process run.
|
|
25
|
+
*
|
|
26
|
+
* Best-effort: events are telemetry, so failures are logged and swallowed
|
|
27
|
+
* rather than failing the operation that produced them.
|
|
28
|
+
*/
|
|
29
|
+
async appendEventToRun(data) {
|
|
30
|
+
try {
|
|
31
|
+
const sequence = (await this.countBy({
|
|
32
|
+
query: { aiRunId: data.aiRunId },
|
|
33
|
+
props: { isRoot: true },
|
|
34
|
+
})).toNumber();
|
|
35
|
+
const event = new Model();
|
|
36
|
+
event.projectId = data.projectId;
|
|
37
|
+
event.aiRunId = data.aiRunId;
|
|
38
|
+
event.sequence = sequence;
|
|
39
|
+
event.eventType = data.eventType;
|
|
40
|
+
if (data.toolName) {
|
|
41
|
+
event.toolName = data.toolName;
|
|
42
|
+
}
|
|
43
|
+
if (data.toolArguments) {
|
|
44
|
+
event.toolArguments = data.toolArguments;
|
|
45
|
+
}
|
|
46
|
+
if (data.resultSummary) {
|
|
47
|
+
event.resultSummary = data.resultSummary;
|
|
48
|
+
}
|
|
49
|
+
if (data.citationId) {
|
|
50
|
+
event.citationId = data.citationId;
|
|
51
|
+
}
|
|
52
|
+
await this.create({
|
|
53
|
+
data: event,
|
|
54
|
+
props: { isRoot: true },
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
logger.error(`Failed to append AIRunEvent (${data.eventType}) to run ${data.aiRunId.toString()}: ${error}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
18
61
|
async onBeforeFind(findBy) {
|
|
19
62
|
findBy.query = pinQueryToRequestingUser(findBy.query, findBy.props, "userId");
|
|
20
63
|
return { findBy, carryForward: null };
|
|
@@ -24,6 +67,12 @@ export class Service extends DatabaseService {
|
|
|
24
67
|
return super.countBy(countBy);
|
|
25
68
|
}
|
|
26
69
|
}
|
|
70
|
+
__decorate([
|
|
71
|
+
CaptureSpan(),
|
|
72
|
+
__metadata("design:type", Function),
|
|
73
|
+
__metadata("design:paramtypes", [Object]),
|
|
74
|
+
__metadata("design:returntype", Promise)
|
|
75
|
+
], Service.prototype, "appendEventToRun", null);
|
|
27
76
|
__decorate([
|
|
28
77
|
CaptureSpan(),
|
|
29
78
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIRunEventService.js","sourceRoot":"","sources":["../../../../Server/Services/AIRunEventService.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
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Aa,GAAG,IAAI,CAAC,aAAa,CAAC;YAC3C,CAAC;YACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpB,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;YACrC,CAAC;YAED,MAAM,IAAI,CAAC,MAAM,CAAC;gBAChB,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;aACxB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CACV,gCAAgC,IAAI,CAAC,SAAS,YAAY,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,KAAK,EAAE,CAC9F,CAAC;QACJ,CAAC;IACH,CAAC;IAEkB,KAAK,CAAC,YAAY,CACnC,MAAqB;QAErB,MAAM,CAAC,KAAK,GAAG,wBAAwB,CACrC,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,EACZ,QAAQ,CACT,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IACxC,CAAC;IAGqB,AAAN,KAAK,CAAC,OAAO,CAC3B,OAAuB;QAEvB,OAAO,CAAC,KAAK,GAAG,wBAAwB,CACtC,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,QAAQ,CACT,CAAC;QACF,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;CACF;AArEc;IADZ,WAAW,EAAE;;;;+CA8Cb;AAcqB;IADrB,WAAW,EAAE;;;;sCAUb;AAGH,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -7,6 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
import OneUptimeDate from "../../Types/Date";
|
|
11
|
+
import AIRunStatus from "../../Types/AI/AIRunStatus";
|
|
12
|
+
import AIRunType from "../../Types/AI/AIRunType";
|
|
13
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
14
|
+
import CodeFixTaskType, { CodeFixContextKind, CodeFixTaskTypeHelper, } from "../../Types/AI/CodeFixTaskType";
|
|
15
|
+
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
16
|
+
import QueryHelper from "../Types/Database/QueryHelper";
|
|
10
17
|
import DatabaseService from "./DatabaseService";
|
|
11
18
|
import Model from "../../Models/DatabaseModels/AIRun";
|
|
12
19
|
import { pinQueryToRequestingUser } from "../Utils/AI/AIChatPrivacyFilter";
|
|
@@ -42,6 +49,202 @@ export class Service extends DatabaseService {
|
|
|
42
49
|
const result = await queryBuilder.execute();
|
|
43
50
|
return result.affected || 0;
|
|
44
51
|
}
|
|
52
|
+
/*
|
|
53
|
+
* Atomically claim the oldest Queued code-fix run for an external agent
|
|
54
|
+
* worker (the /ai-agent-task/get-pending-task route). The Queued -> Running
|
|
55
|
+
* transition is the same status+attemptCount-guarded CAS the investigation
|
|
56
|
+
* queue uses, so concurrent agents can never receive the same run. The
|
|
57
|
+
* returned run is already Running, heartbeated, and owned by the agent.
|
|
58
|
+
*
|
|
59
|
+
* A claimed run missing its recipe's trigger record cannot be executed —
|
|
60
|
+
* it is finalized as Error and the loop moves on to the next candidate.
|
|
61
|
+
* Which record that is depends on the recipe's context kind:
|
|
62
|
+
* exception-based recipes need triggeredByTelemetryExceptionId,
|
|
63
|
+
* ImproveInstrumentation / FixFromIncident run against the incident/alert
|
|
64
|
+
* whose investigation triggered them, and FixPerformance carries its
|
|
65
|
+
* trace evidence in taskContext (no subject row at all).
|
|
66
|
+
*/
|
|
67
|
+
async claimNextQueuedCodeFixRun(data) {
|
|
68
|
+
var _a;
|
|
69
|
+
const maxClaimAttempts = 5;
|
|
70
|
+
for (let attempt = 0; attempt < maxClaimAttempts; attempt++) {
|
|
71
|
+
const run = await this.findOneBy({
|
|
72
|
+
query: {
|
|
73
|
+
runType: AIRunType.CodeFix,
|
|
74
|
+
status: AIRunStatus.Queued,
|
|
75
|
+
},
|
|
76
|
+
sort: {
|
|
77
|
+
createdAt: SortOrder.Ascending,
|
|
78
|
+
},
|
|
79
|
+
select: {
|
|
80
|
+
_id: true,
|
|
81
|
+
projectId: true,
|
|
82
|
+
triggeredByTelemetryExceptionId: true,
|
|
83
|
+
triggeredByIncidentId: true,
|
|
84
|
+
triggeredByAlertId: true,
|
|
85
|
+
attemptCount: true,
|
|
86
|
+
codeFixTaskType: true,
|
|
87
|
+
taskContext: true,
|
|
88
|
+
},
|
|
89
|
+
props: {
|
|
90
|
+
isRoot: true,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
if (!run || !run.id) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const claimedCount = await this.attemptStatusTransition({
|
|
97
|
+
aiRunId: run.id,
|
|
98
|
+
fromStatus: AIRunStatus.Queued,
|
|
99
|
+
expectedAttemptCount: run.attemptCount || 0,
|
|
100
|
+
set: {
|
|
101
|
+
status: AIRunStatus.Running,
|
|
102
|
+
startedAt: OneUptimeDate.getCurrentDate(),
|
|
103
|
+
lastHeartbeatAt: OneUptimeDate.getCurrentDate(),
|
|
104
|
+
attemptCount: (run.attemptCount || 0) + 1,
|
|
105
|
+
aiAgentId: data.aiAgentId.toString(),
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
if (claimedCount === 0) {
|
|
109
|
+
// Another agent won this run — try the next candidate.
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
/*
|
|
113
|
+
* Normalize the task recipe BEFORE the executability guard: a null
|
|
114
|
+
* codeFixTaskType means FixException (rows created before task
|
|
115
|
+
* recipes existed), the worker dispatches on this value, and the
|
|
116
|
+
* guard below is recipe-dependent.
|
|
117
|
+
*/
|
|
118
|
+
run.codeFixTaskType = CodeFixTaskTypeHelper.fromDatabaseValue(run.codeFixTaskType);
|
|
119
|
+
/*
|
|
120
|
+
* Recipe-dependent executability guard, grouped by the recipe's
|
|
121
|
+
* context kind: exception-based recipes are unexecutable without
|
|
122
|
+
* their telemetry exception; recipes whose subject is an
|
|
123
|
+
* incident/alert (ImproveInstrumentation, FixFromIncident)
|
|
124
|
+
* legitimately carry NO exception id; and FixPerformance carries
|
|
125
|
+
* neither — its trace evidence lives in taskContext. Rejecting a
|
|
126
|
+
* kind for lacking another kind's record would Error every run its
|
|
127
|
+
* trigger enqueues.
|
|
128
|
+
*/
|
|
129
|
+
const contextKind = CodeFixTaskTypeHelper.getContextKind(run.codeFixTaskType);
|
|
130
|
+
let missingContextMessage = null;
|
|
131
|
+
if (contextKind === CodeFixContextKind.TelemetryException) {
|
|
132
|
+
missingContextMessage = run.triggeredByTelemetryExceptionId
|
|
133
|
+
? null
|
|
134
|
+
: "Queued code-fix run has no telemetry exception to fix.";
|
|
135
|
+
}
|
|
136
|
+
else if (contextKind === CodeFixContextKind.IncidentOrAlertSubject) {
|
|
137
|
+
missingContextMessage =
|
|
138
|
+
run.triggeredByIncidentId || run.triggeredByAlertId
|
|
139
|
+
? null
|
|
140
|
+
: "Queued code-fix run has no incident or alert subject.";
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
missingContextMessage = ((_a = run.taskContext) === null || _a === void 0 ? void 0 : _a.traceId)
|
|
144
|
+
? null
|
|
145
|
+
: "Queued code-fix run has no trace evidence in its task context.";
|
|
146
|
+
}
|
|
147
|
+
if (missingContextMessage) {
|
|
148
|
+
await this.attemptStatusTransition({
|
|
149
|
+
aiRunId: run.id,
|
|
150
|
+
fromStatus: AIRunStatus.Running,
|
|
151
|
+
set: {
|
|
152
|
+
status: AIRunStatus.Error,
|
|
153
|
+
completedAt: OneUptimeDate.getCurrentDate(),
|
|
154
|
+
errorMessage: missingContextMessage,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
return run;
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
/*
|
|
164
|
+
* The latest CodeFix run of EACH task recipe for an exception — at most
|
|
165
|
+
* one run per CodeFixTaskType, newest first (so the first element is the
|
|
166
|
+
* latest run overall). Backs /telemetry-exception/get-ai-agent-task: the
|
|
167
|
+
* exception page must show a FixException run and a WriteRegressionTest
|
|
168
|
+
* run side by side, not just whichever was created last.
|
|
169
|
+
*
|
|
170
|
+
* codeFixTaskType is normalized on the returned models: legacy null rows
|
|
171
|
+
* come back as FixException.
|
|
172
|
+
*/
|
|
173
|
+
async getLatestCodeFixRunPerTaskType(data) {
|
|
174
|
+
const taskTypes = Object.values(CodeFixTaskType);
|
|
175
|
+
const latestRuns = await Promise.all(taskTypes.map((taskType) => {
|
|
176
|
+
return this.findOneBy({
|
|
177
|
+
query: {
|
|
178
|
+
runType: AIRunType.CodeFix,
|
|
179
|
+
triggeredByTelemetryExceptionId: data.telemetryExceptionId,
|
|
180
|
+
// Null means FixException — see the class comment above.
|
|
181
|
+
codeFixTaskType: taskType === CodeFixTaskType.FixException
|
|
182
|
+
? QueryHelper.equalToOrNull(CodeFixTaskType.FixException)
|
|
183
|
+
: taskType,
|
|
184
|
+
},
|
|
185
|
+
select: {
|
|
186
|
+
_id: true,
|
|
187
|
+
status: true,
|
|
188
|
+
errorMessage: true,
|
|
189
|
+
createdAt: true,
|
|
190
|
+
codeFixTaskType: true,
|
|
191
|
+
},
|
|
192
|
+
sort: {
|
|
193
|
+
createdAt: SortOrder.Descending,
|
|
194
|
+
},
|
|
195
|
+
props: {
|
|
196
|
+
isRoot: true,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
}));
|
|
200
|
+
const runs = latestRuns.filter((run) => {
|
|
201
|
+
return Boolean(run);
|
|
202
|
+
});
|
|
203
|
+
for (const run of runs) {
|
|
204
|
+
run.codeFixTaskType = CodeFixTaskTypeHelper.fromDatabaseValue(run.codeFixTaskType);
|
|
205
|
+
}
|
|
206
|
+
runs.sort((a, b) => {
|
|
207
|
+
var _a, _b;
|
|
208
|
+
return (((_a = b.createdAt) === null || _a === void 0 ? void 0 : _a.getTime()) || 0) - (((_b = a.createdAt) === null || _b === void 0 ? void 0 : _b.getTime()) || 0);
|
|
209
|
+
});
|
|
210
|
+
return runs;
|
|
211
|
+
}
|
|
212
|
+
/*
|
|
213
|
+
* Measurement layer (Phase 2): record a human's one-click verdict
|
|
214
|
+
* (Confirmed / Rejected) on the LATEST COMPLETED investigation run for an
|
|
215
|
+
* incident or alert. Overwriting an existing verdict is deliberate — a
|
|
216
|
+
* user may change their mind; the verdict is per-run state, not an audit
|
|
217
|
+
* trail. Throws when no completed investigation exists for the subject.
|
|
218
|
+
* Callers must have already access-checked the subject under the USER's
|
|
219
|
+
* permissions — this method reads and writes as root (investigation runs
|
|
220
|
+
* are system-authored, so the per-user privacy pin would hide them).
|
|
221
|
+
*/
|
|
222
|
+
async applyHumanVerdictToLatestInvestigation(data) {
|
|
223
|
+
if (!data.incidentId && !data.alertId) {
|
|
224
|
+
throw new BadDataException("An incident or alert subject is required to record a verdict.");
|
|
225
|
+
}
|
|
226
|
+
const run = await this.findOneBy({
|
|
227
|
+
query: Object.assign({ runType: AIRunType.Investigation, status: AIRunStatus.Completed }, (data.incidentId
|
|
228
|
+
? { triggeredByIncidentId: data.incidentId }
|
|
229
|
+
: { triggeredByAlertId: data.alertId })),
|
|
230
|
+
select: { _id: true },
|
|
231
|
+
sort: { createdAt: SortOrder.Descending },
|
|
232
|
+
props: { isRoot: true },
|
|
233
|
+
});
|
|
234
|
+
if (!run || !run.id) {
|
|
235
|
+
throw new BadDataException("No completed AI investigation exists for this subject yet — a verdict can only be recorded on a completed investigation.");
|
|
236
|
+
}
|
|
237
|
+
await this.updateOneById({
|
|
238
|
+
id: run.id,
|
|
239
|
+
data: {
|
|
240
|
+
humanVerdict: data.verdict,
|
|
241
|
+
humanVerdictAt: OneUptimeDate.getCurrentDate(),
|
|
242
|
+
humanVerdictByUserId: data.verdictByUserId,
|
|
243
|
+
},
|
|
244
|
+
props: { isRoot: true },
|
|
245
|
+
});
|
|
246
|
+
return { runId: run.id, verdict: data.verdict };
|
|
247
|
+
}
|
|
45
248
|
async onBeforeFind(findBy) {
|
|
46
249
|
findBy.query = pinQueryToRequestingUser(findBy.query, findBy.props, "userId");
|
|
47
250
|
return { findBy, carryForward: null };
|
|
@@ -57,6 +260,24 @@ __decorate([
|
|
|
57
260
|
__metadata("design:paramtypes", [Object]),
|
|
58
261
|
__metadata("design:returntype", Promise)
|
|
59
262
|
], Service.prototype, "attemptStatusTransition", null);
|
|
263
|
+
__decorate([
|
|
264
|
+
CaptureSpan(),
|
|
265
|
+
__metadata("design:type", Function),
|
|
266
|
+
__metadata("design:paramtypes", [Object]),
|
|
267
|
+
__metadata("design:returntype", Promise)
|
|
268
|
+
], Service.prototype, "claimNextQueuedCodeFixRun", null);
|
|
269
|
+
__decorate([
|
|
270
|
+
CaptureSpan(),
|
|
271
|
+
__metadata("design:type", Function),
|
|
272
|
+
__metadata("design:paramtypes", [Object]),
|
|
273
|
+
__metadata("design:returntype", Promise)
|
|
274
|
+
], Service.prototype, "getLatestCodeFixRunPerTaskType", null);
|
|
275
|
+
__decorate([
|
|
276
|
+
CaptureSpan(),
|
|
277
|
+
__metadata("design:type", Function),
|
|
278
|
+
__metadata("design:paramtypes", [Object]),
|
|
279
|
+
__metadata("design:returntype", Promise)
|
|
280
|
+
], Service.prototype, "applyHumanVerdictToLatestInvestigation", null);
|
|
60
281
|
__decorate([
|
|
61
282
|
CaptureSpan(),
|
|
62
283
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIRunService.js","sourceRoot":"","sources":["../../../../Server/Services/AIRunService.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AIRunService.js","sourceRoot":"","sources":["../../../../Server/Services/AIRunService.ts"],"names":[],"mappings":";;;;;;;;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