Bug FIx: Issue Changes After Validation#35
Bug FIx: Issue Changes After Validation#35shekhar316 wants to merge 6 commits intocausaai:poc-mar26from
Conversation
Signed-off-by: Shekhar Saxena <shekhar.saxena@ibm.com>
Signed-off-by: bharathappali <abharath@redhat.com>
Signed-off-by: bharathappali <abharath@redhat.com>
Signed-off-by: Shekhar Saxena <shekhar.saxena@ibm.com>
Signed-off-by: Shekhar Saxena <shekhar.saxena@ibm.com>
Reviewer's GuideImplements structured RCA output parsing and partial report storage to prevent RCA issue text from changing after validation, and updates the UI to present a new side‑by‑side RCA overview with severity/evidence metadata and simplified evidence/logs tabs. Sequence diagram for RCA analysis with partial report storage and validationsequenceDiagram
actor User
participant DashboardUI
participant AnalysisTrackingService
participant RcaOrchestrator
participant RootCauseAnalyst
participant ValidationPipeline as Validation_and_Assertion_Components
User->>DashboardUI: Start analysis for pod
DashboardUI->>AnalysisTrackingService: createSession
AnalysisTrackingService-->>DashboardUI: sessionId
DashboardUI->>RcaOrchestrator: runAnalysisInternal(sessionId, namespace, podName)
RcaOrchestrator->>AnalysisTrackingService: recordStageStart(sessionId, rca_analysis)
RcaOrchestrator->>AnalysisTrackingService: updateStatus(ANALYZING_RCA)
RcaOrchestrator->>RootCauseAnalyst: analyzeRootCause(anomalyType, llmContext)
RootCauseAnalyst-->>RcaOrchestrator: rcaOutput
RcaOrchestrator->>RcaOrchestrator: extractRootCauseTitle(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: extractRootCause(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: extractKeyEvidence(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: extractSupportedLogs(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: extractSeverity(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: extractSupportingEvidenceBullets(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: extractObservableSymptoms(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: extractAffectedServices(rcaOutput)
RcaOrchestrator->>RcaOrchestrator: build partialReport (Map)
RcaOrchestrator->>RcaOrchestrator: map partialReport JSON to RcaReport
RcaOrchestrator->>AnalysisTrackingService: storePartialReport(sessionId, partialRcaReport)
AnalysisTrackingService-->>RcaOrchestrator: ack
AnalysisTrackingService-->>DashboardUI: websocket update with partial RcaReport
DashboardUI->>DashboardUI: render RCA overview grid
RcaOrchestrator->>AnalysisTrackingService: recordStageEnd(sessionId, rca_analysis)
RcaOrchestrator->>AnalysisTrackingService: recordStageStart(sessionId, validation)
RcaOrchestrator->>AnalysisTrackingService: updateStatus(VALIDATING)
RcaOrchestrator->>ValidationPipeline: run validation and evidence matching
ValidationPipeline-->>RcaOrchestrator: finalAssertions, finalDecision, finalStatus
RcaOrchestrator->>RcaOrchestrator: reuse evidence, supportedLogs, severity, bullets, symptoms, affectedServices
RcaOrchestrator->>RcaOrchestrator: build finalReport (Map)
RcaOrchestrator->>RcaOrchestrator: map finalReport JSON to RcaReport
RcaOrchestrator->>AnalysisTrackingService: markCompleted(sessionId, finalRcaReport)
AnalysisTrackingService-->>DashboardUI: websocket update with final RcaReport
DashboardUI->>DashboardUI: update RCA overview and evidence sections
Class diagram for updated RCA reporting and analysis componentsclassDiagram
class RcaOrchestrator {
-ObjectMapper mapper
+void runAnalysisInternal(String sessionId, String namespace, String podName)
-String extractRootCauseTitle(String rcaOutput)
-String extractRootCause(String rcaOutput)
-List~String~ extractSupportedLogs(String rcaOutput)
-String extractKeyEvidence(String rcaOutput)
-String extractSeverity(String rcaOutput)
-List~String~ extractSupportingEvidenceBullets(String rcaOutput)
-List~String~ extractObservableSymptoms(String rcaOutput)
-List~String~ extractAffectedServices(String rcaOutput)
-String parseGcAnomalyType(String raw)
-String extractAnomalyExplanation(String rawResponse)
-String extractGcExplanation(String rawResponse)
}
class AnalysisTrackingService {
-RcaAnalysisSessionRepository repository
+boolean storeArtifacts(String sessionId, CollectedArtifacts artifacts)
+boolean storePartialReport(String sessionId, RcaReport report)
+boolean markCompleted(String sessionId, RcaReport report)
+void recordStageStart(String sessionId, String stage)
+void recordStageEnd(String sessionId, String stage)
+void updateStatus(String sessionId, AnalysisStatus status, String message)
}
class RcaReport {
+String title
+String issue
+String highLevelIssue
+String subLevelIssue
+String evidence
+List~String~ supportedLogs
+List~String~ validationChecks
+List~AssertionItem~ assertions
+FinalDecision finalDecision
+String severity
+String confidenceLevel
+List~String~ supportingEvidenceBullets
+List~String~ observableSymptoms
+List~String~ affectedServices
+RcaReport()
}
class RootCauseAnalyst {
<<interface>>
+String analyzeRootCause(String anomalyType, String llmContext)
}
class GcPauseDetector {
<<interface>>
+String detectGcPause(String summarizedLogs)
}
class EvidenceMatcherAgent {
<<interface>>
+String matchEvidence(String rootCause, String logs)
}
class RcaAssertionExtractor {
<<interface>>
+String extractAssertions(String rootCause)
}
RcaOrchestrator --> RootCauseAnalyst : uses
RcaOrchestrator --> GcPauseDetector : uses
RcaOrchestrator --> AnalysisTrackingService : uses
AnalysisTrackingService --> RcaReport : stores
RcaOrchestrator --> RcaReport : builds
RcaOrchestrator --> EvidenceMatcherAgent : uses
RcaOrchestrator --> RcaAssertionExtractor : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- In
analysisDetails.htmlthe Evidence tab section headers and content appear swapped: the section titled "Supported Logs" renders{session.report.evidence}while the section titled "Evidence" renders the supported logs list, which is likely confusing and should be corrected so labels match their content. - The new RCA parsing helpers in
RcaOrchestrator(e.g.,extractSupportedLogs,extractKeyEvidence,extractSupportingEvidenceBullets, etc.) rely on double-newline or specific header patterns as section delimiters; consider relaxing these regex lookaheads to also handle headers that appear after a single newline or with minor formatting differences to make the extraction more robust to LLM output variability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `analysisDetails.html` the Evidence tab section headers and content appear swapped: the section titled "Supported Logs" renders `{session.report.evidence}` while the section titled "Evidence" renders the supported logs list, which is likely confusing and should be corrected so labels match their content.
- The new RCA parsing helpers in `RcaOrchestrator` (e.g., `extractSupportedLogs`, `extractKeyEvidence`, `extractSupportingEvidenceBullets`, etc.) rely on double-newline or specific header patterns as section delimiters; consider relaxing these regex lookaheads to also handle headers that appear after a single newline or with minor formatting differences to make the extraction more robust to LLM output variability.
## Individual Comments
### Comment 1
<location path="src/main/resources/templates/analysisDetails.html" line_range="250-253" />
<code_context>
- <div id="supported-logs-text" style="display:none;">{#for log in session.report.supportedLogs}{log}
- {/for}</div>
+ <!-- Evidence Section -->
+ <section class="details-section">
+ <div class="section-header">
+ <h2 class="section-title">
+ <span>Supported Logs</span>
+ <button class="btn-copy-icon" onclick="copySection('evidence-section')" title="Copy Evidence">📋</button>
+ </h2>
</code_context>
<issue_to_address>
**issue (bug_risk):** Evidence section heading and content are mismatched and the copy button targets a non-existent element id.
This section is titled "Supported Logs" but renders `session.report.evidence`, and the copy button calls `copySection('evidence-section')` even though this `<section>` no longer has that id. This will confuse users and break copy-to-clipboard. Please either align the heading with the evidence content and restore `id="evidence-section"`, or update the copySection target to match the actual DOM id you intend to copy from.
</issue_to_address>
### Comment 2
<location path="src/main/resources/templates/analysisDetails.html" line_range="262-267" />
<code_context>
- <!-- Evidence Section -->
- <section class="details-section">
+ <!-- Supported Logs Section -->
+ {#if session.report.supportedLogs && !session.report.supportedLogs.isEmpty()}
+ <section class="details-section" id="supported-logs-section">
<div class="section-header">
<h2 class="section-title">
<span>Evidence</span>
- <button class="btn-copy-icon" onclick="copySection('evidence-section')" title="Copy Evidence">📋</button>
+ <button class="btn-copy-icon" onclick="copySection('supported-logs-section')" title="Copy Supported Logs">📋</button>
</code_context>
<issue_to_address>
**issue:** Supported logs section is labeled "Evidence", which inverts the two evidence-related headings.
This section’s heading says “Evidence” but the content is the supported logs list. Together with the previous section (where “Supported Logs” shows the evidence text), the headings appear swapped. Please swap/align the titles so “Evidence” contains the explanation and “Supported Logs” contains the logs to avoid UI confusion.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| <section class="details-section"> | ||
| <div class="section-header"> | ||
| <h2 class="section-title"> | ||
| <span>Supported Logs</span> |
There was a problem hiding this comment.
issue (bug_risk): Evidence section heading and content are mismatched and the copy button targets a non-existent element id.
This section is titled "Supported Logs" but renders session.report.evidence, and the copy button calls copySection('evidence-section') even though this <section> no longer has that id. This will confuse users and break copy-to-clipboard. Please either align the heading with the evidence content and restore id="evidence-section", or update the copySection target to match the actual DOM id you intend to copy from.
| <!-- Supported Logs Section --> | ||
| {#if session.report.supportedLogs && !session.report.supportedLogs.isEmpty()} | ||
| <section class="details-section" id="supported-logs-section"> | ||
| <div class="section-header"> | ||
| <h2 class="section-title"> | ||
| <span>Evidence</span> |
There was a problem hiding this comment.
issue: Supported logs section is labeled "Evidence", which inverts the two evidence-related headings.
This section’s heading says “Evidence” but the content is the supported logs list. Together with the previous section (where “Supported Logs” shows the evidence text), the headings appear swapped. Please swap/align the titles so “Evidence” contains the explanation and “Supported Logs” contains the logs to avoid UI confusion.
|
@dinogun could we please review this and merge it into the poc-mar26 branch? Thanks. |
This PR fixes the issues -
That RCA issue was changed after validation step.
This PR is based on PR#33 and PR#34
Summary by Sourcery
Refine RCA analysis pipeline to extract structured fields from LLM output, store a partial RCA report before validation, and present a new side‑by‑side RCA overview UI, while simplifying evidence/logs tabs and extending the report model accordingly.
New Features:
Bug Fixes:
Enhancements: