Files
next-tjwater-server/docs/workbench-runtime.md
T
jiang b853b61a0b feat(investigation): preserve cumulative reference graphs
Accumulate investigation paths and preserve failed attempts across rounds. Keep graph annotations separate from execution state, synchronize the API contract, and consolidate documentation.
2026-11-11 19:10:41 +08:00

2.9 KiB
Raw Permalink Blame History

工作台运行态

GET /api/v1/workbench/runtime 按当前项目读取 BizDB 中的分析成果和任务告警。外围样板工单经同步器进入 workbench.operational_tasks,由工况任务接口和 sync-snapshot 提供给前端;定时任务表暂时保留,但不进入当前产品主路径。

  • analysis.runs/results 只用于分析成果、历史成果和兼容场景字段。
  • 旧的 workbench.work_orders 已由 021_retire_workbench_work_orders.sql 退役。work_orders: [] 和 work_order_availability: not_configured 仅保留接口兼容,不表示没有外围工单。
  • workbench.alert_events 保存任务显式推送的事件,workbench.alerts 保存当前状态。分析结果、测点值和缺测状态不会自动变成告警。
  • 每个可选分区独立读取并返回 ready、not_configured 或 degraded,一个分区失败不会污染其他分区。

历史上原有三张独立演示工单已迁入 peripheral_sample.work_orders,仍由外围样板面板管理,并由同步器投影为 external_work_order 工况任务。旧表退役前的完整数据库备份由部署记录保存,不能重新运行历史 011_workbench_work_orders.sql 或旧种子脚本重建双份数据。

工单与告警存储

任务告警

DDL 位于 resources/sql/008_workbench_alert_events.sql。任务通过 POST /api/v1/workbench/task-alert-events 推送 raised、acknowledged 或 resolved 事件。来源包含 task_type、task_id 和 run_id,生产者由认证项目身份绑定。event_id 在项目和生产者范围内幂等,告警事实在首次 raised 后不可改写。

外围工单

外围服务的 peripheral_sample.work_orders 是业务工单的管理来源,当前 origin 固定为 system_data;activity 只记录实际发生的创建、修改和现场反馈,不由总状态补造阶段。同步器将有效工单写入 workbench.operational_tasks 的 external_work_order 投影。原有三张独立演示工单也已迁入外围样板,并由同一面板管理。

resources/sql/011_workbench_work_orders.sql 和 017_workbench_schema_comments.sql 属于历史基线;021_retire_workbench_work_orders.sql 在验证三个迁入目标及其任务投影后,仅在 tjwater_v2 删除旧表。不要重放 011 重建它。GET /api/v1/workbench/runtime 暂保留空的 work_orders 字段作为接口兼容。其他项目数据库没有旧表,不需要应用 021。

告警事件表需要 SELECT, INSERT,告警状态表需要 SELECT, INSERT, UPDATE。迁移及扩展门禁见 workbench-database-rollout.md。

当前外围工单来源与按项目路由见 外围服务,其中 sample 只保留兼容名称。上述旧表迁移的历史数据库范围不表示其他项目已应用迁移,也不限制当前 API 的项目路由。