fix(awooop): clarify apply candidate owner review state
This commit is contained in:
@@ -26,6 +26,11 @@ function valueLabel(value: number, fallback: string) {
|
||||
return value > 0 ? String(value) : fallback;
|
||||
}
|
||||
|
||||
function nextActionLabel(value: unknown, labels: Record<string, string>, fallback: string) {
|
||||
const key = String(value ?? "");
|
||||
return labels[key] ?? (value ? String(value) : fallback);
|
||||
}
|
||||
|
||||
export function AwoooPAutomationAssetLedger({
|
||||
chain,
|
||||
remediationSummary,
|
||||
@@ -38,6 +43,12 @@ export function AwoooPAutomationAssetLedger({
|
||||
className?: string;
|
||||
}) {
|
||||
const t = useTranslations("awooop.automationAssetLedger");
|
||||
const nextActionLabels: Record<string, string> = {
|
||||
open_apply_gate_work_item_review_verifier_and_km: t("nextActions.openApplyGateWorkItem"),
|
||||
owner_review_apply_gate_or_create_verifier_plan: t("nextActions.openApplyGateWorkItem"),
|
||||
owner_review_repair_candidate_draft: t("nextActions.ownerReviewRepairCandidateDraft"),
|
||||
manual_review_no_action_decision: t("nextActions.manualReviewNoActionDecision"),
|
||||
};
|
||||
const handoff = chain?.automation_handoff;
|
||||
const handoffAssets = handoff?.asset_ids;
|
||||
const kmCount = chain?.evidence?.knowledge_entries ?? 0;
|
||||
@@ -116,7 +127,10 @@ export function AwoooPAutomationAssetLedger({
|
||||
{ key: "dryRun", value: handoffAssets?.dry_run },
|
||||
{ key: "apply", value: handoffAssets?.apply_candidate },
|
||||
{ key: "verifier", value: handoffAssets?.verifier },
|
||||
{ key: "nextStep", value: handoff?.next_action ?? chain?.next_step },
|
||||
{
|
||||
key: "nextStep",
|
||||
value: nextActionLabel(handoff?.next_action ?? chain?.next_step, nextActionLabels, "--"),
|
||||
},
|
||||
].filter((item) => Boolean(item.value));
|
||||
|
||||
return (
|
||||
|
||||
@@ -274,6 +274,21 @@ export function AwoooPStatusChainPanel({
|
||||
const automationHandoff = chain?.automation_handoff;
|
||||
const blockers = chain?.blockers ?? [];
|
||||
const sourceCorrelation = chain?.source_refs?.correlation;
|
||||
const nextActionLabel = (value: unknown) => {
|
||||
const key = String(value ?? "");
|
||||
const labels: Record<string, string> = {
|
||||
open_apply_gate_work_item_review_verifier_and_km: t("nextActions.openApplyGateWorkItem"),
|
||||
owner_review_apply_gate_or_create_verifier_plan: t("nextActions.openApplyGateWorkItem"),
|
||||
manual_review_no_action_decision: t("nextActions.manualReviewNoActionDecision"),
|
||||
owner_review_repair_candidate_draft: t("nextActions.ownerReviewRepairCandidateDraft"),
|
||||
manual_review_or_collect_repair_evidence: t("nextActions.collectRepairEvidence"),
|
||||
manual_investigation: t("nextActions.manualInvestigation"),
|
||||
run_or_review_post_execution_verification: t("nextActions.reviewVerifier"),
|
||||
monitor_for_regression: t("nextActions.monitorRegression"),
|
||||
collect_evidence_or_wait: t("nextActions.collectEvidenceOrWait"),
|
||||
};
|
||||
return labels[key] ?? valueOrEmpty(value, emptyLabel);
|
||||
};
|
||||
|
||||
if (!chain) {
|
||||
return (
|
||||
@@ -295,7 +310,7 @@ export function AwoooPStatusChainPanel({
|
||||
{ label: t("fields.stage"), value: `${valueOrEmpty(chain.current_stage, emptyLabel)} / ${valueOrEmpty(chain.stage_status, emptyLabel)}` },
|
||||
{ label: t("fields.repair"), value: valueOrEmpty(chain.repair_state, emptyLabel) },
|
||||
{ label: t("fields.verification"), value: valueOrEmpty(chain.verification, emptyLabel) },
|
||||
{ label: t("fields.nextStep"), value: valueOrEmpty(outcome?.next_action ?? chain.next_step, emptyLabel) },
|
||||
{ label: t("fields.nextStep"), value: nextActionLabel(outcome?.next_action ?? chain.next_step) },
|
||||
];
|
||||
const evidenceMetrics = [
|
||||
{ label: t("evidence.autoRepair"), value: evidence.auto_repair_records ?? 0 },
|
||||
@@ -516,7 +531,7 @@ export function AwoooPStatusChainPanel({
|
||||
}),
|
||||
detail: t("toolchain.learningDetail", {
|
||||
verification: valueOrEmpty(chain.verification, emptyLabel),
|
||||
nextStep: valueOrEmpty(chain.next_step, emptyLabel),
|
||||
nextStep: nextActionLabel(chain.next_step),
|
||||
}),
|
||||
},
|
||||
];
|
||||
@@ -633,7 +648,7 @@ export function AwoooPStatusChainPanel({
|
||||
}),
|
||||
detail: t("drilldown.learningDetail", {
|
||||
verification: valueOrEmpty(chain.verification, emptyLabel),
|
||||
nextStep: valueOrEmpty(chain.next_step, emptyLabel),
|
||||
nextStep: nextActionLabel(chain.next_step),
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -644,7 +659,7 @@ export function AwoooPStatusChainPanel({
|
||||
value: chain.needs_human ? t("human.yes") : t("human.no"),
|
||||
detail: t("drilldown.handoffDetail", {
|
||||
reason: valueOrEmpty(outcome?.human_action_reason, emptyLabel),
|
||||
nextAction: valueOrEmpty(outcome?.next_action ?? chain.next_step, emptyLabel),
|
||||
nextAction: nextActionLabel(outcome?.next_action ?? chain.next_step),
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user