feat(l1): flywheel capture on resolve + engineer notification on escalate

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 20:49:28 -04:00
parent 68a4b99246
commit 80771b86b1
4 changed files with 116 additions and 0 deletions

View File

@@ -381,6 +381,7 @@ def _build_notification_title(event: str, payload: dict[str, Any]) -> str:
"proposal.pending": "New flow proposal: {title}",
"proposal.approved": "Flow proposal approved: {title}",
"knowledge_gap.detected": "Knowledge gap detected: {gap_type}",
"l1.session.escalated": "L1 session escalated: {problem_summary}",
"test": "Test Notification from ResolutionFlow",
}
@@ -415,6 +416,7 @@ def _build_notification_body(event: str, payload: dict[str, Any]) -> str:
"proposal.pending": "A new flow proposal \"{title}\" is awaiting review in the review queue.",
"proposal.approved": "The flow proposal \"{title}\" has been approved and is ready for use.",
"knowledge_gap.detected": "A {gap_type} knowledge gap has been identified. Review recommended.",
"l1.session.escalated": "L1 escalated a ticket: {problem_summary}",
"test": "This is a test notification to verify your notification channel is working correctly.",
}
template = bodies.get(event, f"Event: {event}")
@@ -437,6 +439,9 @@ def _build_notification_link(event: str, payload: dict[str, Any]) -> Optional[st
"proposal.pending": "/review-queue",
"proposal.approved": "/review-queue",
"knowledge_gap.detected": "/analytics/flowpilot",
# L1 AI-build escalations go to the escalations dashboard — not to
# a specific pilot session, which may not have a pickup flow.
"l1.session.escalated": "/escalations",
}
template = links.get(event)
if template is None: