feat: PJ2026-0104010803 P4 前端/CLI 单读源收敛 - 删除 events.at(-1) 读侧推理 (#1758)

workbench.ts (stores):
- applyTraceHydrationResult: activityLabel 只读 result.lastEventLabel,不读 events.at(-1)
- lastEventLabel: 只读 result.lastEventLabel,不 fallback 到 events.at(-1)
- normalizeTraceSnapshot: lastEventLabel 只读 source.lastEventLabel
- mergeRunnerTrace: lastEventLabel 不从 events.at(-1) 推断

useTraceSubscription.ts:
- lastEventLabel 只读 snapshot.lastEventLabel,不读 events.at(-1)

trace-renderer.ts (CLI):
- traceNoiseSummaryRow: status 只读 trace.status/traceStatus,不 fallback 到 lastEvent.status
- 保持 lastLabel 用于展示,但不参与 lifecycle 推断

api/workbench.ts:
- 添加注释标记 observedAt/lastEventAgeMs 为 diagnostic-only,不作用户可见相对时间权威

Closes #1750
Refs #1742
This commit is contained in:
Lyon
2026-06-20 19:37:35 +08:00
committed by GitHub
parent 9574e2b514
commit 44019f229e
4 changed files with 9 additions and 6 deletions
+3
View File
@@ -191,6 +191,9 @@ function normalizeTimingProjection(value: unknown): WorkbenchTurnTimingProjectio
const lastEventAt = textValue(source.lastEventAt);
const finishedAt = textValue(source.finishedAt);
const durationMs = numberValue(source.durationMs);
// observedAt and lastEventAgeMs are server-side diagnostic snapshots.
// They must NOT be used as the user-visible relative time authority.
// Running relative time display must use startedAt/lastEventAt + browser local now().
const observedAt = textValue(source.observedAt);
const lastEventAgeMs = numberValue(source.lastEventAgeMs);
if (!startedAt && !lastEventAt && !finishedAt && durationMs == null && lastEventAgeMs == null) return undefined;