Hmm, the user wants an automated postmortem quality reviewer combining NLP heuristics, completeness scoring, and coaching loops. This is a structured technical request with clear components.
I need to design a system that's modular yet integrated. The core should be a scoring engine with weighted criteria, plus an NLP layer for text analysis. The coaching feedback loops require dynamic generation based on detected gaps.
First, I'll define the scoring taxonomy - completeness, root cause analysis, action items, and clarity. Each needs measurable sub-metrics. The NLP heuristics will feed into these scores. For coaching, I'll map deficiencies to specific feedback templates and improvement suggestions.
The implementation should be pipeline-style: raw text → NLP extraction → scoring → feedback synthesis. Need to emphasize explainability - the user should understand why scores are assigned. Also important to make it extensible for different incident types.
I'll structure the response with: 1) System architecture overview, 2) Scoring taxonomy details, 3) NLP heuristic examples, 4) Coaching loop mechanics, 5) Implementation considerations. Should include concrete pseudo-code snippets to demonstrate logic flow. The tone must stay technical but accessible, avoiding vague claims about "AI magic."
feedback_templates:
missing_timeline:
condition: "timeline_section.score < 50"
message: |
⏱️ **Timeline Incomplete**
• Detection → Mitigation gap unclear
• Add: Exact timestamps (ISO 8601)
• Include: Communications sent, escalations triggered
weak_rca:
condition: "rca.why_depth < 3"
message: |
🔍 **Deepen Your Root Cause Analysis**
Try the 5 Whys technique:
1. Why did failure occur? → <current answer>
2. Why did THAT happen? → [you fill]
3. Continue until process/system cause found
no_customer_impact:
condition: "impact.customers == 0"
message: |
👥 **Customer Impact Missing**
Even internal incidents affect customers indirectly.
Ask: "Which downstream teams/services were affected?"
Estimate: Users impacted, revenue impact, trust impact
unassigned_actions:
condition: "action_items.unassigned > 0"
message: |
👤 **Action Items Need Owners**
Every action must have:
• Single accountable person (not "team")
• Specific due date (no "soon")
• Measurable completion criteria
Progressive Coaching Tiers
python
def get_coaching_level(previous_scores):
"""
Adjust feedback strictness based on user history
"""
if not previous_scores:
return "BEGINNER" # Detailed templates, examples
avg_previous = sum(previous_scores) / len(previous_scores)
if avg_previous < 60:
return "DEVELOPING" # More examples, walkthroughs
elif avg_previous < 80:
return "PROFICIENT" # Concise, focus on gaps
else:
return "EXPERT" # Only major issues, advanced patterns
4. Implementation Example
Input Postmortem (Snippet)
markdown
## Incident Summary
- Started: 2pm yesterday
- Ended: 4pm yesterday
- Severity: P2
- Service: Payment API
## Timeline
- 2:05pm: Alerts fired
- 2:30pm: Team noticed
- 3pm: Fixed
## Root Cause
DB connection pool exhausted due to high load.
## Action Items
- Increase connection pool size
- Add monitoring
Reviewer Output
json
{
"quality_score": 62,
"section_scores": {
"incident_summary": 100,
"timeline": 40,
"root_cause": 75,
"impact_assessment": 0,
"action_items": 50,
"lessons_learned": 0
},
"critical_gaps": [
"❌ No customer impact assessment",
"❌ No stakeholder sign-off section",
"❌ Action items lack owners/due dates"
],
"heuristic_flags": [
{
"type": "temporal_inconsistency",
"evidence": "Mitigation time (3pm) before detection time (2:05pm)?",
"severity": "high"
},
{
"type": "shallow_rca",
"evidence": "Only 1 'why' in RCA (DB pool exhausted)",
"suggestion": "Apply 5 Whys: Why pool exhausted? → Queries slow? Why? → Missing index?",
"severity": "medium"
}
],
"coaching_feedback": [
{
"priority": 1,
"section": "impact_assessment",
"template": "missing_customer_impact",
"custom_guidance": "For payment API outage: 1) Estimate failed transactions 2) Check support tickets 3) Calculate revenue impact"
},
{
"priority": 2,
"section": "action_items",
"template": "unassigned_actions",
"custom_guidance": "Convert to: 'John Doe by 2024-01-15: Increase pool to 50, verify load test passes'"
}
],
"next_steps": [
"1. Add 'Impact Assessment' section with customer metrics",
"2. Assign each action item with DRI and due date",
"3. Expand RCA with 2-3 additional 'why' layers",
"4. Get sign-off from: Legal, Support, Product"
]
}
def create_improvement_tickets(review_result):
"""Auto-create action items from gaps"""
for gap in review_result['critical_gaps']:
jira.create_issue(
project='POSTMORTEM',
summary=f"Fix: {gap}",
description=generate_coaching_instructions(gap),
priority='Medium',
assignee=get_team_lead('platform')
)
6. Advanced Features (Optional)
Similarity Matching
python
# Find similar past incidents to compare RCA quality
def find_similar_incidents(current_rca, historical_postmortems):
embeddings = sentence_transformer.encode([current_rca] + historical_postmortems)
similarities = cosine_similarity(embeddings[0:1], embeddings[1:])
top_3 = np.argsort(similarities[0])[-3:]
return [historical_postmortems[i] for i in top_3]
SLA Compliance Checker
python
def check_sla_compliance(postmortem_date, incident_end_date):
"""
Validate publication timelines
"""
days_late = (postmortem_date - incident_end_date).days
sla_map = {
'Severity 1': 3,
'Severity 2': 5,
'Severity 3': 10
}
if days_late > sla_map[severity]:
return f"⚠️ {days_late} days past SLA ({sla_map[severity]} days max)"
return "✅ Within SLA"