feat(awooop): surface source evidence review work items
All checks were successful
Code Review / ai-code-review (push) Successful in 12s
CD Pipeline / tests (push) Successful in 4m6s
CD Pipeline / build-and-deploy (push) Successful in 4m8s
CD Pipeline / post-deploy-checks (push) Successful in 1m57s

This commit is contained in:
Your Name
2026-05-21 08:54:45 +08:00
parent a2cbf9e328
commit cf8bb364a3
8 changed files with 324 additions and 20 deletions

View File

@@ -68,6 +68,7 @@ type RecurrenceRepairStatus =
| "manual_gate"
| "investigating"
| "run_completed_no_repair"
| "source_correlation_review"
| "no_repair_record";
interface RemediationSummary {
@@ -203,6 +204,7 @@ interface EventRecurrenceSummary {
manual_gate_group_total?: number;
automation_gap_group_total?: number;
failed_repair_group_total?: number;
source_correlation_review_group_total?: number;
latest_received_at?: string | null;
}
@@ -246,6 +248,7 @@ interface EventRecurrenceItem {
namespace?: string | null;
target_resource?: string | null;
fingerprint?: string | null;
latest_stage?: string | null;
latest_event_id?: string | null;
latest_provider_event_id?: string | null;
latest_content_preview?: string | null;
@@ -264,6 +267,7 @@ interface EventRecurrenceItem {
sentry_ref_total: number;
signoz_ref_total: number;
alert_ref_total: number;
stage_counts: Record<string, number>;
run_state_counts: Record<string, number>;
first_received_at?: string | null;
latest_received_at?: string | null;
@@ -1047,6 +1051,7 @@ function recurrenceRepairStatusLabelKey(status?: string | null) {
status === "manual_gate" ||
status === "investigating" ||
status === "run_completed_no_repair" ||
status === "source_correlation_review" ||
status === "no_repair_record"
) {
return `repairStatuses.${status}`;
@@ -1103,6 +1108,16 @@ function EventRecurrencePanel({
detail: t("details.verifiedRepair", { count: summary?.verified_repair_group_total ?? 0 }),
className: "border-[#b9a6d9] bg-[#f5f0ff] text-[#51358f]",
},
{
label: t("metrics.sourceReview"),
value: summary?.source_correlation_review_group_total ?? 0,
detail: t("details.sourceReview", {
count: summary?.source_correlation_review_group_total ?? 0,
}),
className: (summary?.source_correlation_review_group_total ?? 0) > 0
? "border-[#d9b36f] bg-[#fff7e8] text-[#8a5a08]"
: "border-[#9bc7a4] bg-[#f0faf2] text-[#17602a]",
},
{
label: t("metrics.openWorkItems"),
value: summary?.open_work_item_group_total ?? 0,
@@ -1134,7 +1149,7 @@ function EventRecurrencePanel({
</div>
) : (
<>
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-2 xl:grid-cols-6">
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-2 xl:grid-cols-7">
{metrics.map((item) => (
<div key={item.label} className="bg-white px-4 py-3">
<div className="flex items-start justify-between gap-3">
@@ -1204,6 +1219,7 @@ function EventRecurrencePanel({
<p>{t("item.duplicates", { count: item.duplicate_total })}</p>
<p>{t("item.refs", { count: item.source_ref_total })}</p>
<p>{t("item.linkedRuns", { count: item.linked_run_total })}</p>
<p>{t("item.stage", { stage: item.latest_stage || "--" })}</p>
<p>{t("item.incident", { incidentId: item.latest_incident_id || "--" })}</p>
<p>{t("item.repair", { status: repairLabel })}</p>
</div>

View File

@@ -114,11 +114,16 @@ type RecurrenceItem = {
severity?: string | null;
namespace?: string | null;
target_resource?: string | null;
latest_stage?: string | null;
latest_provider_event_id?: string | null;
latest_run_id?: string | null;
latest_run_state?: string | null;
latest_incident_id?: string | null;
occurrence_total: number;
duplicate_total: number;
source_ref_total?: number;
sentry_ref_total?: number;
signoz_ref_total?: number;
repair_summary?: {
status?: string | null;
latest_auto_repair_id?: string | null;
@@ -142,6 +147,7 @@ type RecurrenceResponse = {
manual_gate_group_total?: number;
automation_gap_group_total?: number;
failed_repair_group_total?: number;
source_correlation_review_group_total?: number;
};
items: RecurrenceItem[];
};
@@ -170,6 +176,8 @@ type RecurrenceWorkItemActionResult = {
occurrence_total?: number | null;
duplicate_total?: number | null;
linked_run_total?: number | null;
latest_stage?: string | null;
latest_provider_event_id?: string | null;
} | null;
ticket_preview?: {
would_create?: boolean | null;
@@ -543,6 +551,7 @@ function recurrenceRepairStatusKey(status?: string | null) {
status === "manual_gate" ||
status === "investigating" ||
status === "run_completed_no_repair" ||
status === "source_correlation_review" ||
status === "no_repair_record"
) {
return status;
@@ -892,6 +901,8 @@ function buildWorkItems(
const recurrenceAutomationGap = recurrenceSummary?.automation_gap_group_total ?? 0;
const recurrenceFailedRepair = recurrenceSummary?.failed_repair_group_total ?? 0;
const recurrenceManualGate = recurrenceSummary?.manual_gate_group_total ?? 0;
const recurrenceSourceReview =
recurrenceSummary?.source_correlation_review_group_total ?? 0;
const latestRecurrenceOpenItem = recurrenceOpenItems(telemetry.eventRecurrence)[0] ?? null;
const driftState = telemetry.driftFingerprintState;
const driftFsmKey = driftFsmStateKey(driftState?.fsm_state);
@@ -951,6 +962,7 @@ function buildWorkItems(
gap: recurrenceAutomationGap,
failed: recurrenceFailedRepair,
manual: recurrenceManualGate,
source: recurrenceSourceReview,
}),
evidenceDetails: latestRecurrenceOpenItem
? [
@@ -1342,6 +1354,11 @@ function RecurrenceWorkQueuePanel({
<span className="border border-[#d8d3c7] bg-white px-2 py-0.5">
{t("failed", { count: summary?.failed_repair_group_total ?? 0 })}
</span>
<span className="border border-[#d9b36f] bg-[#fff7e8] px-2 py-0.5">
{t("sourceReview", {
count: summary?.source_correlation_review_group_total ?? 0,
})}
</span>
</div>
</div>
@@ -1396,6 +1413,19 @@ function RecurrenceWorkQueuePanel({
</div>
<div className="mt-3 grid gap-1 text-xs leading-5 text-[#5f5b52]">
<p>{t("incident", { incident: item.latest_incident_id ?? "--" })}</p>
<p>{t("stage", { stage: item.latest_stage ?? "--" })}</p>
<p className="truncate">
{t("sourceEvent", {
event: item.latest_provider_event_id ?? "--",
})}
</p>
<p>
{t("sourceRefs", {
refs: item.source_ref_total ?? 0,
sentry: item.sentry_ref_total ?? 0,
signoz: item.signoz_ref_total ?? 0,
})}
</p>
<p>{t("workItem", { id: workItem?.work_item_id ?? "--" })}</p>
<p>
{t("repair", {