semantic-atlas 2.8.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/semantic-atlas/SKILL.md +95 -281
- package/.agents/skills/semantic-atlas/agents/openai.yaml +2 -2
- package/.agents/skills/semantic-atlas/references/boundary-design.md +52 -0
- package/.agents/skills/semantic-atlas/references/diagram-design.md +140 -0
- package/.agents/skills/semantic-atlas/references/map-authoring.md +162 -0
- package/.agents/skills/semantic-atlas/references/observations.md +23 -49
- package/.agents/skills/semantic-atlas/references/reconciliation.md +77 -0
- package/README.md +43 -89
- package/README.zh-CN.md +36 -55
- package/dist/application/map-application.d.ts +3 -1
- package/dist/application/map-application.d.ts.map +1 -1
- package/dist/application/map-application.js +59 -0
- package/dist/application/map-application.js.map +1 -1
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +12 -1
- package/dist/cli/run-cli.js.map +1 -1
- package/dist/contracts/cli.d.ts +8 -1
- package/dist/contracts/cli.d.ts.map +1 -1
- package/dist/contracts/flow-navigation.d.ts +48 -0
- package/dist/contracts/flow-navigation.d.ts.map +1 -0
- package/dist/contracts/flow-navigation.js +2 -0
- package/dist/contracts/flow-navigation.js.map +1 -0
- package/dist/contracts/map.d.ts +5 -5
- package/dist/i18n/index.d.ts +22 -196
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/cli.d.ts +3 -0
- package/dist/i18n/locales/en/cli.d.ts.map +1 -1
- package/dist/i18n/locales/en/cli.js +3 -0
- package/dist/i18n/locales/en/cli.js.map +1 -1
- package/dist/i18n/locales/en/errors.d.ts +1 -0
- package/dist/i18n/locales/en/errors.d.ts.map +1 -1
- package/dist/i18n/locales/en/errors.js +1 -0
- package/dist/i18n/locales/en/errors.js.map +1 -1
- package/dist/i18n/locales/en/viewer.d.ts +7 -98
- package/dist/i18n/locales/en/viewer.d.ts.map +1 -1
- package/dist/i18n/locales/en/viewer.js +14 -105
- package/dist/i18n/locales/en/viewer.js.map +1 -1
- package/dist/i18n/locales/zh-CN/cli.d.ts +3 -0
- package/dist/i18n/locales/zh-CN/cli.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN/cli.js +3 -0
- package/dist/i18n/locales/zh-CN/cli.js.map +1 -1
- package/dist/i18n/locales/zh-CN/errors.d.ts +1 -0
- package/dist/i18n/locales/zh-CN/errors.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN/errors.js +1 -0
- package/dist/i18n/locales/zh-CN/errors.js.map +1 -1
- package/dist/i18n/locales/zh-CN/viewer.d.ts +7 -98
- package/dist/i18n/locales/zh-CN/viewer.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN/viewer.js +14 -105
- package/dist/i18n/locales/zh-CN/viewer.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/query/concept-search-service.d.ts +1 -1
- package/dist/query/concept-search-service.d.ts.map +1 -1
- package/dist/query/concept-search-service.js +2 -2
- package/dist/query/concept-search-service.js.map +1 -1
- package/dist/query/flow-navigation-service.d.ts +16 -0
- package/dist/query/flow-navigation-service.d.ts.map +1 -0
- package/dist/query/flow-navigation-service.js +96 -0
- package/dist/query/flow-navigation-service.js.map +1 -0
- package/dist/query/flow-search-service.d.ts +9 -0
- package/dist/query/flow-search-service.d.ts.map +1 -0
- package/dist/query/flow-search-service.js +69 -0
- package/dist/query/flow-search-service.js.map +1 -0
- package/dist/rendering/flow-projector.d.ts +1 -0
- package/dist/rendering/flow-projector.d.ts.map +1 -1
- package/dist/rendering/flow-projector.js +73 -181
- package/dist/rendering/flow-projector.js.map +1 -1
- package/dist/rendering/map-projector.d.ts +4 -5
- package/dist/rendering/map-projector.d.ts.map +1 -1
- package/dist/rendering/map-projector.js +12 -289
- package/dist/rendering/map-projector.js.map +1 -1
- package/dist/rendering/viewer-browser.d.ts.map +1 -1
- package/dist/rendering/viewer-browser.js +517 -556
- package/dist/rendering/viewer-browser.js.map +1 -1
- package/dist/rendering/viewer-diagram.d.ts +3 -5
- package/dist/rendering/viewer-diagram.d.ts.map +1 -1
- package/dist/rendering/viewer-diagram.js +30 -93
- package/dist/rendering/viewer-diagram.js.map +1 -1
- package/dist/rendering/viewer-layout.d.ts +9 -5
- package/dist/rendering/viewer-layout.d.ts.map +1 -1
- package/dist/rendering/viewer-layout.js +107 -52
- package/dist/rendering/viewer-layout.js.map +1 -1
- package/dist/rendering/viewer-navigation.d.ts +4 -0
- package/dist/rendering/viewer-navigation.d.ts.map +1 -0
- package/dist/rendering/viewer-navigation.js +8 -0
- package/dist/rendering/viewer-navigation.js.map +1 -0
- package/dist/rendering/viewer-page.d.ts +12 -28
- package/dist/rendering/viewer-page.d.ts.map +1 -1
- package/dist/rendering/viewer-page.js +133 -563
- package/dist/rendering/viewer-page.js.map +1 -1
- package/dist/setup/managed-skill-installer.d.ts +1 -1
- package/dist/setup/managed-skill-installer.d.ts.map +1 -1
- package/dist/setup/managed-skill-installer.js +1 -1
- package/dist/setup/managed-skill-installer.js.map +1 -1
- package/dist/setup/package-upgrader.d.ts.map +1 -1
- package/dist/setup/package-upgrader.js +1 -4
- package/dist/setup/package-upgrader.js.map +1 -1
- package/docs/architecture.md +71 -176
- package/docs/evaluation.md +15 -4
- package/docs/index.md +9 -2
- package/docs/map-format.md +47 -21
- package/docs/observations.md +7 -3
- package/docs/product-contract.md +61 -94
- package/examples//350/256/242/345/215/225/347/256/241/347/220/206/README.md +16 -0
- package/examples//350/256/242/345/215/225/347/256/241/347/220/206/docs/business-map/orders.yaml +267 -0
- package/package.json +3 -4
- package/.agents/skills/semantic-atlas-maintenance/SKILL.md +0 -218
- package/.agents/skills/semantic-atlas-maintenance/agents/openai.yaml +0 -4
- package/.agents/skills/semantic-atlas-maintenance/references/boundary-design.md +0 -120
- package/.agents/skills/semantic-atlas-maintenance/references/map-authoring.md +0 -127
- package/.agents/skills/semantic-atlas-maintenance/references/reconciliation.md +0 -149
- package/dist/rendering/diagram-image.d.ts +0 -17
- package/dist/rendering/diagram-image.d.ts.map +0 -1
- package/dist/rendering/diagram-image.js +0 -102
- package/dist/rendering/diagram-image.js.map +0 -1
- package/dist/rendering/manual-layout.d.ts +0 -4
- package/dist/rendering/manual-layout.d.ts.map +0 -1
- package/dist/rendering/manual-layout.js +0 -72
- package/dist/rendering/manual-layout.js.map +0 -1
- package/dist/rendering/map-camera.d.ts +0 -26
- package/dist/rendering/map-camera.d.ts.map +0 -1
- package/dist/rendering/map-camera.js +0 -54
- package/dist/rendering/map-camera.js.map +0 -1
- package/dist/rendering/viewer-legend.d.ts +0 -4
- package/dist/rendering/viewer-legend.d.ts.map +0 -1
- package/dist/rendering/viewer-legend.js +0 -138
- package/dist/rendering/viewer-legend.js.map +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# 业务流程文件编写
|
|
2
|
+
|
|
3
|
+
编写或修改业务资料时读取。本页说明当前 v1 文件格式;业务归属判断见[业务边界](boundary-design.md),流程层次和表达见[流程设计](diagram-design.md)。完整字段与校验以安装包的 `docs/map-format.md` 为准。
|
|
4
|
+
|
|
5
|
+
首次建图沿[持续建图方法](diagram-design.md#2-分块调查并持续修正已画流程)分块读取、及时写入并反向修正。每次保存能独立解释的已核实路径和可解析引用;尚未确认的协作者内部、顺序和条件记入调查状态,不写成确定事实或伪造占位流程。后续发现错误时直接修改既有文件,并同步引用,不只追加新内容。
|
|
6
|
+
|
|
7
|
+
## 文件与概念
|
|
8
|
+
|
|
9
|
+
资料放在 `docs/business-map/<business-area>.yaml`。`map.id` 标识文档,业务概念由 `nodes` 定义,执行路径由 `flows` 定义。每个节点包含 `id`、`kind`、`name`、`summary`、`aliases` 和 `anchors`,可另有 `notes`。ID 使用小写业务词汇,以点或短横线分隔,并在仓库内唯一。
|
|
10
|
+
|
|
11
|
+
节点类型保留 `domain`、`capability`、`scenario`、`operation`、`data`、`invariant`、`interface`,供 AI 查询业务责任和源码。Web 中所有图都由显式 `flows` 呈现,这些概念类型不构成另一种可视图。
|
|
12
|
+
|
|
13
|
+
以下是格式示意,实际名称、规则和锚点应来自目标项目证据:
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
schemaVersion: 1
|
|
17
|
+
map:
|
|
18
|
+
id: support
|
|
19
|
+
title: 客户服务
|
|
20
|
+
summary: 将客户请求处理到明确结果。
|
|
21
|
+
nodes:
|
|
22
|
+
- id: support
|
|
23
|
+
kind: domain
|
|
24
|
+
name: 客户服务
|
|
25
|
+
summary: 负责客户请求的接收与处理。
|
|
26
|
+
aliases: []
|
|
27
|
+
anchors: []
|
|
28
|
+
- id: support.resolve-request
|
|
29
|
+
kind: scenario
|
|
30
|
+
name: 处理客户请求
|
|
31
|
+
summary: 记录请求,核对是否支持,给出处理结果。
|
|
32
|
+
aliases: []
|
|
33
|
+
anchors:
|
|
34
|
+
- kind: symbol
|
|
35
|
+
file: src/support/resolve-request.ts
|
|
36
|
+
value: SupportService.resolveRequest
|
|
37
|
+
description: 核对请求是否支持并处理。
|
|
38
|
+
relations:
|
|
39
|
+
- from: support.resolve-request
|
|
40
|
+
type: part_of
|
|
41
|
+
to: support
|
|
42
|
+
summary: 客户请求由客户服务负责。
|
|
43
|
+
flows:
|
|
44
|
+
- id: support.resolve-request.flow
|
|
45
|
+
name: 处理客户请求
|
|
46
|
+
summary: 从接收请求到给出结果。
|
|
47
|
+
scenario: support.resolve-request
|
|
48
|
+
startsAt: receive
|
|
49
|
+
steps:
|
|
50
|
+
- id: receive
|
|
51
|
+
kind: action
|
|
52
|
+
name: 接收请求
|
|
53
|
+
summary: 记录客户要解决的问题。
|
|
54
|
+
- id: supported
|
|
55
|
+
kind: decision
|
|
56
|
+
name: 属于支持范围吗?
|
|
57
|
+
summary: 根据当前服务范围核对请求。
|
|
58
|
+
notes: 超出服务范围时说明原因,避免让客户继续等待无法提供的结果。
|
|
59
|
+
- id: resolved
|
|
60
|
+
kind: outcome
|
|
61
|
+
name: 完成处理
|
|
62
|
+
summary: 客户得到处理结果。
|
|
63
|
+
- id: refused
|
|
64
|
+
kind: outcome
|
|
65
|
+
name: 说明无法处理的原因
|
|
66
|
+
summary: 告知客户当前服务边界。
|
|
67
|
+
transitions:
|
|
68
|
+
- from: receive
|
|
69
|
+
to: supported
|
|
70
|
+
- from: supported
|
|
71
|
+
when: 属于
|
|
72
|
+
to: resolved
|
|
73
|
+
- from: supported
|
|
74
|
+
when: 不属于
|
|
75
|
+
to: refused
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
文件中的 `relations`、节点的 `aliases` 和 `anchors` 可以为空;业务图需要明确编写 `flows`,没有流程时 Web 显示空状态,不从领域或分类自动补画。
|
|
79
|
+
|
|
80
|
+
## 总览与子流程
|
|
81
|
+
|
|
82
|
+
总览也编写为一个 `flow`,归属一个负责这条完整旅程的 `scenario`。步骤使用动作和判断说明主要环节及交接;例如“顾客下单 → 仓库发货 → 顾客申请退款了吗?”,退款只有符合触发条件才进入。
|
|
83
|
+
|
|
84
|
+
继续深入某个环节时,让上层步骤的 `concept` 指向下层流程所属的场景:
|
|
85
|
+
|
|
86
|
+
上层与下层使用同一个已定义概念。例如,上层步骤引用 `orders.payment`:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
- id: collect-payment
|
|
90
|
+
kind: action
|
|
91
|
+
name: 支付订单
|
|
92
|
+
summary: 顾客完成订单付款。
|
|
93
|
+
concept: orders.payment
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
下层完整流程归属这个已定义的 `scenario`:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
- id: orders.payment.flow
|
|
100
|
+
name: 支付订单
|
|
101
|
+
summary: 从提交支付请求到收到最终结果。
|
|
102
|
+
scenario: orders.payment
|
|
103
|
+
startsAt: request
|
|
104
|
+
steps:
|
|
105
|
+
- id: request
|
|
106
|
+
kind: action
|
|
107
|
+
name: 提交付款
|
|
108
|
+
summary: 顾客确认本次支付。
|
|
109
|
+
- id: paid
|
|
110
|
+
kind: decision
|
|
111
|
+
name: 付款成功了吗?
|
|
112
|
+
summary: 以支付渠道的确认结果为准。
|
|
113
|
+
- id: success
|
|
114
|
+
kind: outcome
|
|
115
|
+
name: 订单已付款
|
|
116
|
+
summary: 订单可以进入待发货。
|
|
117
|
+
- id: failed
|
|
118
|
+
kind: outcome
|
|
119
|
+
name: 保留待付款订单
|
|
120
|
+
summary: 顾客可以稍后重新付款。
|
|
121
|
+
transitions:
|
|
122
|
+
- from: request
|
|
123
|
+
to: paid
|
|
124
|
+
- from: paid
|
|
125
|
+
when: 成功
|
|
126
|
+
to: success
|
|
127
|
+
- from: paid
|
|
128
|
+
when: 失败或取消
|
|
129
|
+
to: failed
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
同一场景可拥有多条有明确名字的流程,界面按当前子流程入口呈现。不要把进入操作放进备注详情。
|
|
133
|
+
|
|
134
|
+
Web 默认入口从根流程取得:其 `scenario` 没有被其他流程步骤的 `concept` 引用。根流程排在前面;明确编写一个总览,使读者进入后先看到完整旅程。多个真实独立入口不应为了凑成总览而伪造先后关系。流程内部循环用 `transitions` 表达,图间引用用于展开环节。
|
|
135
|
+
|
|
136
|
+
`part_of` 只表达业务归属,不能推断执行顺序;被同一流程引用也不改变概念的业务所有者。相关流程不自动变成下一层,只有步骤所引用概念自己的流程才作为进入目标,当前流程排除自身入口。
|
|
137
|
+
|
|
138
|
+
## 步骤、连接与备注
|
|
139
|
+
|
|
140
|
+
- 流程归属已存在的 `scenario`;步骤包含 `id`、`kind`、`name`、`summary`,可以有 `concept` 和 `notes`。
|
|
141
|
+
- `action` 至多有一条无标签后续连接;`decision` 至少有两条标签不同且非空的后续连接;`outcome` 结束当前路径。
|
|
142
|
+
- `startsAt` 指向起点,所有步骤都应从它可达。`transitions` 的 `from`、`to` 引用本流程内的步骤 ID;判断的 `when` 说明具体条件。
|
|
143
|
+
- 节点 `notes` 和步骤 `notes` 记录业务背景、规则的目的与接受的代价;步骤备注优先于引用概念的备注。不能把推测的原因写成已确认决定。
|
|
144
|
+
- 子流程通过节点角标直接进入;点击节点正文仅在有业务备注时打开默认关闭的详情,详情只显示备注,不提供进入按钮。无备注的普通节点点击保持原样。
|
|
145
|
+
|
|
146
|
+
概念关系继续用于 AI 调查:`invokes` 从场景/操作指向场景/操作,`reads`/`writes` 指向数据,`publishes`/`consumes` 指向接口,`constrained_by` 指向约束。每条关系包含 `from`、`type`、`to` 和业务 `summary`。关系由来源概念所属文件声明,共享概念只定义一次。
|
|
147
|
+
|
|
148
|
+
## 源码锚点
|
|
149
|
+
|
|
150
|
+
锚点包含 `kind`、`value`、`description`。类型为 `file`、`directory`、`document`、`symbol`、`search`。`symbol` 可另有仓库相对路径 `file`,`value` 标识类和方法,例如 `OrderService.placeOrder`;普通函数使用函数名。
|
|
151
|
+
|
|
152
|
+
当前源码确认了业务动作的决定性方法时,优先绑定到文件与声明,描述后续需要核实的动作、规则或状态。领域可以定位目录,数据概念定位声明文件,业务规则定位产品决定。文件路径保持规范的仓库相对路径;有效概念没有已证实入口时可以保留空锚点。
|
|
153
|
+
|
|
154
|
+
AI 可以用 `flows <flow-id>` 或 `context <concept-id>` 直达已知业务;只有业务意图时,用 `search --flows` 词面定位相关流程。目标流程提供本层步骤、子流程和引用概念的源码锚点,需要整体结构时才读取无 ID 的 `flows` 目录。文件和 CLI 保留这些结构,Web 面向业务人员隐藏源码路径、类和方法。AI 使用普通仓库工具打开当前声明和实现;行号与行为以当前源码为准。旧文件或声明失效时,依据当前证据修正锚点,不丢弃仍准确的业务含义。
|
|
155
|
+
|
|
156
|
+
## 完成检查
|
|
157
|
+
|
|
158
|
+
业务行为变化时,在修改代码的同一分支同步相关流程、备注与锚点,作为一个完整业务变更审阅、提交和合入。内部组织或纯机械变化没有业务含义变化时,不重画流程。
|
|
159
|
+
|
|
160
|
+
完整校验全部文件,打开受影响流程,按需检查上下层进入与返回,核对关键分支和业务备注。合并或重放后按最终代码复核条件、顺序、结果和子流程引用,不只拼接 YAML。文件有效只能证明结构;源码证据证明规则,实际阅读证明表达是否清楚。
|
|
161
|
+
|
|
162
|
+
新版格式与已有资料可以按已确认的当前契约重写,无需保留旧业务文件或旧格式的兼容路径。具体格式变化仍按所属项目规则与授权执行。
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 观察记录契约
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
has reached its current result. Generate `id` once, keep `recordedAt` stable,
|
|
5
|
-
and replay the same document when a submission result is uncertain.
|
|
3
|
+
这是可选的既有记录契约,仅在用户明确要求准确性记录,或需要读取和处理已有历史观察时使用。正常工程直接在同一分支同步代码与相关流程,不要求生成观察、候选或等待主分支后维护。
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
需要写入时,`id` 生成一次,`recordedAt` 保持稳定;提交结果不确定时重试完全相同的文档。现有历史数据保持原样,不因工作流调整自动清理或迁移。
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
## 任务观察
|
|
8
|
+
|
|
9
|
+
任务 Agent 记录调查证据,不填写正确性、返工或图导致回归的审查评分。当前任务观察使用 `schemaVersion: 2`:
|
|
12
10
|
|
|
13
11
|
```json
|
|
14
12
|
{
|
|
@@ -22,7 +20,7 @@ observations use schema version 2.
|
|
|
22
20
|
"map": {
|
|
23
21
|
"queries": [
|
|
24
22
|
{
|
|
25
|
-
"selector": "
|
|
23
|
+
"selector": "提交订单",
|
|
26
24
|
"outcome": "context",
|
|
27
25
|
"selectedConceptIds": ["commerce.orders.place-order"]
|
|
28
26
|
}
|
|
@@ -30,7 +28,7 @@ observations use schema version 2.
|
|
|
30
28
|
"dispositions": [
|
|
31
29
|
{
|
|
32
30
|
"status": "stale",
|
|
33
|
-
"summary": "
|
|
31
|
+
"summary": "当前源码位置已变化,资料中的业务含义保持稳定。",
|
|
34
32
|
"evidence": [
|
|
35
33
|
{
|
|
36
34
|
"kind": "source",
|
|
@@ -45,7 +43,7 @@ observations use schema version 2.
|
|
|
45
43
|
"businessDomainId": "commerce",
|
|
46
44
|
"kind": "anchor",
|
|
47
45
|
"disposition": "confirmed",
|
|
48
|
-
"summary": "
|
|
46
|
+
"summary": "校准时替换过期的源码锚点。",
|
|
49
47
|
"evidence": [
|
|
50
48
|
{
|
|
51
49
|
"kind": "source",
|
|
@@ -57,52 +55,34 @@ observations use schema version 2.
|
|
|
57
55
|
}
|
|
58
56
|
```
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
is `confirmed` when current evidence supports the proposed correction,
|
|
68
|
-
`contradicted` when it replaces a mapped statement contradicted by current
|
|
69
|
-
evidence, or `unresolved` when it remains a maintenance lead. Periodic
|
|
70
|
-
maintenance preserves these task-time judgments and linked independent reviews,
|
|
71
|
-
then confirms durable business meaning again before editing canonical YAML.
|
|
72
|
-
Candidate kinds are `node`, `relation`, `anchor`, and `flow`. Use `flow` for
|
|
73
|
-
a stable scenario path whose business actions, decisions, labeled branches, or
|
|
74
|
-
outcomes need reconciliation. An implementation-only control-flow change does
|
|
75
|
-
not create a flow candidate.
|
|
76
|
-
Stored task observations must match this current schema; unsupported local
|
|
77
|
-
artifacts fail visibly and are never migrated or promoted into reconciliation.
|
|
78
|
-
|
|
79
|
-
When a person explicitly corrects the task, add:
|
|
58
|
+
查询结果为 `context`、`concept_not_found`、`concept_ambiguous`、`map_not_found` 或 `unavailable`;只有 `context` 包含非空 `selectedConceptIds`。当前证据结论为 `confirmed`、`missing`、`stale`、`contradicted` 或 `unresolved`;证据类型为 `source`、`test`、`document` 或 `runtime`。
|
|
59
|
+
|
|
60
|
+
每项 `mapUpdateCandidates` 保留稳定 `businessDomainId`。`confirmed` 表示当前证据支持候选,`contradicted` 表示候选替换了被当前证据否定的图中说法,`unresolved` 只作为待核实线索。种类为 `node`、`relation`、`anchor`、`flow`;业务流程的动作、条件或结果改变时用 `flow`,实现内部控制流调整不自动产生候选。
|
|
61
|
+
|
|
62
|
+
处理历史候选时,保留记录当时的原始判断与独立审查,再核实当前稳定含义。旧版本或不支持的本地观察会明确读取失败,不自动迁移成可行动候选。
|
|
63
|
+
|
|
64
|
+
用户明确纠正了任务时,可以添加:
|
|
80
65
|
|
|
81
66
|
```json
|
|
82
67
|
{
|
|
83
68
|
"humanCorrection": {
|
|
84
|
-
"summary": "
|
|
69
|
+
"summary": "用户纠正了业务边界。",
|
|
85
70
|
"dimensions": ["business_boundary"]
|
|
86
71
|
}
|
|
87
72
|
}
|
|
88
73
|
```
|
|
89
74
|
|
|
90
|
-
|
|
91
|
-
`map_use`.
|
|
92
|
-
|
|
93
|
-
Submit the document on standard input from the repository or provide `--repo`:
|
|
75
|
+
纠正维度为 `business_boundary`、`upstream_cause`、`impact`、`map_use`。从标准输入提交:
|
|
94
76
|
|
|
95
77
|
```text
|
|
96
78
|
semantic-atlas observe task --stdin --repo <repository-root>
|
|
97
79
|
```
|
|
98
80
|
|
|
99
|
-
|
|
100
|
-
The same ID with changed content returns `OBSERVATION_CONFLICT`.
|
|
81
|
+
首次成功返回 `recorded`;精确重试返回 `idempotent`;同一 ID 修改内容返回 `OBSERVATION_CONFLICT`。失败单独报告,不改变已经验证的工程结果。
|
|
101
82
|
|
|
102
|
-
##
|
|
83
|
+
## 独立审查观察
|
|
103
84
|
|
|
104
|
-
|
|
105
|
-
accuracy assessment:
|
|
85
|
+
独立审查者引用同仓库的任务观察并拥有准确性判断:
|
|
106
86
|
|
|
107
87
|
```json
|
|
108
88
|
{
|
|
@@ -123,12 +103,6 @@ accuracy assessment:
|
|
|
123
103
|
}
|
|
124
104
|
```
|
|
125
105
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
```text
|
|
129
|
-
semantic-atlas observe review --stdin --repo <repository-root>
|
|
130
|
-
```
|
|
106
|
+
通过 `semantic-atlas observe review --stdin --repo <repository-root>` 提交。`approved` 不能包含错误维度、需要返工或图导致回归;`changes_requested` 的 `requiredRework` 为 `true`,可记录未通过的维度。
|
|
131
107
|
|
|
132
|
-
|
|
133
|
-
rework, or a map-caused regression. A `changes_requested` review sets
|
|
134
|
-
`requiredRework` to `true` and can record the failed accuracy dimensions.
|
|
108
|
+
找不到任务观察时,审查结论仍按当前代码与证据给出,单独说明缺少准确性记录关联,不伪造任务来源。候选维护结果另见[候选校准](reconciliation.md)。
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# 候选校准
|
|
2
|
+
|
|
3
|
+
仅在用户明确要求处理已有历史观察、候选或漂移时读取。它说明旧记录工具的结果契约,不是正常工程的维护流程;新的业务变化在代码分支同步修改流程并一起提交合入,不先创建候选或等主分支后才维护。
|
|
4
|
+
|
|
5
|
+
使用时先运行 `semantic-atlas reconcile candidates --repo <repository-root>`,读取版本化结果并选择一个业务领域,再按[业务边界](boundary-design.md)核实当前归属。历史候选是调查线索,现有观察不会因流程调整自动修改或删除。
|
|
6
|
+
|
|
7
|
+
## 读取来源
|
|
8
|
+
|
|
9
|
+
一组候选按确切领域、种类与摘要分组,保留每条来源的:
|
|
10
|
+
|
|
11
|
+
- 任务观察 ID、任务/运行身份和从零开始的 `candidateIndex`;
|
|
12
|
+
- 该候选的证据与任务时的 `confirmed`、`contradicted`、`unresolved` 判断;
|
|
13
|
+
- 地图查询、当前证据分类、用户纠正和所有关联独立审查;
|
|
14
|
+
- 重新变成可行动候选时,先前待补证据的维护结论。
|
|
15
|
+
|
|
16
|
+
任务时的 `confirmed` 说明当时证据支持修正,`contradicted` 说明要替换的图中说法被证据否定,`unresolved` 只保留线索。校准时重新确认稳定含义,不能直接复制任务判断。
|
|
17
|
+
|
|
18
|
+
## 判断长期价值并分类
|
|
19
|
+
|
|
20
|
+
未来任务可以独立命名、定位、依赖或修改的业务结果、规则、数据、接口和流程,才进入共享资料。方法、辅助函数、SQL 细节、技术目录、临时迁移和一次运行状态留作实现证据。
|
|
21
|
+
|
|
22
|
+
产品决定说明长期意图,当前源码和测试证明实现的协作,部署状态通过运行证据确认。来源冲突且无法判定时保持缺口,不代替业务所有者决定规则。
|
|
23
|
+
|
|
24
|
+
逐条来源选择:
|
|
25
|
+
|
|
26
|
+
| 状态 | 含义 |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `accepted` | 当前证据支持这项稳定修正 |
|
|
29
|
+
| `refined` | 当前证据支持更准确或更小的修正 |
|
|
30
|
+
| `discarded` | 属于实现细节、已过时或没有进入共享资料的依据 |
|
|
31
|
+
| `unresolved` | 当前证据不足以确定稳定含义 |
|
|
32
|
+
|
|
33
|
+
正确地丢弃或保留待核实可以没有文件改动。过期锚点在找到当前入口后修正;矛盾关系先核对两端和方向;缺失概念先确认身份与所有者;流程修正先核实动作、判断、分支和结果。`MAP_NOT_FOUND` 时可以从当前证据支持的一个领域开始,不自动扩为全仓库分类。
|
|
34
|
+
|
|
35
|
+
重复候选保留全部来源,只产生一次 YAML 修改。这些既有候选结果按一个领域的所属文件记账;真实归属调整需要多文件时,按统一 Skill 的直接编写分支组织完整审阅,分别保留候选。单个 `owningMapPath` 不能代表多文件结果。原始观察不修改。
|
|
36
|
+
|
|
37
|
+
## 审阅与记录结果
|
|
38
|
+
|
|
39
|
+
文件变更完整校验、实际看图并经独立审查后,按所属仓库的授权合入。直接画改图没有保留来源时,用 Git 审阅和交付证据说明结果,不伪造候选维护观察。
|
|
40
|
+
|
|
41
|
+
候选维护观察按确切 `taskObservationId` 与 `candidateIndex` 标识来源;摘要相同不能替代身份,跨领域来源也不能混用。只在审查和实际合入完成后提交:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"schemaVersion": 1,
|
|
46
|
+
"id": "maintenance-observation-id",
|
|
47
|
+
"recordedAt": "2026-11-19T08:00:00.000Z",
|
|
48
|
+
"maintenance": {
|
|
49
|
+
"taskId": "maintenance-task-id",
|
|
50
|
+
"runId": "integration-run-id"
|
|
51
|
+
},
|
|
52
|
+
"businessDomainId": "commerce",
|
|
53
|
+
"results": [
|
|
54
|
+
{
|
|
55
|
+
"candidate": {
|
|
56
|
+
"taskObservationId": "task-observation-id",
|
|
57
|
+
"candidateIndex": 0
|
|
58
|
+
},
|
|
59
|
+
"status": "accepted",
|
|
60
|
+
"reason": "当前源码证实这项业务规则。",
|
|
61
|
+
"evidence": [
|
|
62
|
+
{ "kind": "source", "reference": "src/orders/place-order.ts" }
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"mapChange": {
|
|
67
|
+
"owningMapPath": "docs/business-map/commerce.yaml",
|
|
68
|
+
"mergedCommit": "实际合入提交的完整十六进制编号"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
示例中的提交号必须替换为真实值。`accepted`、`refined` 要求 `mapChange`;全部为 `discarded`、`unresolved` 时省略。每条来源只出现一次,带明确理由和至少一条当前证据。
|
|
74
|
+
|
|
75
|
+
通过标准输入提交 `semantic-atlas observe maintenance --stdin --repo <repository-root>`。首次成功为 `recorded`,同一完整文档重试为 `idempotent`;ID 相同但内容变化为冲突。合入已成功但观察失败时保留合入结果,用同一文档重试,不能声称这项历史记录已完成校准;该状态不阻断已经验证的代码与流程交付。
|
|
76
|
+
|
|
77
|
+
最后按需要重读候选结果:`accepted`、`refined`、`discarded` 来源不再可行动;`unresolved` 保留为待新证据,不立即重复处理。`waitingForEvidenceOccurrences` 统计这些来源;相同领域、种类与摘要出现新来源后,再连同旧历史进入行动集合。
|
package/README.md
CHANGED
|
@@ -6,19 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
English | [简体中文](README.zh-CN.md)
|
|
8
8
|
|
|
9
|
-
Semantic Atlas
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Scenario flows add business-relevant actions, decisions, branches, and outcomes
|
|
13
|
-
to the same documents. The CLI validates the map, returns a small neighborhood
|
|
14
|
-
and its related flows for investigation, and renders both views for people.
|
|
9
|
+
Semantic Atlas 用流程图帮助人和 AI 共同理解业务。AI 根据源码、文档与运行证据维护
|
|
10
|
+
Git 中的业务资料,人通过只读画布检查流程、分支与结果,并逐层进入细节。
|
|
11
|
+
总览和子图统一为业务流程图;业务归属、源码锚点与查询为 AI 提供调查入口。
|
|
15
12
|
|
|
16
13
|
The map is deliberately advisory. It helps an agent enter through the right
|
|
17
14
|
business boundary; current source, tests, tracked product documents, and
|
|
18
15
|
required runtime evidence still decide what the system does now.
|
|
19
16
|
The installed Skill activates from business-changing task meaning, so a
|
|
20
17
|
repository without a map still receives the same bounded business-understanding
|
|
21
|
-
workflow and
|
|
18
|
+
workflow and updates affected business flows in the same branch.
|
|
22
19
|
|
|
23
20
|
## Install
|
|
24
21
|
|
|
@@ -30,10 +27,9 @@ semantic-atlas setup
|
|
|
30
27
|
semantic-atlas --version
|
|
31
28
|
```
|
|
32
29
|
|
|
33
|
-
`setup`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
version. It refuses to replace an unrelated or obsolete same-named directory.
|
|
30
|
+
`setup` 安装一个统一的 `semantic-atlas` Skill 到 `~/.agents/skills/semantic-atlas`,
|
|
31
|
+
负责理解业务、核实证据、编写和维护流程图。重复运行会校验、修复或升级受管副本,
|
|
32
|
+
无关同名目录受到保护。
|
|
37
33
|
|
|
38
34
|
## Upgrade
|
|
39
35
|
|
|
@@ -42,9 +38,7 @@ semantic-atlas upgrade
|
|
|
42
38
|
```
|
|
43
39
|
|
|
44
40
|
`upgrade` resolves npm's current stable version, installs that exact package,
|
|
45
|
-
verifies the installed CLI identity, and
|
|
46
|
-
managed Skills. The executable and Skills therefore move as one versioned
|
|
47
|
-
product.
|
|
41
|
+
verifies the installed CLI identity, and synchronizes the single managed Skill.
|
|
48
42
|
|
|
49
43
|
### Skill conflicts
|
|
50
44
|
|
|
@@ -59,14 +53,12 @@ Missing, unreadable, malformed, obsolete, or mismatched markers remain protected
|
|
|
59
53
|
|
|
60
54
|
When `upgrade` reports `UPGRADE_FAILED` with `step: "setup"`, the target CLI has
|
|
61
55
|
already passed version verification, but Skill synchronization is incomplete.
|
|
62
|
-
The nested setup error identifies the conflicting `directory`.
|
|
63
|
-
are synchronized in order, so the first may already be current when the second
|
|
64
|
-
conflicts. Resolve the named directory, then retry `semantic-atlas setup` using
|
|
56
|
+
The nested setup error identifies the conflicting `directory`. Resolve the named directory, then retry `semantic-atlas setup` using
|
|
65
57
|
the same Node/npm installation; another package upgrade is not needed for this
|
|
66
58
|
recovery.
|
|
67
59
|
|
|
68
60
|
Inspect the exact directory named in the error. This Linux/macOS example uses
|
|
69
|
-
the
|
|
61
|
+
the managed Skill; substitute the `.backup` path when that is
|
|
70
62
|
the reported conflict:
|
|
71
63
|
|
|
72
64
|
```bash
|
|
@@ -140,8 +132,7 @@ anchors:
|
|
|
140
132
|
description: Confirm inventory and create a durable customer order.
|
|
141
133
|
```
|
|
142
134
|
|
|
143
|
-
`context` retains both fields
|
|
144
|
-
`src/orders/place-order.service.ts#PlaceOrderService.execute`. The Agent locates
|
|
135
|
+
`context` retains both fields. The business-facing Viewer hides source anchors. The Agent locates
|
|
145
136
|
the current method using normal repository tools and confirms its behavior.
|
|
146
137
|
Existing file references and unbound symbols remain compatible; maintenance
|
|
147
138
|
can refine them when current evidence establishes a more precise business entry.
|
|
@@ -150,13 +141,18 @@ can refine them when current evidence establishes a more precise business entry.
|
|
|
150
141
|
|
|
151
142
|
```bash
|
|
152
143
|
semantic-atlas validate --repo /path/to/repository
|
|
153
|
-
semantic-atlas search "order confirmation notification" --repo /path/to/repository
|
|
144
|
+
semantic-atlas search "order confirmation notification" --flows --repo /path/to/repository
|
|
145
|
+
semantic-atlas flows "engagement.notifications.confirm-order-flow" --repo /path/to/repository
|
|
154
146
|
semantic-atlas context "engagement.notifications.send-order-confirmation" --repo /path/to/repository
|
|
155
147
|
semantic-atlas render --repo /path/to/repository --output ./business-map.html
|
|
156
148
|
semantic-atlas project add /path/to/repository
|
|
157
149
|
semantic-atlas web
|
|
158
150
|
```
|
|
159
151
|
|
|
152
|
+
从多项目工作空间调用时,将 `--repo` 指向实际要修改的子仓库。流程与源码保留在同一
|
|
153
|
+
仓库,锚点相对该仓库解析;跨项目任务分别查询。省略参数只读取当前目录,不递归扫描
|
|
154
|
+
子项目,不能根据工作空间根目录的空结果判断子项目没有图。
|
|
155
|
+
|
|
160
156
|
`validate` checks every map document as one graph. `search` ranks up to five
|
|
161
157
|
concepts of any business-node kind for a natural-language query. Each result
|
|
162
158
|
includes a query-relative score, stable ID, node kind, and the fields that
|
|
@@ -165,18 +161,18 @@ containment, direct incoming and outgoing relationships, related concepts,
|
|
|
165
161
|
source-navigation anchors, and complete related flows in a versioned JSON
|
|
166
162
|
envelope. Existing exact and partial `context` selectors remain supported.
|
|
167
163
|
`render` produces a deterministic, self-contained interactive HTML Viewer from
|
|
168
|
-
that same normalized map.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
164
|
+
that same normalized map.
|
|
165
|
+
|
|
166
|
+
AI 按业务问题直接定位流程:已知编号时直接 `flows <flow-id>`,未知时用
|
|
167
|
+
`search "<业务描述>" --flows` 返回相关流程,再读取该图的步骤、子流程与具体代码锚点。
|
|
168
|
+
`context <concept-id>` 可以补看业务规则、数据和协作。没有必须先读总览的顺序。
|
|
169
|
+
搜索使用业务名称、别名、步骤和说明做词面匹配,AI 仍需判断业务含义,不能把分数当成证据。
|
|
170
|
+
|
|
171
|
+
人通过画布阅读。所有页面统一为流程图;节点角标直接进子流程,多目标先选择。
|
|
172
|
+
正文有备注才打开默认关闭的说明,说明中没有进入按钮。“上一层”沿实际来路返回。
|
|
173
|
+
“查看其他流程”按父子流程逐列展开,单项目名不重复显示。源码与 AI 编排理由在界面隐藏。
|
|
174
|
+
|
|
175
|
+
没有 `flows` 时显示空状态。可运行[订单管理阅读样例](examples/订单管理/README.md)。
|
|
180
176
|
|
|
181
177
|
`project add [path]` validates the complete business map and saves its
|
|
182
178
|
normalized checkout path in the versioned user-local
|
|
@@ -228,40 +224,28 @@ For a business-changing engineering task:
|
|
|
228
224
|
6. Let current evidence override missing, stale, or contradicted map knowledge.
|
|
229
225
|
7. Implement, verify, and recheck the affected business paths through the
|
|
230
226
|
repository's normal engineering workflow.
|
|
231
|
-
8.
|
|
232
|
-
separate maintenance change; a no-change decision is a complete result.
|
|
227
|
+
8. 业务行为变化时,在同一分支同步代码与流程,一起验证和合入;纯实现调整不强制改图。
|
|
233
228
|
|
|
234
229
|
The final engineering conclusion is expected to be more accurate than the map
|
|
235
230
|
that helped locate it.
|
|
236
231
|
|
|
237
232
|
## Agent Skills
|
|
238
233
|
|
|
239
|
-
`semantic-atlas setup`
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
current-evidence understanding workflow, including relevant flow branches,
|
|
243
|
-
with or without an existing map.
|
|
244
|
-
- `semantic-atlas-maintenance` creates, extends, corrects and reconciles maps
|
|
245
|
-
through one evidence-based business-ownership workflow and normal Git review.
|
|
234
|
+
`semantic-atlas setup` 只安装一个 `semantic-atlas` Skill。它根据当前任务先理解业务、
|
|
235
|
+
核实源码与运行证据,再决定实现、编写流程或维护共享资料;相关方法按需读取。
|
|
236
|
+
理解、画图与维护使用同一份业务知识,不再交接给另一个 Skill。
|
|
246
237
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
roots. Shared concepts are defined once and referenced across files. A bounded
|
|
251
|
-
request or a single-business project can use one file. These rules govern both
|
|
252
|
-
initialization and later maintenance. Ordinary candidate reconciliation remains
|
|
253
|
-
one confirmed domain and its owning file; necessary multi-file ownership
|
|
254
|
-
corrections use a complete reviewed authoring change with accurate separate
|
|
255
|
-
candidate accounting. Direct authoring needs no retained candidate.
|
|
238
|
+
所有图都用 `flows` 显式编写。总览交代主要路径与条件,子流程解释具体环节,
|
|
239
|
+
`part_of` 继续表达所有权,不作为执行顺序。旧用户目录中的 maintenance Skill
|
|
240
|
+
不由本次源码改动自动清理;本产品的新安装只提供统一入口。
|
|
256
241
|
|
|
257
|
-
|
|
258
|
-
|
|
242
|
+
业务代码和相关流程在同分支一起修改、检查、评审与合入。合并冲突按最终代码的业务
|
|
243
|
+
行为重新梳理,不机械拼接图文件。只有实现组织变化时无需重画。旧业务文件不要求兼容,
|
|
244
|
+
新版发布后再按新契约重写,当前不迁移其他项目。
|
|
259
245
|
|
|
260
246
|
## Accuracy Observations
|
|
261
247
|
|
|
262
|
-
|
|
263
|
-
business map. Independent review records separate review evidence, and a
|
|
264
|
-
reviewed maintenance run records what happened to each exact candidate origin:
|
|
248
|
+
观察与候选工具保留为明确请求下的历史资料操作,不属于普通开发的默认步骤:
|
|
265
249
|
|
|
266
250
|
```bash
|
|
267
251
|
semantic-atlas observe task --stdin --repo /path/to/repository
|
|
@@ -270,19 +254,7 @@ semantic-atlas observe maintenance --stdin --repo /path/to/repository
|
|
|
270
254
|
semantic-atlas insights summary --repo /path/to/repository --period 4w
|
|
271
255
|
```
|
|
272
256
|
|
|
273
|
-
|
|
274
|
-
classifications, candidate map corrections, and explicit human corrections. An
|
|
275
|
-
eligible correction can target a node, relation, anchor, or flow. An empty
|
|
276
|
-
candidate list is valid when knowledge is already represented,
|
|
277
|
-
implementation-local, or unresolved. The task never grades its own accuracy.
|
|
278
|
-
An independent review observation owns correctness, impact, required-rework,
|
|
279
|
-
and map-regression judgments. A maintenance observation records `accepted`,
|
|
280
|
-
`refined`, `discarded`, or `unresolved` results only after review and
|
|
281
|
-
integration. IDs are immutable: an exact replay is idempotent and changed
|
|
282
|
-
content conflicts.
|
|
283
|
-
|
|
284
|
-
See [accuracy observations](docs/observations.md) for the schemas and evidence
|
|
285
|
-
semantics.
|
|
257
|
+
具体不可变记录与重放语义见[观察契约](docs/observations.md)。
|
|
286
258
|
|
|
287
259
|
## Reconciliation
|
|
288
260
|
|
|
@@ -291,26 +263,8 @@ semantic-atlas reconcile status --repo /path/to/repository
|
|
|
291
263
|
semantic-atlas reconcile candidates --repo /path/to/repository
|
|
292
264
|
```
|
|
293
265
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
candidate details, Review evidence, and business-domain selection inside the
|
|
297
|
-
maintenance workflow. This is the narrow orchestration contract.
|
|
298
|
-
|
|
299
|
-
`reconcile candidates` returns current actionable candidates by explicit
|
|
300
|
-
business-domain ownership while preserving each origin, evidence disposition,
|
|
301
|
-
linked independent review, and earlier unresolved investigation. Accepted, refined,
|
|
302
|
-
and discarded origins are terminal. An unresolved origin waits for new evidence
|
|
303
|
-
instead of immediately producing the same task again. Both commands are read-only.
|
|
304
|
-
The maintenance Skill then confirms one domain against current evidence,
|
|
305
|
-
submits any accepted map correction through an ordinary Git diff and independent
|
|
306
|
-
review, and records the reviewed outcome after integration. When no map exists,
|
|
307
|
-
a supported candidate can seed one bounded business-domain YAML instead of a
|
|
308
|
-
repository-wide taxonomy.
|
|
309
|
-
Flow candidates are checked as stable business paths rather than copied
|
|
310
|
-
implementation control flow.
|
|
311
|
-
Post-integration maintenance is the normal freshness path; periodic
|
|
312
|
-
reconciliation recovers missed observations, accumulated drift, and changes
|
|
313
|
-
outside the normal engineering workflow.
|
|
266
|
+
这些只读命令查询已有的历史候选,只有明确要求时使用。正常流程维护随代码变化,
|
|
267
|
+
不先生成候选,不等待代码合入。业务仓库只共享版本控制中的资料。
|
|
314
268
|
|
|
315
269
|
## Local Data And Privacy
|
|
316
270
|
|