semantic-atlas 3.0.0 → 4.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.
Files changed (64) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +25 -7
  2. package/.agents/skills/semantic-atlas/agents/openai.yaml +2 -2
  3. package/.agents/skills/semantic-atlas/references/boundary-design.md +9 -3
  4. package/.agents/skills/semantic-atlas/references/diagram-design.md +45 -13
  5. package/.agents/skills/semantic-atlas/references/map-authoring.md +61 -49
  6. package/README.md +16 -4
  7. package/README.zh-CN.md +17 -6
  8. package/dist/cli/localized-command.js +4 -0
  9. package/dist/cli/localized-command.js.map +1 -1
  10. package/dist/cli/run-cli.d.ts +2 -0
  11. package/dist/cli/run-cli.d.ts.map +1 -1
  12. package/dist/cli/run-cli.js +80 -14
  13. package/dist/cli/run-cli.js.map +1 -1
  14. package/dist/contracts/cli.d.ts +6 -1
  15. package/dist/contracts/cli.d.ts.map +1 -1
  16. package/dist/contracts/flow-navigation.d.ts +1 -1
  17. package/dist/contracts/flow-navigation.d.ts.map +1 -1
  18. package/dist/contracts/map.d.ts +5 -4
  19. package/dist/contracts/map.d.ts.map +1 -1
  20. package/dist/contracts/map.js +3 -1
  21. package/dist/contracts/map.js.map +1 -1
  22. package/dist/contracts/project.d.ts +13 -0
  23. package/dist/contracts/project.d.ts.map +1 -1
  24. package/dist/i18n/index.d.ts +14 -0
  25. package/dist/i18n/index.d.ts.map +1 -1
  26. package/dist/i18n/locales/en/cli.d.ts +3 -0
  27. package/dist/i18n/locales/en/cli.d.ts.map +1 -1
  28. package/dist/i18n/locales/en/cli.js +5 -2
  29. package/dist/i18n/locales/en/cli.js.map +1 -1
  30. package/dist/i18n/locales/en/errors.d.ts +4 -0
  31. package/dist/i18n/locales/en/errors.d.ts.map +1 -1
  32. package/dist/i18n/locales/en/errors.js +5 -1
  33. package/dist/i18n/locales/en/errors.js.map +1 -1
  34. package/dist/i18n/locales/zh-CN/cli.d.ts +3 -0
  35. package/dist/i18n/locales/zh-CN/cli.d.ts.map +1 -1
  36. package/dist/i18n/locales/zh-CN/cli.js +5 -2
  37. package/dist/i18n/locales/zh-CN/cli.js.map +1 -1
  38. package/dist/i18n/locales/zh-CN/errors.d.ts +4 -0
  39. package/dist/i18n/locales/zh-CN/errors.d.ts.map +1 -1
  40. package/dist/i18n/locales/zh-CN/errors.js +5 -1
  41. package/dist/i18n/locales/zh-CN/errors.js.map +1 -1
  42. package/dist/index.d.ts +2 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/map/business-flow-validator.js +21 -7
  46. package/dist/map/business-flow-validator.js.map +1 -1
  47. package/dist/map/map-validator.js +2 -0
  48. package/dist/map/map-validator.js.map +1 -1
  49. package/dist/projects/project-directory.d.ts +15 -0
  50. package/dist/projects/project-directory.d.ts.map +1 -0
  51. package/dist/projects/project-directory.js +119 -0
  52. package/dist/projects/project-directory.js.map +1 -0
  53. package/dist/rendering/flow-projector.js +1 -1
  54. package/dist/rendering/flow-projector.js.map +1 -1
  55. package/dist/web/local-web-application.d.ts.map +1 -1
  56. package/dist/web/local-web-application.js +6 -31
  57. package/dist/web/local-web-application.js.map +1 -1
  58. package/docs/architecture.md +28 -3
  59. package/docs/evaluation.md +29 -0
  60. package/docs/map-format.md +24 -12
  61. package/docs/product-contract.md +18 -12
  62. package/examples//350/256/242/345/215/225/347/256/241/347/220/206/README.md +3 -2
  63. package/examples//350/256/242/345/215/225/347/256/241/347/220/206/docs/business-map/orders.yaml +24 -15
  64. package/package.json +1 -1
@@ -1,21 +1,17 @@
1
1
  import { t } from "../i18n/index.js";
