Files
nexus/wiki/concepts/Observable-States.md

31 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Observable States"
type: concept
tags: [workflow, observability, system-modeling]
last_updated: 2026-04-25
---
## Definition
可观察状态——每个工作流状态(快乐路径中的每一步 + 每个失败模式)必须同时从四个视角描述系统当前状态,确保客户、运维、数据库和日志各方都能准确感知系统发生了什么。
## Four Dimensions四维度
| 维度 | 描述 | 示例 |
|------|------|------|
| **Customer View** | 当前客户在 UI 上看到什么 | 加载中 / "处理中..." / 空白 / 错误提示 |
| **Operator View** | 运维/管理员在管理面板看到什么 | 实体处于"处理中"状态 / 任务步骤显示 "step_3_running" |
| **Database View** | 数据库中数据当前状态 | `job.status = "running"`, `job.current_step = "step_1"` |
| **Log View** | 系统日志当前记录了什么 | `[order-service] step 1 started entity_id=abc123` |
## Why Four Dimensions?
单一视角不足以支撑调试和运维:
- **只有 Customer View**:运维无法知道后台发生了什么
- **只有 Database View**:客户不知道自己看到了什么
- **只有 Log View**:没有结构化数据支撑告警和审计
- **只有 Operator View**:缺乏原始数据记录
四个维度必须同步更新、互相印证,构成完整的可观测性闭环。
## Source
- [[specialized-workflow-architect]]Workflow Architect Agent