feat(awooop): project ai route repair work item
This commit is contained in:
@@ -834,6 +834,49 @@ type CallbackRepliesWorkItemResponse = {
|
||||
per_page: number;
|
||||
};
|
||||
|
||||
type AiRouteRepairEvidence = {
|
||||
target_resource?: string | null;
|
||||
access_blockers?: string[];
|
||||
source_ref_count?: number | null;
|
||||
work_item?: {
|
||||
work_item_id?: string | null;
|
||||
status?: string | null;
|
||||
next_step?: string | null;
|
||||
reason?: string | null;
|
||||
owner?: string | null;
|
||||
target_href?: string | null;
|
||||
needs_human?: boolean | null;
|
||||
} | null;
|
||||
playbook_recommendation?: {
|
||||
playbook_id?: string | null;
|
||||
status?: string | null;
|
||||
safe_to_auto_execute?: boolean | null;
|
||||
requires_approval?: boolean | null;
|
||||
steps?: Array<{ step?: string | null; scope?: string | null; mode?: string | null }>;
|
||||
} | null;
|
||||
owner_action?: {
|
||||
lead_agent?: string | null;
|
||||
supporting_agents?: string[];
|
||||
human_owner?: string | null;
|
||||
automation_state?: string | null;
|
||||
next_step?: string | null;
|
||||
playbook_id?: string | null;
|
||||
safe_to_auto_repair?: boolean | null;
|
||||
blocking_reason?: string | null;
|
||||
} | null;
|
||||
};
|
||||
|
||||
type AiRouteStatusResponse = {
|
||||
lane_mode?: string | null;
|
||||
selected_provider?: string | null;
|
||||
skipped_lanes?: Array<{ provider_name?: string | null }>;
|
||||
operator_action?: {
|
||||
action?: string | null;
|
||||
human_required?: boolean | null;
|
||||
} | null;
|
||||
repair_evidence?: AiRouteRepairEvidence | null;
|
||||
};
|
||||
|
||||
type Telemetry = {
|
||||
quality: AutomationQualitySummary | null;
|
||||
governanceEvents: GovernanceEventsResponse | null;
|
||||
@@ -852,6 +895,7 @@ type Telemetry = {
|
||||
driftFingerprintState: DriftFingerprintState | null;
|
||||
callbackReplies: CallbackRepliesWorkItemResponse | null;
|
||||
statusChain: AwoooPStatusChain | null;
|
||||
aiRouteStatus: AiRouteStatusResponse | null;
|
||||
};
|
||||
|
||||
type WorkItem = {
|
||||
@@ -1599,6 +1643,16 @@ function buildWorkItems(
|
||||
latestCallbackOwnerReview?.km_stale_completion_summary ?? null;
|
||||
const latestCallbackWorkItem = latestCallbackSummary?.work_item ?? null;
|
||||
const latestCallbackTriage = latestCallbackWorkItem?.triage ?? null;
|
||||
const aiRoute = telemetry.aiRouteStatus;
|
||||
const aiRouteRepairEvidence = aiRoute?.repair_evidence ?? null;
|
||||
const aiRouteWorkItem = aiRouteRepairEvidence?.work_item ?? null;
|
||||
const aiRoutePlaybook = aiRouteRepairEvidence?.playbook_recommendation ?? null;
|
||||
const aiRouteOwnerAction = aiRouteRepairEvidence?.owner_action ?? null;
|
||||
const aiRouteBlockers = aiRouteRepairEvidence?.access_blockers ?? [];
|
||||
const aiRouteSkipped = aiRoute?.skipped_lanes
|
||||
?.map((lane) => lane.provider_name)
|
||||
.filter(Boolean)
|
||||
.join(" -> ");
|
||||
const remediationQueue = telemetry.slo?.adr100?.verification_coverage?.remediation_queue;
|
||||
const remediationTotal = remediationQueue?.total ?? 0;
|
||||
const remediationReadyForAi = remediationQueue?.ready_for_ai ?? 0;
|
||||
@@ -1708,6 +1762,46 @@ function buildWorkItems(
|
||||
? `/awooop/work-items?project_id=${encodeURIComponent(telemetry.eventRecurrence?.project_id ?? "awoooi")}&work_item_id=${encodeURIComponent(latestRecurrenceOpenItem.work_item.work_item_id)}${latestRecurrenceOpenItem.work_item.incident_id ? `&incident_id=${encodeURIComponent(latestRecurrenceOpenItem.work_item.incident_id)}` : ""}`
|
||||
: "/awooop/runs",
|
||||
},
|
||||
{
|
||||
id: "aiRouteRepairWorkItem",
|
||||
phase: "T178",
|
||||
status: aiRouteWorkItem?.status === "open"
|
||||
? "blocked"
|
||||
: aiRoute
|
||||
? "watching"
|
||||
: "blocked",
|
||||
surfaceKey: "runs",
|
||||
source: "/api/v1/platform/ai-route-status + ai_route_repair",
|
||||
gateKey: "aiRouteRepairWorkItem",
|
||||
evidence: t("evidence.aiRouteRepairWorkItem", {
|
||||
lane: aiRoute?.lane_mode ?? "--",
|
||||
selected: aiRoute?.selected_provider ?? "--",
|
||||
target: aiRouteRepairEvidence?.target_resource ?? "--",
|
||||
blockers: aiRouteBlockers.length,
|
||||
}),
|
||||
evidenceDetails: aiRouteRepairEvidence
|
||||
? [
|
||||
t("evidence.aiRouteRepairWorkItemId", {
|
||||
id: aiRouteWorkItem?.work_item_id ?? "--",
|
||||
}),
|
||||
t("evidence.aiRouteRepairSkipped", {
|
||||
skipped: aiRouteSkipped || "--",
|
||||
}),
|
||||
t("evidence.aiRouteRepairOwner", {
|
||||
owner: aiRouteOwnerAction?.human_owner ?? aiRouteWorkItem?.owner ?? "--",
|
||||
lead: aiRouteOwnerAction?.lead_agent ?? "--",
|
||||
}),
|
||||
t("evidence.aiRouteRepairPlaybook", {
|
||||
playbook: aiRoutePlaybook?.playbook_id ?? "--",
|
||||
steps: aiRoutePlaybook?.steps?.length ?? 0,
|
||||
}),
|
||||
t("evidence.aiRouteRepairSafety", {
|
||||
safe: String(aiRouteOwnerAction?.safe_to_auto_repair ?? false),
|
||||
}),
|
||||
]
|
||||
: [t("evidence.aiRouteRepairUnavailable")],
|
||||
href: aiRouteWorkItem?.target_href ?? "/awooop/runs",
|
||||
},
|
||||
{
|
||||
id: "configDriftFsm",
|
||||
phase: "T64",
|
||||
@@ -4594,6 +4688,7 @@ export default function AwoooPWorkItemsPage() {
|
||||
driftFingerprintState: null,
|
||||
callbackReplies: null,
|
||||
statusChain: null,
|
||||
aiRouteStatus: null,
|
||||
});
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [lastUpdated, setLastUpdated] = useState<Date | null>(null);
|
||||
@@ -4617,6 +4712,7 @@ export default function AwoooPWorkItemsPage() {
|
||||
const remediationHistoryUrl = `${API_BASE}/api/v1/ai/slo/remediation/history?limit=80`;
|
||||
const driftFingerprintUrl = `${API_BASE}/api/v1/drift/fingerprints/state?namespace=awoooi-prod`;
|
||||
const callbackRepliesUrl = `${API_BASE}/api/v1/platform/runs/callback-replies?project_id=${encodedProjectId}&per_page=100`;
|
||||
const aiRouteStatusUrl = `${API_BASE}/api/v1/platform/ai-route-status?workload_type=deep_rca`;
|
||||
|
||||
const [
|
||||
quality,
|
||||
@@ -4635,6 +4731,7 @@ export default function AwoooPWorkItemsPage() {
|
||||
remediationHistory,
|
||||
driftFingerprintState,
|
||||
callbackReplies,
|
||||
aiRouteStatus,
|
||||
] = await Promise.all([
|
||||
fetchJson<AutomationQualitySummary>(qualityUrl, 15000),
|
||||
fetchJson<GovernanceEventsResponse>(governanceEventsUrl),
|
||||
@@ -4652,6 +4749,7 @@ export default function AwoooPWorkItemsPage() {
|
||||
fetchJson<RemediationHistoryResponse>(remediationHistoryUrl),
|
||||
fetchJson<DriftFingerprintState>(driftFingerprintUrl, 12000),
|
||||
fetchJson<CallbackRepliesWorkItemResponse>(callbackRepliesUrl, 12000),
|
||||
fetchJson<AiRouteStatusResponse>(aiRouteStatusUrl, 12000),
|
||||
]);
|
||||
|
||||
const statusChainIncidentId = selectStatusChainIncidentId(
|
||||
@@ -4687,6 +4785,7 @@ export default function AwoooPWorkItemsPage() {
|
||||
driftFingerprintState,
|
||||
callbackReplies,
|
||||
statusChain,
|
||||
aiRouteStatus,
|
||||
});
|
||||
setLastUpdated(new Date());
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user