fix: expose workbench timing source status
This commit is contained in:
@@ -355,10 +355,11 @@ function renderWebObserveCollectTable(value: Record<string, unknown>): string {
|
||||
if (jsonFindings.length > 0) {
|
||||
lines.push(
|
||||
"Findings:",
|
||||
webObserveTable(["KIND", "SEVERITY", "COUNT", "ROOT_CAUSE", "SUMMARY"], jsonFindings.map((item) => [
|
||||
webObserveTable(["KIND", "SEVERITY", "COUNT", "TIMING", "ROOT_CAUSE", "SUMMARY"], jsonFindings.map((item) => [
|
||||
webObserveShort(webObserveText(item.kind ?? item.id ?? item.code), 48),
|
||||
item.severity ?? item.level,
|
||||
item.count ?? item.sampleCount,
|
||||
webObserveShort(webObserveFindingTiming(item), 42),
|
||||
webObserveShort(webObserveText(item.rootCause ?? item.rootCauseStatus), 48),
|
||||
webObserveShort(webObserveText(item.summary ?? item.message), 96),
|
||||
])),
|
||||
@@ -556,13 +557,14 @@ function renderWebObserveProjectCollectTable(value: Record<string, unknown>, col
|
||||
]) : [["-", "-", "-", "-", "-", "-", "-"]]),
|
||||
"",
|
||||
"Findings:",
|
||||
webObserveTable(["SEVERITY", "ID", "COUNT", "ROOT_CAUSE", "SUMMARY"], findings.length > 0 ? findings.map((item) => [
|
||||
webObserveTable(["SEVERITY", "ID", "COUNT", "TIMING", "ROOT_CAUSE", "SUMMARY"], findings.length > 0 ? findings.map((item) => [
|
||||
webObserveShort(webObserveText(item.severity ?? item.level), 12),
|
||||
webObserveShort(webObserveText(item.id ?? item.kind ?? item.code), 48),
|
||||
item.count ?? item.sampleCount,
|
||||
webObserveShort(webObserveFindingTiming(item), 42),
|
||||
webObserveShort(webObserveText(item.rootCause ?? item.rootCauseStatus), 48),
|
||||
webObserveShort(webObserveText(item.summary ?? item.message), 96),
|
||||
]) : [["-", "-", "-", "-", "-"]]),
|
||||
]) : [["-", "-", "-", "-", "-", "-"]]),
|
||||
"",
|
||||
"Disclosure:",
|
||||
" collect project views are rendered from existing samples/control/analysis artifacts; they do not create a new sampling source.",
|
||||
@@ -600,6 +602,14 @@ function webObserveShort(value: string, maxLength: number): string {
|
||||
return `${value.slice(0, maxLength - 1)}~`;
|
||||
}
|
||||
|
||||
function webObserveFindingTiming(item: Record<string, unknown>): string {
|
||||
const status = item.timingStatus ?? null;
|
||||
const source = item.timingSourceOfTruth ?? item.expectedElapsedSource ?? item.evidenceKind ?? null;
|
||||
const parts = [status, source].filter((value) => value !== null && value !== undefined && value !== "");
|
||||
if (parts.length === 0) return "-";
|
||||
return parts.map((value) => webObserveText(value)).join("/");
|
||||
}
|
||||
|
||||
function record(value: unknown): Record<string, unknown> {
|
||||
return value && typeof value === "object" && !Array.isArray(value) ? value as Record<string, unknown> : {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user