feat(awooop): verify source correlation links in status chain
All checks were successful
Code Review / ai-code-review (push) Successful in 10s
CD Pipeline / tests (push) Successful in 6m9s
CD Pipeline / build-and-deploy (push) Successful in 4m39s
CD Pipeline / post-deploy-checks (push) Successful in 1m55s

This commit is contained in:
Your Name
2026-05-21 10:51:20 +08:00
parent ac7f642e41
commit efb38cf6af
7 changed files with 298 additions and 9 deletions

View File

@@ -103,14 +103,19 @@ export interface AwoooPStatusChain {
schema_version?: string;
status?: string | null;
missing_reason?: string | null;
verification_status?: string | null;
direct_ref_total?: number | null;
candidate_total?: number | null;
applied_link_total?: number | null;
provider_event_total?: number | null;
latest_applied_link_at?: string | null;
providers?: Record<string, {
direct_ref_total?: number | null;
candidate_total?: number | null;
applied_link_total?: number | null;
latest_event_at?: string | null;
latest_heartbeat_at?: string | null;
latest_applied_link_at?: string | null;
}>;
top_candidates?: Array<{
provider?: string | null;
@@ -118,6 +123,8 @@ export interface AwoooPStatusChain {
stage?: string | null;
score?: number | null;
match_type?: string | null;
link_state?: string | null;
verification_status?: string | null;
reasons?: string[];
received_at?: string | null;
}>;
@@ -222,10 +229,27 @@ export function AwoooPStatusChainPanel({
no_incident_context: t("source.statuses.noIncidentContext"),
fetch_failed: t("source.statuses.fetchFailed"),
};
const sourceVerificationLabels: Record<string, string> = {
applied_link_verified: t("source.verificationStatuses.appliedLinkVerified"),
direct_ref_verified: t("source.verificationStatuses.directRefVerified"),
candidate_only: t("source.verificationStatuses.candidateOnly"),
provider_fresh_no_match: t("source.verificationStatuses.providerFreshNoMatch"),
missing: t("source.verificationStatuses.missing"),
no_incident_context: t("source.verificationStatuses.noIncidentContext"),
fetch_failed: t("source.verificationStatuses.fetchFailed"),
};
const sourceStatus = String(sourceCorrelation?.status ?? "missing");
const sourceVerificationStatus = String(sourceCorrelation?.verification_status ?? sourceStatus);
const topAppliedLink = sourceCorrelation?.top_candidates?.find(
(item) => item.link_state === "applied"
);
const latestAppliedLabel = valueOrEmpty(
topAppliedLink?.provider_event_id ?? sourceCorrelation?.latest_applied_link_at,
emptyLabel
);
const sourceProviderSummary = ["sentry", "signoz"].map((provider) => {
const providerItem = sourceCorrelation?.providers?.[provider];
return `${provider} ${providerItem?.direct_ref_total ?? 0}/${providerItem?.candidate_total ?? 0}`;
return `${provider} ${providerItem?.direct_ref_total ?? 0}/${providerItem?.candidate_total ?? 0}/${providerItem?.applied_link_total ?? 0}`;
}).join(" · ");
return (
@@ -300,22 +324,38 @@ export function AwoooPStatusChainPanel({
</div>
{sourceCorrelation && (
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-3">
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-5">
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.status")}</p>
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={sourceStatusLabels[sourceStatus] ?? sourceStatus}>
{sourceStatusLabels[sourceStatus] ?? valueOrEmpty(sourceCorrelation.status, emptyLabel)}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.verification")}</p>
<p
className="mt-2 truncate font-mono text-sm text-[#141413]"
title={sourceVerificationLabels[sourceVerificationStatus] ?? sourceVerificationStatus}
>
{sourceVerificationLabels[sourceVerificationStatus] ?? valueOrEmpty(sourceVerificationStatus, emptyLabel)}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.directCandidate")}</p>
<p className="mt-2 font-mono text-sm text-[#141413]">
{t("source.directCandidateValue", {
direct: sourceCorrelation.direct_ref_total ?? 0,
candidate: sourceCorrelation.candidate_total ?? 0,
applied: sourceCorrelation.applied_link_total ?? 0,
})}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.latestApplied")}</p>
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={latestAppliedLabel}>
{latestAppliedLabel}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.providers")}</p>
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={sourceProviderSummary}>