2
- import { createHash } from "node:crypto";
3
- import path from "node:path";
4
2
  import { MapApplication } from "../application/map-application.js";
3
+ import { createProjectCatalog } from "../projects/project-directory.js";
5
4
  import { renderWebViewerPage, toViewerProjectPayload, } from "../rendering/viewer-page.js";
6
5
  export class LocalWebApplication {
7
6
  mapApplication;
8
7
  projects;
9
8
  constructor(mapApplication, repositoryPaths) {
10
9
  this.mapApplication = mapApplication;
11
- const normalizedPaths = [
12
- ...new Set(repositoryPaths.map((repositoryPath) => path.resolve(repositoryPath))),
13
- ];
14
- this.projects = Object.freeze(disambiguateProjectNames(normalizedPaths.map((repositoryPath) => ({
15
- id: projectId(repositoryPath),
16
- name: path.basename(repositoryPath),
17
- repositoryPath,
18
- }))));
10
+ this.projects = Object.freeze(createProjectCatalog(repositoryPaths).map((project) => ({
11
+ id: project.id,
12
+ name: project.displayName,
13
+ repositoryPath: project.repositoryPath,
14
+ })));
19
15
  }
20
16
  get repositoryCount() {
21
17
  return this.projects.length;
@@ -47,27 +43,6 @@ export class LocalWebApplication {
47
43
  };
48
44
  }
49
45
  }
