docs: 固化CaseRun时区展示与L1入口

This commit is contained in:
root
2026-07-26 08:05:31 +02:00
parent 8c2e650ad5
commit dbee5efe0a
+36 -5
View File
@@ -78,20 +78,51 @@ CaseRun 是硬件执行运行台,不是 Workbench 的附属诊断卡片。页
## 6. L1 Native 合同
前后端必须独立启动、独立日志、独立停止:
前后端必须独立启动、独立日志、独立停止,并统一由 UniDesk YAML-first 生命周期入口管理
- API/fixture:使用现有 `caserun:native:start|stop|status|logs`,默认 native API port 为 `4316`
- Web:使用 `dev:native-caserun`Vite HMR 与 `/v1/caserun/*` native proxy 独立运行。
- 固定端口、host、状态目录和公网入口只从
`config/hwlab-node-lanes.yaml#lanes.<lane>.targets.<node>.nativeDevelopment.caserun`
读取,禁止在命令行补临时端口或 URL。
- API 与 Web 分别使用以下统一入口:
```bash
bun scripts/cli.ts hwlab nodes native-development caserun \
<api|web> <start|stop|restart|status|logs> \
--node <node> --lane <lane>
```
- 同一服务的旧 L1 进程占用固定端口时,只能由上述生命周期入口停止或重启;不得裸起
`vite``bun run dev:native-caserun` 或临时 fixture server。
- Web 保持 Vite HMR,并只代理 `/v1/caserun/*` native API。
- Native fixture:继续覆盖 queued、running、completed、failed、blocked、canceled、events 和 aggregate。
- Web smoke:使用 repo-owned `caserun-native-web-probe.mjs`,验证 `/caserun` 首屏、case 选择、启动、刷新、事件和 aggregate。
- Web smoke:使用
`bun scripts/cli.ts web-probe native-readiness --node <node> --lane <lane> --profile caserun`
从 owning YAML 选择的固定公网入口验证。
- Native 页面必须显示 `mode=native-test`,但生产 selected origin 不得读取 native fixture 或 native fallback。
### 6.1 时间事实与时区展示
- CaseRun、Trace、event、capture 和 analysis 中的时间事实统一以完整 UTC 时间戳存储;
Web 不修改原始值,也不把展示后的本地时间回写事实层。
- 展示时区、locale 和标签只读取 Web runtime config 的 `displayTime`,其唯一来源是 owning
YAML;禁止在组件内写死 `Asia/Shanghai`、固定偏移或浏览器本机时区。
- Trace 行存在完整时间字段时,统一调用共享 `formatDisplayClock()`;禁止截取 ISO 文本或直接
使用 `getUTCHours()` 生成用户可见时间。
- 历史离线结果只有 UTC `HH:mm:ss` header 时,可以用当前 run 的原始 UTC 日期恢复瞬时时间,
再调用共享时区格式化函数;该兼容只发生在展示层,不要求重新分析或重跑 CaseRun。
- 最小 L0 验收必须证明:
- 同一个 UTC 瞬时在 owning YAML 的目标时区下显示正确本地时间;
- 切换为 `UTC` 配置后仍显示原 UTC 时间;
- 无效输入保持既有空态或不可用提示。
- L1 只重启 Web 并读取同一历史 run;禁止为了时间展示修改重跑 AgentRun、HWPOD、CaseRun
workflow 或离线分析。
## 7. 响应式与验收
- 桌面首屏使用三栏 bounded workspace,主 run 区域优先保证可读宽度。
- 中等宽度将右侧 Inspector 收为抽屉或下方区域,不能压缩事件流至不可读。
- 移动端按“命令栏 → 当前 run → case 选择 → 事件 → 证据”纵向排列,启动和刷新保持可达。
- L1 验收使用 `web-probe` custom/local 入口,覆盖桌面 `1920x1080` 和紧凑桌面视口。
- L1 验收使用 `web-probe native-readiness` 和 owning YAML 固定公网入口,覆盖桌面
`1920x1080` 和紧凑桌面视口;custom/local 只能作为 L0 preflight,不能代替 L1。
- 必须确认首屏 DOM、启动/刷新交互、无 pageerror、无 console.error、无关键失败请求和无 document 横向溢出。
## 8. 非目标