50
- function projectId(repositoryPath) {
51
- return createHash("sha256")
52
- .update("semantic-atlas-web-project-v1\0")
53
- .update(repositoryPath)
54
- .digest("hex")
55
- .slice(0, 24);
56
- }
57
- function disambiguateProjectNames(projects) {
58
- const totals = new Map();
59
- for (const project of projects) {
60
- totals.set(project.name, (totals.get(project.name) ?? 0) + 1);
61
- }
62
- const occurrences = new Map();
63
- return projects.map((project) => {
64
- if ((totals.get(project.name) ?? 0) < 2)
65
- return project;
66
- const occurrence = (occurrences.get(project.name) ?? 0) + 1;
67
- occurrences.set(project.name, occurrence);
68
- return { ...project, name: `${project.name} (${occurrence})` };
69
- });
70
- }
71
46
  function safeUnavailableMessageKey(code) {
72
47
  if (code === "MAP_NOT_FOUND")
73
48
  return "errors.projectMapMissing";
@@ -1 +1 @@
1
- {"version":3,"file":"local-web-application.js","sourceRoot":"","sources":["../../src/web/local-web-application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EACL,mBAA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> -> one validated projection
87
87
  The tracked documents and their Git history are the shared product state. Each
88
88
  map load creates an in-memory graph for its own invocation. Rendering and future
89
89
  local acceleration remain derived behavior around that same graph. The
90
- user-local project list supplies only checkout selection and never becomes a
90
+ user-local project list supplies checkout selection and never becomes a
91
91
  second graph or map-authoring source.
92
92
 
93
93
  ## Stable Responsibilities
@@ -109,8 +109,10 @@ malformed anchors. It owns deterministic validity, not current-source truth.
109
109
  ### BusinessFlowValidator
110
110
 
111
111
  Validates scenario ownership, flow and step identity, concept and transition
112
- references, action/decision/outcome branch shape, and reachability. Cycles are
113
- valid. It owns structural flow coherence while current source and durable
112
+ references, action/decision/outcome branch shape, and reachability from the
113
+ declared entry set. A single entry ID and a nonempty entry list normalize to
114
+ one immutable list. Actions can have multiple unconditional successors;
115
+ decisions retain distinct labeled alternatives. Cycles are valid. It owns structural flow coherence while current source and durable
114
116
  product evidence decide whether the described business path is current.
115
117
 
116
118
  ### BusinessGraph
@@ -147,6 +149,9 @@ ID to `ContextQueryService`.
147
149
  引用其场景的流程先显示,再按节点引用排列子流程。`part_of` 继续表示业务归属,
148
150
  不会生成分类画面或执行箭头。没有流程时提供空状态。
149
151
 
152
+ AI 决定每条流程的业务范围与粒度;产品不补统一起止、不生成跨流程连线,也不把
153
+ 所有根流程自动铺在一张画布中。独立业务通过按需导航分别浏览。
154
+
150
155
  节点进入目标只取引用场景自己拥有的其他流程,排除当前流程。普通相关关系与后代
151
156
  归属不产生深入链接。CLI 的概念、关系、源码锚点和完整地图统计保持其已有含义。
152
157
 
@@ -156,6 +161,10 @@ ID to `ContextQueryService`.
156
161
  卡片、小图标与细色条,子流程节点以叠层样式提示。判断使用淡金卡片,不因正文
157
162
  增加而膨胀成大菱形。
158
163
 
164
+ 显式声明的所有入口都采用起点样式;同图的不相连路径和并行连线沿原布局完整投影,
165
+ 不生成共同起点、虚拟判断或汇合节点。它们来自 AI 编写的这一张图,项目内其他流程
166
+ 仍按需读取,不被自动合并到当前画布。
167
+
159
168
  Dagre 确定层级和位置,正交走线保持水平或垂直并使用圆角转折。小箭头与线条同色,
160
169
  分支标签放在对应连接的空白区。服务端预估与浏览器实测共用布局,文字变化后重新
161
170
  测量卡片,完整展示标题、摘要与条件。
@@ -185,6 +194,14 @@ configuration is separate from observations and tracked business-map YAML.
185
194
  `MapApplication` before storing its resolved root. A missing, invalid, or
186
195
  unresolvable map therefore leaves the project file unchanged.
187
196
 
197
+ ### ProjectDirectory
198
+
199
+ 从既有登记路径派生目录名、展示名和路径哈希 ID,不增加持久字段。CLI 的 `project list`
200
+ 返回 `{id, name, displayName, repositoryPath}`;Web 复用同一目录生成名称与 ID,但只
201
+ 向浏览器发送名称和不透明 ID。目录名经 Unicode NFKC、首尾空白和大小写归一后精确
202
+ 匹配,重名返回候选并要求使用 ID。未知名称返回最多五个相近候选,供 AI 判断后明确
203
+ 重试,不自动选中相近项目。路径存在与地图有效性仍由 `MapApplication` 在读取时核实。
204
+
188
205
  ### LocalWebApplication And LocalWebServer
189
206
 
190
207
  `LocalWebApplication` turns one saved or explicit path set into a session-local
@@ -438,6 +455,7 @@ semantic-atlas flows [flow-id] [--repo <path>]
438
455
  semantic-atlas context <id-or-term> [--repo <path>]
439
456
  semantic-atlas render [--repo <path>] [--output <path>]
440
457
  semantic-atlas project add [path]
458
+ semantic-atlas project list
441
459
  semantic-atlas web [--repo <path...>] [--port <port>] [--no-open]
442
460
  semantic-atlas setup
443
461
  semantic-atlas upgrade
@@ -462,6 +480,10 @@ a versioned envelope with a stable success or error discriminant.
462
480
  `search --flows` 直接检索流程及其业务步骤,按流程去重返回命中步骤。`flows <id>`
463
481
  只读取指定图及源码锚点,省略编号时才提供目录。
464
482
 
483
+ `validate`、`search`、`flows`、`context`、`render` 与 `web` 均支持
484
+ `--project <name-or-id>`,从登记目录解析目标,与当前工作目录无关;它与显式 `--repo`
485
+ 互斥。两项均未提供时,地图命令仍使用当前目录,`web` 仍使用完整登记清单。
486
+
465
487
  `search` returns at most five ranked nodes from every business-node kind. A
466
488
  successful empty result means the map has no sufficiently related vocabulary;
467
489
  it is not a repository failure. Each candidate includes `rank`, a `0–1`
@@ -554,6 +576,9 @@ Errors fall into stable categories:
554
576
  shape, normalized absolute-path rule, or uniqueness rule and remains unchanged.
555
577
  - `PROJECT_CONFIG_STORAGE_FAILED`: the project file cannot be read or atomically
556
578
  replaced; the previous complete file remains authoritative.
579
+ - `PROJECT_NOT_FOUND`:没有精确匹配的项目;`selector` 保留原输入,`candidates` 返回
580
+ 相近项目,找不到相近项时为空。
581
+ - `PROJECT_AMBIGUOUS`:多个登记路径具有相同名称;`candidates` 返回候选,使用 ID 重试。
557
582
  - `WEB_START_FAILED`: the registered list cannot be read, the loopback port
558
583
  cannot bind, or the local Viewer cannot start.
559
584
 
@@ -35,6 +35,35 @@ correctness.
35
35
  全库覆盖、长期稳定收益或所有业务的表达质量;本次生成图的浏览器阅读检查因工具问题
36
36
  尚未完成。首次全库重建和日常工程中的后续证据应分别记录。
37
37
 
38
+ 同日修订画图指导后,另一次新上下文试用只接收多业务样本和候选 Skill 的路径,自行
39
+ 调查订单、履约、销售核算并生成 3 份文件、6 条具体流程。它保留独立业务入口与共享
40
+ 下单通知,没有增加统一接收/选择/返回总流程,也没有把履约和销售登记串行化。
41
+ 文件校验、业务查询、渲染和六图浏览器阅读通过;源码缺少持久化、投递调用方和日报
42
+ 日期筛选的部分被明确记为证据缺口。词面搜索“取消订单”仍把收入汇总排在取消流程
43
+ 之前,AI 需按业务含义选择候选;这次试用不证明语义搜索或长期可靠性。
44
+
45
+ 随后用户进一步明确:所有项目的资料都应有能解释整体业务的总览,业务缺口还应驱动
46
+ 跨仓库调查。上述六条独立流程的试用只证明具体路径的表达与核实,不再作为项目整体
47
+ 建图已完成的证据。后续验收还需检查能否从总览讲清全貌、再进入相关细图,以及可访问
48
+ 的前端/其他服务证据是否因仓库边界被遗漏;不要求固定图数、层数或虚构共同起止。
49
+
50
+ 按这一指导进行的新上下文整理试用,把已有六个接口级入口组织为购买交接、客户取消、
51
+ 财务报表三个入口,通过购买旅程展开独立的仓库和财务处理,保留原业务所有者。4 份
52
+ 文件、9 条流程的校验、渲染与导航检查通过,未做浏览器阅读验证。该试用确认当时的
53
+ 流程格式与阅读器无法在同图表达多入口、事件扇出和跨流程状态联系,仍需分图与说明。
54
+ 这证明指导能促使 AI 聚合业务,也暴露软件能力缺口,不能作为完整视觉表达已达标的
55
+ 证据。该限制随后成为本轮软件改动的依据:多入口列表与动作多后继由同一图模型表达,
56
+ 不要求编写者扭曲业务来适应格式。新版本的实际图与阅读验证分别记录。
57
+
58
+ 4.0.0 的新上下文试用从原始材料自行建立一张完整总览与四张规则细图;总览保留下单、
59
+ 取消、收入报告三个入口和已下单事件的两个独立消费者。4 文件/5 流程的校验、搜索、
60
+ 上下层直读、上下文与渲染通过,副本源码未变。该样本没有运行持久化、事件接线或日期
61
+ 筛选;这些缺口均明确保留,试用图本身未做浏览器阅读。
62
+
63
+ 软件的实际浏览另用公开订单样例核对两入口与并行后继,并在私有项目抽查整体总览、
64
+ 多入口触发、细图、返回和菜单选择,页面错误为空。161 项检查及完整发布源门禁通过,
65
+ 源码与业务图分别独立审查。以上不代表所有业务或屏幕尺寸都已运行验收。
66
+
38
67
  ## Accuracy Dimensions
39
68
 
40
69
  ### Business-boundary accuracy
@@ -21,10 +21,11 @@ The first implementation uses this conventional directory. Every `*.yaml` file
21
21
  in the directory participates in one repository-wide graph. File names organize
22
22
  ownership but do not become graph nodes.
23
23
 
24
- 多项目工作空间中的各仓库保留各自的流程文件。查询、校验和渲染通过 `--repo` 指定目标
25
- 仓库,概念与流程 ID 在该仓库加载的图内解析,源码锚点也相对它解析。工作目录可以位于
26
- 父工作空间;省略 `--repo` 只加载当前目录,不递归合并子项目。工作空间项目映射负责
27
- 找到目标仓库,跨项目协作分别读取双方资料并核实真实契约。
24
+ 各仓库保留各自的流程文件。登记后,通过 `project list` 查看项目名称、ID 与路径,查询、
25
+ 校验和渲染使用 `--project <名称或ID>` 选择目标,与当前工作目录无关;也可通过 `--repo`
26
+ 直接指定仓库。两种选择方式互斥,均不提供时只加载当前目录,不递归合并子项目。
27
+ 概念与流程 ID 在选定仓库的图内解析,源码锚点也相对它解析。跨项目协作分别读取双方
28
+ 资料并核实真实契约,不能把一个项目的同名业务当成另一个项目。
28
29
 
29
30
  ## Business Ownership And File Boundaries
30
31
 
@@ -216,14 +217,14 @@ Each flow contains:
216
217
  | `name` | yes | Human-facing scenario path name |
217
218
  | `summary` | yes | Durable business result represented by the flow |
218
219
  | `scenario` | yes | Existing `scenario` node that owns the flow |
219
- | `startsAt` | yes | Entry step ID within the flow |
220
+ | `startsAt` | yes | 一个步骤 ID 或非空步骤 ID 列表,表示真实业务入口;解析与 CLI 输出统一为列表 |
220
221
  | `steps` | yes | One or more business-granularity steps |
221
222
  | `transitions` | yes | Directed step connections and decision labels |
222
223
  | `notes` | no | Durable qualification or known uncertainty |
223
224
 
224
225
  Step kinds are:
225
226
 
226
- - `action`: a meaningful business action with at most one unlabeled next step;
227
+ - `action`:具体业务动作,可有多条无条件后继;多条路径都成立,不表示择一执行;
227
228
  - `decision`: a business choice with at least two uniquely labeled branches;
228
229
  - `outcome`: a business result that ends its path.
229
230
 
@@ -295,8 +296,19 @@ CLI 在上下文查询中保留 `file` 和 `value` 两个字段;面向业务
295
296
 
296
297
  ## 流程图阅读与层次
297
298
 
298
- 所有可视页面使用 `flows`,总览同样是一条显式编写的业务流程。AI 从入口、动作、
299
- 判断、条件与结果组织总览,子流程通过步骤的 `concept` 引用其所属场景进入。
299
+ 所有可视页面使用 `flows`。AI 依据实际业务与阅读需要决定范围、层次与表达;总览
300
+ 概括真实业务动作、条件和交接,不为独立业务补出共同触发或执行关系。子流程
301
+ 通过步骤的 `concept` 引用其所属场景进入。文件字段约定结构,不规定业务的画法。
302
+
303
+ 每个项目的资料应通过一张或几张总览讲清整体业务,再逐步进入细节。只有分散的接口
304
+ 流程并不满足项目建图的阅读目标。源码证据可以分布在多个仓库,图按完整业务组织;
305
+ 本地路径锚点继续相对资料所属仓库,跨项目线索可由 `search` 锚点注明项目和入口。
306
+
307
+ 一条流程可以有多个真实入口,`startsAt` 列出它们;没有执行关系的入口无需补出共同
308
+ 触发或连线。动作有多个无条件后继时,各条路径分别继续,适合表达同一事件的独立
309
+ 消费者。判断的带条件后继仍表示业务选择。多个入口与分支均由 AI 在资料中显式写出,
310
+ 软件不自动补全业务联系。多条线汇入一个步骤不自行声明等待语义;需要等待哪些工作
311
+ 完成,应使用具体动作与说明表达。阅读器负责展示,不执行或模拟流程。
300
312
  `part_of` 只表达业务归属,不推断执行先后;没有 `flows` 的资料仍可被 CLI 查询,
301
313
  阅读器显示空状态。
302
314
 
@@ -326,11 +338,11 @@ The complete repository map must satisfy:
326
338
  12. Normalized graph order is deterministic across file discovery order.
327
339
  13. Flow IDs are repository-wide unique and each flow belongs to an existing
328
340
  `scenario`.
329
- 14. Step IDs are unique within a flow; `startsAt`, transition endpoints, and
330
- optional concept references resolve.
331
- 15. Actions have at most one unlabeled outgoing transition, decisions have at
341
+ 14. Step IDs are unique within a flow; every `startsAt` ID, transition endpoint,
342
+ and optional concept reference resolves. Entry IDs are nonempty and unique.
343
+ 15. Actions have unlabeled outgoing transitions, decisions have at
332
344
  least two uniquely labeled outgoing transitions, and outcomes have none.
333
- 16. Every flow step is reachable from `startsAt`; cycles remain valid.
345
+ 16. Every flow step is reachable from at least one declared entry; cycles remain valid.
334
346
 
335
347
  Horizontal relation endpoints follow their business meaning:
336
348
 
@@ -4,9 +4,10 @@ This page defines the accepted initial product. It answers what Semantic Atlas
4
4
  must improve, how agents and people use it, and which results establish
5
5
  that the product works.
6
6
 
7
- **Status: the public product is released and installed; the current source
8
- candidate adds persistent manual project registration and on-demand Web
9
- loading, while longitudinal acceptance remains in progress.**
7
+ **Status: the behavior below is implemented for 4.0.0, including named-project
8
+ queries, multiple flow entries, unconditional fan-out and overview authoring
9
+ guidance. Exact publication identity lives in the corresponding GitHub Release;
10
+ longitudinal acceptance remains in progress.**
10
11
 
11
12
  ## Purpose
12
13
 
@@ -48,12 +49,10 @@ uses current evidence and is held to a higher accuracy standard than the map.
48
49
 
49
50
  ### Coding agent orientation
50
51
 
51
- An agent receives a feature, bug, refactor, or impact question. It first ranks
52
- mapped concepts from the task's natural business language, selects a stable ID,
53
- and then queries that concept's compact business neighborhood. This probe still
54
- runs when no map documents exist. The agent follows map leads when available,
55
- otherwise establishes the smallest source-supported business boundary, then
56
- opens decisive current evidence before editing.
52
+ Agent 接到功能、缺陷、重构或影响分析任务后,按已知流程或概念 ID 直接读取;只有
53
+ 业务意图时才搜索相关流程。已登记项目可通过 `project list` 与 `--project <名称或ID>`
54
+ 从任意工作目录定位。未登记项目可显式使用 `--repo <路径>`。业务图缺失时,先建立
55
+ 当前任务所需且有源码依据的业务理解;修改前核实会决定结果的当前证据。
57
56
 
58
57
  For a mapped business action, a source-file-bound symbol can point to the
59
58
  specific method or function that carries it. The Agent locates that declaration
@@ -85,9 +84,12 @@ The explicit `web --repo <paths...>` form remains a temporary project set for
85
84
  one session. It neither writes the user-local project file nor implicitly
86
85
  merges registered paths. The browser receives service-assigned project IDs and
87
86
  display names, never repository paths, and cannot submit a filesystem path.
88
- 所有可视页面统一为业务流程图。总览也由 AI 显式编写动作、顺序、判断、条件与结果,
89
- 例如“顾客下单并付款 → 仓库发货 → 按顾客申请进入售后退款”。业务分类和归属继续
90
- 帮助 AI 调查,不能被当成执行顺序,也不能替代总览流程。
87
+ 所有可视页面统一为业务流程图。AI 根据真实业务决定怎样概括、拆分和连接,不套用
88
+ 固定的开始、判断和结束结构。每个项目的资料都应有能讲清整体业务的一张或几张总览,
89
+ 再按真实环节进入细图,例如“顾客下单并付款 → 仓库发货 → 按顾客申请进入售后退款”。
90
+ 细图目录不能代替整体业务理解,独立业务仍保留真实路径。业务跨前端、后端或其他
91
+ 服务时,AI 按缺失环节寻找证据,仓库边界不截断图的业务叙述。软件提供表达、渲染
92
+ 和导航能力,由 AI 组织总览与细节,不自动拼成巨图或推断执行关系。
91
93
 
92
94
  流程节点可以引用场景,进入该场景自己的子流程。没有被其他流程引用的根流程排在
93
95
  前面,默认打开第一条根流程;其余流程通过“查看其他流程”的级联菜单或节点角标进入。没有流程资料
@@ -187,6 +189,10 @@ A flow belongs to one existing scenario and orders business-granularity
187
189
  transitions carry distinct business labels. A step can reference an existing
188
190
  场景概念 ID,从该步骤进入场景自有的子流程,无需第二套链接字段。
189
191
 
192
+ 同一张图支持多个真实业务入口与独立并行后续。`startsAt` 可写一个 ID 或非空列表,
193
+ 解析与 CLI 返回统一为列表;动作的多条无条件后续均成立,判断的条件分支继续按条件
194
+ 选择。软件按显式节点和连线展示,不要求编造共同入口,也不自动推断等待或执行状态。
195
+
190
196
  Flows retain only steps that can change a user-visible result, durable data,
191
197
  cost or provider usage, authorization or tenant isolation, an interface, or a
192
198
  business outcome. They can express stable loops, but they remain advisory
@@ -9,8 +9,9 @@ pnpm build
9
9
  node dist/cli/bin.js web --repo examples/订单管理 --port 4324 --no-open
10
10
  ```
11
11
 
12
- 默认打开“订单全流程”:顾客下单并付款,交给仓库发货;顾客提出退款申请时进入售后,
13
- 没有申请则结束订单旅程。点击下单、发货或售后节点右上角的角标,直接进入子流程。
12
+ 默认打开“订单全流程”:顾客下单付款后,仓库发货与购买确认各自进行;退款申请有自己
13
+ 的起点,交给售后核对。本图显式编写多个入口和并行连线,没有生成共同触发节点。
14
+ 点击下单、发货或售后节点右上角的角标,直接进入子流程。
14
15
  下单流程还可以继续进入支付细图。“查看其他流程”按层级展开;“上一层”沿实际来路恢复。
15
16
 
16
17
  所有图都是流程图;起点、判断、结果与子流程节点有不同样式。资料只由 AI 修改文件。
@@ -50,7 +50,7 @@ nodes:
50
50
  - id: shopping.journey
51
51
  kind: scenario
52
52
  name: 订单全流程
53
- summary: 从顾客下单到仓库发货,再按申请处理售后退款。
53
+ summary: 已付款订单分别进入发货和购买通知;退款申请从自己的入口交给售后。
54
54
  aliases: []
55
55
  anchors: []
56
56
  relations:
@@ -93,9 +93,9 @@ relations:
93
93
  flows:
94
94
  - id: shopping.journey.flow
95
95
  name: 订单全流程
96
- summary: 下单付款后发货;顾客提出退款申请时,进入售后处理。
96
+ summary: 付款后发货与购买通知各自进行;顾客申请退款时,由售后核对处理。
97
97
  scenario: shopping.journey
98
- startsAt: checkout
98
+ startsAt: [checkout, refund-request]
99
99
  steps:
100
100
  - id: checkout
101
101
  kind: action
@@ -108,10 +108,19 @@ flows:
108
108
  name: 仓库发货
109
109
  summary: 核对商品、打包并交给承运商。
110
110
  concept: fulfillment.ship
111
- - id: needs-refund
112
- kind: decision
113
- name: 顾客申请退款吗?
114
- summary: 按顾客的实际申请决定是否进入售后。
111
+ - id: confirmation
112
+ kind: action
113
+ name: 发送购买确认
114
+ summary: 将付款订单的购买凭证发给顾客。
115
+ notes: 发货和购买确认分别处理,任一项不必等候另一项完成。
116
+ - id: notified
117
+ kind: outcome
118
+ name: 顾客收到购买确认
119
+ summary: 购买确认通知流程结束。
120
+ - id: refund-request
121
+ kind: action
122
+ name: 顾客提交退款申请
123
+ summary: 售后申请有独立入口,不要求顾客等待发货流程结束。
115
124
  - id: refund
116
125
  kind: outcome
117
126
  name: 售后退款
@@ -119,19 +128,19 @@ flows:
119
128
  concept: aftersales.refund
120
129
  - id: completed
121
130
  kind: outcome
122
- name: 订单完成
123
- summary: 本次订单无需售后处理。
131
+ name: 包裹已交运
132
+ summary: 仓库完成本次发货。
124
133
  transitions:
125
134
  - from: checkout
126
135
  to: ship
136
+ - from: checkout
137
+ to: confirmation
127
138
  - from: ship
128
- to: needs-refund
129
- - from: needs-refund
130
- to: refund
131
- when: 申请退款
132
- - from: needs-refund
133
139
  to: completed
134
- when: 不申请
140
+ - from: confirmation
141
+ to: notified
142
+ - from: refund-request
143
+ to: refund
135
144
  - id: shopping.checkout.flow
136
145
  name: 提交并支付订单
137
146
  summary: 顾客确认商品后提交订单,付款成功后等待发货。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-atlas",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "面向人与 AI 协作的业务流程图与只读阅读器。",
5
5
  "keywords": [
6
6
  "ai-agents",