semantic-atlas 2.8.1 → 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 (147) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +113 -281
  2. package/.agents/skills/semantic-atlas/agents/openai.yaml +2 -2
  3. package/.agents/skills/semantic-atlas/references/boundary-design.md +58 -0
  4. package/.agents/skills/semantic-atlas/references/diagram-design.md +172 -0
  5. package/.agents/skills/semantic-atlas/references/map-authoring.md +174 -0
  6. package/.agents/skills/semantic-atlas/references/observations.md +23 -49
  7. package/.agents/skills/semantic-atlas/references/reconciliation.md +77 -0
  8. package/README.md +56 -90
  9. package/README.zh-CN.md +50 -58
  10. package/dist/application/map-application.d.ts +3 -1
  11. package/dist/application/map-application.d.ts.map +1 -1
  12. package/dist/application/map-application.js +59 -0
  13. package/dist/application/map-application.js.map +1 -1
  14. package/dist/cli/localized-command.js +4 -0
  15. package/dist/cli/localized-command.js.map +1 -1
  16. package/dist/cli/run-cli.d.ts +2 -0
  17. package/dist/cli/run-cli.d.ts.map +1 -1
  18. package/dist/cli/run-cli.js +87 -10
  19. package/dist/cli/run-cli.js.map +1 -1
  20. package/dist/contracts/cli.d.ts +14 -2
  21. package/dist/contracts/cli.d.ts.map +1 -1
  22. package/dist/contracts/flow-navigation.d.ts +48 -0
  23. package/dist/contracts/flow-navigation.d.ts.map +1 -0
  24. package/dist/contracts/flow-navigation.js +2 -0
  25. package/dist/contracts/flow-navigation.js.map +1 -0
  26. package/dist/contracts/map.d.ts +10 -9
  27. package/dist/contracts/map.d.ts.map +1 -1
  28. package/dist/contracts/map.js +3 -1
  29. package/dist/contracts/map.js.map +1 -1
  30. package/dist/contracts/project.d.ts +13 -0
  31. package/dist/contracts/project.d.ts.map +1 -1
  32. package/dist/i18n/index.d.ts +36 -196
  33. package/dist/i18n/index.d.ts.map +1 -1
  34. package/dist/i18n/locales/en/cli.d.ts +6 -0
  35. package/dist/i18n/locales/en/cli.d.ts.map +1 -1
  36. package/dist/i18n/locales/en/cli.js +8 -2
  37. package/dist/i18n/locales/en/cli.js.map +1 -1
  38. package/dist/i18n/locales/en/errors.d.ts +5 -0
  39. package/dist/i18n/locales/en/errors.d.ts.map +1 -1
  40. package/dist/i18n/locales/en/errors.js +6 -1
  41. package/dist/i18n/locales/en/errors.js.map +1 -1
  42. package/dist/i18n/locales/en/viewer.d.ts +7 -98
  43. package/dist/i18n/locales/en/viewer.d.ts.map +1 -1
  44. package/dist/i18n/locales/en/viewer.js +14 -105
  45. package/dist/i18n/locales/en/viewer.js.map +1 -1
  46. package/dist/i18n/locales/zh-CN/cli.d.ts +6 -0
  47. package/dist/i18n/locales/zh-CN/cli.d.ts.map +1 -1
  48. package/dist/i18n/locales/zh-CN/cli.js +8 -2
  49. package/dist/i18n/locales/zh-CN/cli.js.map +1 -1
  50. package/dist/i18n/locales/zh-CN/errors.d.ts +5 -0
  51. package/dist/i18n/locales/zh-CN/errors.d.ts.map +1 -1
  52. package/dist/i18n/locales/zh-CN/errors.js +6 -1
  53. package/dist/i18n/locales/zh-CN/errors.js.map +1 -1
  54. package/dist/i18n/locales/zh-CN/viewer.d.ts +7 -98
  55. package/dist/i18n/locales/zh-CN/viewer.d.ts.map +1 -1
  56. package/dist/i18n/locales/zh-CN/viewer.js +14 -105
  57. package/dist/i18n/locales/zh-CN/viewer.js.map +1 -1
  58. package/dist/index.d.ts +3 -1
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js.map +1 -1
  61. package/dist/map/business-flow-validator.js +21 -7
  62. package/dist/map/business-flow-validator.js.map +1 -1
  63. package/dist/map/map-validator.js +2 -0
  64. package/dist/map/map-validator.js.map +1 -1
  65. package/dist/projects/project-directory.d.ts +15 -0
  66. package/dist/projects/project-directory.d.ts.map +1 -0
  67. package/dist/projects/project-directory.js +119 -0
  68. package/dist/projects/project-directory.js.map +1 -0
  69. package/dist/query/concept-search-service.d.ts +1 -1
  70. package/dist/query/concept-search-service.d.ts.map +1 -1
  71. package/dist/query/concept-search-service.js +2 -2
  72. package/dist/query/concept-search-service.js.map +1 -1
  73. package/dist/query/flow-navigation-service.d.ts +16 -0
  74. package/dist/query/flow-navigation-service.d.ts.map +1 -0
  75. package/dist/query/flow-navigation-service.js +96 -0
  76. package/dist/query/flow-navigation-service.js.map +1 -0
  77. package/dist/query/flow-search-service.d.ts +9 -0
  78. package/dist/query/flow-search-service.d.ts.map +1 -0
  79. package/dist/query/flow-search-service.js +69 -0
  80. package/dist/query/flow-search-service.js.map +1 -0
  81. package/dist/rendering/flow-projector.d.ts +1 -0
  82. package/dist/rendering/flow-projector.d.ts.map +1 -1
  83. package/dist/rendering/flow-projector.js +73 -181
  84. package/dist/rendering/flow-projector.js.map +1 -1
  85. package/dist/rendering/map-projector.d.ts +4 -5
  86. package/dist/rendering/map-projector.d.ts.map +1 -1
  87. package/dist/rendering/map-projector.js +12 -289
  88. package/dist/rendering/map-projector.js.map +1 -1
  89. package/dist/rendering/viewer-browser.d.ts.map +1 -1
  90. package/dist/rendering/viewer-browser.js +517 -556
  91. package/dist/rendering/viewer-browser.js.map +1 -1
  92. package/dist/rendering/viewer-diagram.d.ts +3 -5
  93. package/dist/rendering/viewer-diagram.d.ts.map +1 -1
  94. package/dist/rendering/viewer-diagram.js +30 -93
  95. package/dist/rendering/viewer-diagram.js.map +1 -1
  96. package/dist/rendering/viewer-layout.d.ts +9 -5
  97. package/dist/rendering/viewer-layout.d.ts.map +1 -1
  98. package/dist/rendering/viewer-layout.js +107 -52
  99. package/dist/rendering/viewer-layout.js.map +1 -1
  100. package/dist/rendering/viewer-navigation.d.ts +4 -0
  101. package/dist/rendering/viewer-navigation.d.ts.map +1 -0
  102. package/dist/rendering/viewer-navigation.js +8 -0
  103. package/dist/rendering/viewer-navigation.js.map +1 -0
  104. package/dist/rendering/viewer-page.d.ts +12 -28
  105. package/dist/rendering/viewer-page.d.ts.map +1 -1
  106. package/dist/rendering/viewer-page.js +133 -563
  107. package/dist/rendering/viewer-page.js.map +1 -1
  108. package/dist/setup/managed-skill-installer.d.ts +1 -1
  109. package/dist/setup/managed-skill-installer.d.ts.map +1 -1
  110. package/dist/setup/managed-skill-installer.js +1 -1
  111. package/dist/setup/managed-skill-installer.js.map +1 -1
  112. package/dist/setup/package-upgrader.d.ts.map +1 -1
  113. package/dist/setup/package-upgrader.js +1 -4
  114. package/dist/setup/package-upgrader.js.map +1 -1
  115. package/dist/web/local-web-application.d.ts.map +1 -1
  116. package/dist/web/local-web-application.js +6 -31
  117. package/dist/web/local-web-application.js.map +1 -1
  118. package/docs/architecture.md +99 -179
  119. package/docs/evaluation.md +44 -4
  120. package/docs/index.md +9 -2
  121. package/docs/map-format.md +65 -27
  122. package/docs/observations.md +7 -3
  123. package/docs/product-contract.md +76 -103
  124. package/examples//350/256/242/345/215/225/347/256/241/347/220/206/README.md +17 -0
  125. package/examples//350/256/242/345/215/225/347/256/241/347/220/206/docs/business-map/orders.yaml +276 -0
  126. package/package.json +3 -4
  127. package/.agents/skills/semantic-atlas-maintenance/SKILL.md +0 -218
  128. package/.agents/skills/semantic-atlas-maintenance/agents/openai.yaml +0 -4
  129. package/.agents/skills/semantic-atlas-maintenance/references/boundary-design.md +0 -120
  130. package/.agents/skills/semantic-atlas-maintenance/references/map-authoring.md +0 -127
  131. package/.agents/skills/semantic-atlas-maintenance/references/reconciliation.md +0 -149
  132. package/dist/rendering/diagram-image.d.ts +0 -17
  133. package/dist/rendering/diagram-image.d.ts.map +0 -1
  134. package/dist/rendering/diagram-image.js +0 -102
  135. package/dist/rendering/diagram-image.js.map +0 -1
  136. package/dist/rendering/manual-layout.d.ts +0 -4
  137. package/dist/rendering/manual-layout.d.ts.map +0 -1
  138. package/dist/rendering/manual-layout.js +0 -72
  139. package/dist/rendering/manual-layout.js.map +0 -1
  140. package/dist/rendering/map-camera.d.ts +0 -26
  141. package/dist/rendering/map-camera.d.ts.map +0 -1
  142. package/dist/rendering/map-camera.js +0 -54
  143. package/dist/rendering/map-camera.js.map +0 -1
  144. package/dist/rendering/viewer-legend.d.ts +0 -4
  145. package/dist/rendering/viewer-legend.d.ts.map +0 -1
  146. package/dist/rendering/viewer-legend.js +0 -138
  147. package/dist/rendering/viewer-legend.js.map +0 -1
@@ -1,289 +1,121 @@
1
1
  ---
2
2
  name: semantic-atlas
3
- description: Build source-supported business understanding and make maintenance decisions for business-changing engineering tasks, with or without an existing business map. Use for features, bugs, refactors, reviews, and impact analysis to find or establish business boundaries, collaborators, data, invariants, interfaces, business flows, and source entry points before broad discovery, then decide whether stable shared knowledge needs maintenance.
4
- compatibility: Requires Node.js 24+, the semantic-atlas CLI on PATH, and repository source access.
3
+ description: 理解、绘制和维护有源码依据的业务流程。用于功能、缺陷、重构、评审和影响分析中的业务调查,以及新建、修改或重组业务流程图;按业务意图直接定位相关流程与源码,业务行为变化时在同一分支同步代码和相关流程。
4
+ compatibility: 需要 Node.js 24+、PATH 中的 semantic-atlas CLI,以及目标仓库源码。
5
5
  ---
6
6
 
7
7
  # Semantic Atlas
8
8
 
9
- Build the smallest current-evidence business model needed to make an accurate
10
- engineering decision. An existing map is a compact navigation prior. Missing,
11
- incomplete, stale, or contradicted map knowledge changes the discovery route;
12
- it does not remove the need to understand the business boundary.
13
-
14
- Current source, tests, tracked product documents, and required runtime evidence
15
- decide what an engineering change may claim and do. Treat map results as
16
- investigation leads.
17
-
18
- ## Choose The Workflow From The Task
19
-
20
- For an explicit request to create, extend, correct or reorganize a business map,
21
- use `semantic-atlas-maintenance`'s direct-authoring path. Its common business
22
- ownership rules apply to initial maps and every later update. The engineering
23
- workflow below keeps ordinary feature and bug tasks bounded and produces
24
- source-supported candidates for separate canonical maintenance.
25
-
26
- Use this workflow when work can change or depend on business behavior,
27
- ownership, shared data, an invariant, or an interface. This includes feature,
28
- bug, refactor, impact-analysis, and independent-review work whose correct scope
29
- requires business judgment.
30
-
31
- Begin ordinary repository work directly when the task is purely mechanical and
32
- its exact source boundary is already established, such as formatting, a local
33
- rename, or generated-file refresh. This is a complete stopping decision and
34
- produces no shared business-knowledge maintenance work.
35
-
36
- ## Probe Existing Business Knowledge
37
-
38
- 1. Read the task contract and repository instructions. Resolve the repository
39
- root and keep all commands in the task's assigned worktree.
40
- 2. Form one concise business query from the user-visible behavior. Use the
41
- user's natural business language rather than guessing an exact map name.
42
- 3. Before broad source discovery, run the public ranked-search command whether
43
- or not map documents are present:
44
-
45
- ```bash
46
- semantic-atlas search "<business-query>" \
47
- --repo "<absolute-repository-root>"
48
- ```
49
- 4. Read the ordered `data.results`. Every result can represent any mapped node
50
- kind and includes its `rank`, `score`, stable ID, name, kind, and matched
51
- fields. Scores express relative relevance within one query, not correctness
52
- probabilities. Choose the candidate whose business meaning fits the task;
53
- use score and the gap between nearby results as ranking evidence rather than
54
- as a substitute for task meaning.
55
- 5. Query the chosen candidate's stable ID through the public context command:
56
-
57
- ```bash
58
- semantic-atlas context "<stable-concept-id>" \
59
- --repo "<absolute-repository-root>"
9
+ 让人和 AI 围绕同一份业务流程协作。AI 理解当前业务、核实实现、编写和维护文件;人通过只读界面逐层阅读、讨论和确认。总览与细图统一使用业务流程图。
10
+
11
+ 软件负责管理、组织、搜索和渲染业务资料,提供文件约定、使用方法与画图的最佳实践。
12
+ 具体画什么、业务边界在哪里、怎样概括、拆分和连接,由 AI 根据实际业务与阅读需要
13
+ 自主判断。本 Skill 帮助 AI 作出这些判断,不预设通用业务框架或固定画法。
14
+
15
+ 每个项目的业务资料都应有能讲清整体业务的总览,让读者先理解项目为谁完成什么、
16
+ 主要业务怎样协作,再进入细节。总览可以由一张或几张图组成,范围和画法由真实业务
17
+ 决定;接口级流程的目录不能代替整体理解。业务跨前端、后端或其他项目时,沿缺失的
18
+ 业务环节查找对应源码,把已核实的环节纳入同一业务叙述,不能在当前仓库边界截断。
19
+
20
+ 业务图提供调查线索。当前源码、测试、已跟踪的产品决定和必要的运行证据,决定这次可以作出的结论和改动。业务行为变化时,代码与相关流程在同一分支修改、审阅和提交合入。没有业务变化时,不为代码内部调整重画流程。
21
+
22
+ ## 1. 从任务确定工作范围
23
+
24
+ | 当前请求 | 本次应完成什么 |
25
+ | --- | --- |
26
+ | 功能、缺陷或重构 | 理解受影响业务,核实证据;行为变化时同步实现和相关流程,检查两者一致 |
27
+ | 评审或影响分析 | 对照当前源码与流程判断影响;用户仅授权分析时,报告必要修改而不直接写文件 |
28
+ | 新建、修改或重组流程图 | 完成指定业务范围的调查、流程文件和实际阅读检查 |
29
+ | 已明确源边界的格式化、局部改名等机械任务 | 直接按仓库工作流完成;业务含义保持时不改流程 |
30
+ | 用户明确要求处理历史观察或候选 | 使用文末可选历史工具,不改变正常工程的同步维护方式 |
31
+
32
+ 普通工程任务不意味着重画整个仓库。是否提交、合入、发布或改变数据结构,遵循本次授权和仓库规则;同步代码与图表示一个完整候选,不自动取得发布或生产操作授权。
33
+
34
+ ## 2. 直接定位相关业务与源码
35
+
36
+ 根据任务、工作空间的项目映射和 `AGENTS.md` 确定业务资料的维护位置和调查起点,当前工作目录不一定是目标仓库。仓库用于定位证据,不限定业务范围;根据流程缺少的入口、事件、状态写入或结果使用方,继续定位相关项目。已登记项目优先用 `--project "<name-or-id>"` 查询;已知名称或 ID 时可以直接使用,需要核对时运行 `semantic-atlas project list`,查看 `id`、`name`、`displayName` 和 `repositoryPath`。名称取登记路径的目录名,按大小写、Unicode NFKC 和首尾空白归一后精确匹配;重名时用列表中的 ID 明确选择。
37
+
38
+ `PROJECT_NOT_FOUND` 的相近项目仅是建议,`PROJECT_AMBIGUOUS` 的候选需要消歧。结合任务与 `repositoryPath` 判断目标,再用确切名称或 ID 重试;不能把短名、误拼或第一个候选当成已选中项目。未登记或已有确切路径时,用 `--repo "<目标仓库绝对路径>"`;`--project` 与显式 `--repo` 互斥。查询、校验、渲染和 Web 均可按项目选择,源码锚点始终相对选中仓库解析。CLI 不递归发现子仓库的业务图,多仓库任务分别查询,不能用错误根目录的 `MAP_NOT_FOUND` 判断子仓库没有图。
39
+
40
+ 确定目标后,从已经掌握的信息进入相关业务。AI 可以像熟悉系统的程序员一样直达目标,不必每次从总览走完整层级;人的级联浏览菜单不规定 AI 的调查顺序。
41
+
42
+ | 已有信息 | 直接入口 |
43
+ | --- | --- |
44
+ | 已知流程 ID | `semantic-atlas flows "<flow-id>" --project "<name-or-id>"` |
45
+ | 已知业务概念 ID | `semantic-atlas context "<concept-id>" --project "<name-or-id>"` |
46
+ | 只有要完成的业务行为 | `semantic-atlas search --flows "<business-query>" --project "<name-or-id>"`,选命中的流程 ID 再读该层 |
47
+ | 需要补看整体结构或没有合适命中 | 可选用 `semantic-atlas flows --project "<name-or-id>"` 取得根流程与简要目录 |
48
+
49
+ 表中示例选择已登记项目;按路径查询时,将该选项替换为 `--repo "<repository-root>"`。
50
+
51
+ 读取目标流程中的动作、判断、连接条件、结果、子流程和步骤引用概念的源码锚点。当前层已足以判断时直接核实对应源码;只有上层承诺、细节或必要协作会改变结论时,才补看父层、子流程或概念上下文,不展开无关邻域。
52
+
53
+ `search --flows` 根据流程及相关业务文本的词面相似度返回候选,不是向量或语义搜索。不同词汇、同义改写或不同语言可能没有命中;分数只说明这次查询的相关排序。需要概念检索时可用普通 `semantic-atlas search "<business-term>"`,同样按业务含义判断结果,而不是把分数当正确性证明。
54
+
55
+ 从锚点的 `file` 定位文件,再查 `value` 指定的类、方法或函数;打开当前声明和必要调用方,确认实际动作。资料给的是导航与规则线索,当前源码和证据决定行为。
56
+
57
+ | 结果 | 怎样继续 |
58
+ | --- | --- |
59
+ | 取得相关流程或概念 | 核实当前图的规则、源码和必要使用方,不强制补走总览 |
60
+ | 搜索为空或存在歧义 | 使用已知业务词、可选目录或源码入口继续调查;会改变范围且仍无法确定的选择保持待核实 |
61
+ | 项目未找到或项目名称重名 | 核对候选与登记目录,明确项目后再查询;这是项目选择结果,不说明该仓库缺少业务图 |
62
+ | 没有相关流程或 `MAP_NOT_FOUND` | 建立当前任务所需的最小业务模型;行为变更时补写相关流程,不先建完整分类体系 |
63
+ | 流程 ID 不存在 | 按当前目录和源码核对替代路径 |
64
+ | 文件无效或 CLI 不可用 | 说明资料不可用,继续有界源码调查;能在本次范围修正的资料问题一起处理 |
65
+ | 锚点缺失或过期 | 用当前实现找到替代入口,同步修正本次依赖的锚点,保留其他仍成立的业务知识 |
66
+
67
+ 核实谁承诺结果、拥有规则与状态,谁是调用者或协作者。边界不清或需要调整业务资料时,读取[业务边界](references/boundary-design.md)。沿真实生产者、使用方和外部交接确定影响,不以目录或类数量代替业务责任。
68
+
69
+ ## 3. 同步修改实现与受影响流程
70
+
71
+ 从相关流程的起点走到本次可能影响的结果,核对动作、判断、条件分支、停止和恢复对象。重点确认会影响数据、费用、权限、租户隔离、接口和用户结果的路径,只追踪当前任务所需范围。
72
+
73
+ 先区分差异的含义:实现违反已确认规则时修代码,并让图准确表达修复后的支持路径;业务要求改变时同步改代码和流程;源码位置变化时修正必要锚点;仅内部组织变化且业务含义不变时,保留流程。证据冲突且会改变行为时,先确认关键决定。
74
+
75
+ 代码修改与相应流程文件放在同一工作分支。局部条件只改所属细图和直接提到它的说明;入口、结果、重要分支或协作变化时,再检查引用它的上层与相关协作者。不要把必要的图更新留成候选,等合入主分支后才维护。
76
+
77
+ 按仓库工程工作流验证并审阅完整差异,把代码行为和图中的规则、分支、备注与源码锚点一起检查。没有业务变化,或图已完整表达修复后行为时,可以没有结构性图修改,但应说明核对结果。
78
+
79
+ ## 4. 编写流程资料
80
+
81
+ 首次建图或重建较大业务范围时,边分块读取源码边画,不等读完整仓库才写图。按照[流程设计中的持续建图方法](references/diagram-design.md#2-分块调查并持续修正已画流程),把已核实的局部流程及时落盘,记录未覆盖范围;后续证据改变理解时,立即修正或重构已画部分,再继续调查。图和必要状态文件承载外部记忆,当前源码仍负责证实行为。
82
+
83
+ 项目初始化或整体重整,需要把这些分块组织成可讲解的整体业务及可深入的细图;不能
84
+ 交付一串零散接口后就宣布项目建图完成。局部工程任务只更新受影响的总览与细节,
85
+ AI 查代码仍可直接定位具体业务,无需每次从总览开始。
86
+
87
+ 新建图、修图或同步行为变化时:
88
+
89
+ 1. 按[业务边界](references/boundary-design.md)建立当前分块有证据的责任范围与必要协作者,逐块核对源码入口、状态和规则,并随新证据修正边界与已画流程;旧节点列表不构成完整性证明。
90
+ 2. 按[流程设计](references/diagram-design.md)结合实际业务和阅读需要决定范围、粒度、层次、条件与备注。总览和细图都用具体业务动作、决策和结果说明发生什么,连接依据真实先后或条件;分类目录负责导航,独立业务保留各自真实路径,不为统一入口编造共同触发或执行关系。
91
+ 3. 按[文件编写](references/map-authoring.md)使用当前产品格式。复用仍成立的业务身份,共享概念只定义一次。`part_of` 表达归属,不产生执行顺序;总览与细图都由 AI 按真实业务显式编写为 `flows`,步骤通过 `concept` 引用场景的自有流程,形成下层。
92
+ 4. 同一业务责任仍成立时复用其文件;独立新业务有自己的领域和文件。文件数量由真实责任决定。新版格式需要更好的表达时,可以按已确认契约重写既有资料,无需为旧业务文件或旧格式保留兼容分支。
93
+ 5. 源码锚点保留到具体文件、类和方法,供 AI 与 CLI 定位;Web 隐藏这些资料。备注说明业务规则的背景、目的和取舍,不写 AI 怎样安排图的理由。
94
+ 6. 完成结构与阅读检查:
95
+
96
+ ```sh
97
+ semantic-atlas validate --repo "<absolute-repository-root>"
98
+ semantic-atlas render --repo "<absolute-repository-root>" --output "<repository-root>/tmp/business-flow.html"
99
+ git diff --check
100
+ git diff -- docs/business-map/
60
101
  ```
61
102
 
62
- A clear leading candidate proceeds directly. When nearby candidates express
63
- materially different business scopes, compare their names, kinds, and task
64
- meaning before choosing. Ask for clarification only when current task
65
- evidence cannot distinguish a choice that would change the engineering
66
- boundary.
67
- 6. Preserve the original business query, bounded outcome, and selected stable
68
- IDs for the task observation.
69
-
70
- ## Build The Business Model With Or Without A Map
71
-
72
- Route the search and context result into one current-evidence investigation:
73
-
74
- - A successful context result supplies likely business scope and source entry
75
- points. It can also return related business flows in `context.data.flows`.
76
- Open the most decisive anchors first. For a `kind: symbol` anchor with
77
- `file`, use normal repository tools to locate `value` inside that
78
- repository-relative file. For a qualified name such as
79
- `PlaceOrderService.execute`, distinguish the declaring class or type from
80
- same-named methods and call sites. Read the current implementation and
81
- relevant tests, and confirm the business action stated in `description`.
82
- A missing file or declaration follows the stale-anchor route below. Unbound
83
- symbols and other anchor kinds remain useful entry points. Query another
84
- returned stable ID only
85
- when an owner, upstream action, downstream consumer, shared data concept,
86
- invariant, interface, or business-relevant path could change the
87
- implementation scope.
88
- - An empty search result means the repository has a map without sufficiently
89
- related vocabulary. Search current product documents and source using the
90
- original query, likely business synonyms, and directly observed
91
- collaborators.
92
- - Ranked candidates that remain indistinguishable after task-specific
93
- comparison form a bounded ambiguous result. Continue with current evidence
94
- when it can identify the owner; otherwise preserve the unresolved choice.
95
- - `MAP_NOT_FOUND` means the repository has no configured shared business map.
96
- When the map is absent, build the smallest source-supported business model needed for the task.
97
- Start from the user-visible outcome, identify only the owning business scope,
98
- actions, data, rules, and interfaces that current evidence requires, and stop
99
- when the engineering boundary is source-confirmable. Limit this model to
100
- business meaning supported by the current task rather than repository-folder
101
- structure or a complete taxonomy.
102
- - `MAP_DOCUMENT_INVALID`, an unavailable CLI, or an infrastructure failure
103
- makes map knowledge unavailable for this task. Preserve the failure, build
104
- the same bounded current-evidence model, and report observation recording as
105
- unavailable when the CLI boundary cannot accept it.
106
- - A node without anchors still supplies business vocabulary and relations.
107
- Search its name, aliases, neighboring concepts, and interface terms, then
108
- follow current code structure.
109
- - A missing or stale anchor weakens only that navigation hint. Use current
110
- evidence to find the replacement location without discarding unrelated
111
- stable business meaning.
112
-
113
- Record a successful selection as `context` with the original business query
114
- and selected stable ID. Record an empty result as `concept_not_found`, an
115
- unresolved candidate choice as `concept_ambiguous`, and an unavailable search
116
- contract as `unavailable`.
117
-
118
- For a mapless task, the observation query records the bounded outcome:
119
-
120
- ```json
121
- {
122
- "selector": "<business term>",
123
- "outcome": "map_not_found"
124
- }
125
- ```
126
-
127
- ## Confirm The Current-Evidence Model
128
-
129
- Identify who promises the task's outcome and controls its rules/state, then
130
- separate that owner from callers, consumers and infrastructure collaborators.
131
- When ownership or lifecycle coverage is uncertain, read the shared
132
- [boundary-design reference](../semantic-atlas-maintenance/references/boundary-design.md)
133
- and apply its source-to-map coverage and cohesion questions to this task only.
134
- An ordinary engineering task needs a sufficient local model, not a complete
135
- project partition or a map-authoring artifact.
136
-
137
- For every statement that could control the change:
138
-
139
- 1. Open current source or tests that implement or exercise the behavior.
140
- 2. Open the tracked product document when it owns the durable rule or outcome.
141
- 3. Confirm both endpoints of an invocation, shared-data, invariant, publish, or
142
- consume relation when that relation expands the required scope.
143
- 4. Use runtime evidence when the conclusion depends on deployed state rather
144
- than repository behavior.
145
- 5. Classify relevant map hypotheses as confirmed, missing, stale,
146
- contradicted, or unresolved. Let confirmed current evidence control the
147
- task. Keep unresolved statements out of decisive conclusions.
148
-
149
- Trace a downstream symptom toward its confirmed upstream cause before editing.
150
- For shared data or interfaces, inspect every confirmed producer and consumer
151
- needed to preserve the contract. Keep unrelated neighbors outside the change.
152
-
153
- ## Check Relevant Business Flows
154
-
155
- Use each returned flow as a compact hypothesis about the business-relevant
156
- actions, decisions, branches, and outcomes in one scenario. Follow only the
157
- flows and paths that intersect the task; ordinary relation context remains
158
- sufficient when no flow is relevant.
159
-
160
- 1. Before editing, trace each relevant path from `startsAt` through its labeled
161
- decisions to the outcomes that could change. Give special attention to paths
162
- controlling durable data, provider usage or cost, authorization or tenant
163
- isolation, interfaces, and user-visible results.
164
- 2. Confirm every step or branch that controls the engineering decision in
165
- current source, tests, tracked product documents, or required runtime
166
- evidence. Flow order is an investigation lead rather than current execution
167
- truth.
168
- 3. After implementation or review, trace the affected paths again. Check that
169
- preserved branches still reach their intended outcomes and that an intended
170
- product change has a clear durable meaning.
171
- 4. Classify a discrepancy before changing either side:
172
- - repair source when implementation accidentally breaks the confirmed
173
- business path;
174
- - propose a flow update when confirmed product intent changed the durable
175
- business path;
176
- - propose a flow correction when decisive current evidence establishes that
177
- the retained path was already stale;
178
- - preserve the discrepancy as unresolved when available evidence cannot
179
- choose the durable behavior;
180
- - keep the flow unchanged when only implementation structure changed.
181
-
182
- Keep routine parameter validation, DTO conversion, helpers, framework wiring,
183
- and Service or Queue names in source rather than flow steps.
184
-
185
- ## Implement And Verify
186
-
187
- Continue through the repository's normal engineering workflow after the
188
- current-evidence model is clear. Implement the confirmed cause and affected
189
- collaborators, add regression coverage at the public behavior boundary, run
190
- the repository's required checks, and review the final diff against the task
191
- scope.
192
-
193
- Final engineering conclusions identify the business boundary, decisive current
194
- evidence, implementation or review scope, and verification. Phrase map-only
195
- statements as leads or uncertainty rather than current behavior.
196
-
197
- ## Decide Post-Task Business-Knowledge Maintenance
198
-
199
- After the engineering or review result is known, choose one maintenance disposition:
200
-
201
- - `candidate`: current evidence establishes stable business meaning that the
202
- shared map omits or represents incorrectly. Record one or more domain-owned
203
- map-update candidates with decisive evidence. Use `kind: "flow"` when the
204
- durable correction concerns a scenario's actions, decisions, labeled
205
- branches, or outcomes.
206
- - `already_represented`: the shared map still expresses the stable business
207
- meaning needed by the task. Record no candidate.
208
- - `implementation_local`: the result changes only helpers, framework wiring,
209
- source organization, tests, or another non-durable implementation detail.
210
- Record no candidate.
211
- - `unresolved`: available evidence cannot establish durable business identity,
212
- ownership, or relation direction. Preserve the uncertainty without proposing
213
- a canonical edit.
214
-
215
- A no-change disposition is a complete result when current shared knowledge
216
- already represents the durable meaning or the change is implementation-local.
217
- Add concepts, relations, and flows only when current evidence supports their
218
- accuracy. When no relevant flow changed, record no flow candidate.
219
-
220
- For every proposed candidate, identify the actual business responsibility from
221
- its outcomes, owned data/rules, lifecycle and collaborators using the same
222
- boundary-design reference when that ownership needs investigation. Reuse a mapped
223
- domain when that meaning matches; an independently meaningful new business area receives
224
- its own stable `businessDomainId`, even when another domain already has a YAML.
225
- Use narrower capabilities for behavior belonging inside an existing area.
226
- The maintenance Skill rechecks this ownership before choosing files. A required
227
- multi-file ownership correction is explicit authoring/reorganization work,
228
- while retained candidate origins keep their immutable domain identity.
229
-
230
- For mapped and mapless tasks alike, retain only the stable meaning established
231
- by current evidence. Use `unresolved` when the task cannot establish business
232
- identity or ownership. A local engineering task does not imply mapping the
233
- whole repository.
234
-
235
- ## Record Accuracy Evidence
236
-
237
- For business-changing work, read
238
- [references/observations.md](references/observations.md) after the engineering
239
- or review result and verification are known.
240
-
241
- - For engineering and analysis work, record one task observation. It contains
242
- the map-query outcome, selected concepts, current-evidence dispositions,
243
- map-update candidates from a `candidate` maintenance disposition, and any
244
- explicit human correction.
245
- - For independent review, record one review observation that references the
246
- existing task observation and contains the accuracy verdict. Keep the task
247
- observation immutable. When no task observation is available, report the
248
- missing accuracy-evidence link separately from the review verdict.
249
-
250
- Independent review owns accuracy judgments, so task observations contain
251
- investigation evidence rather than correctness verdicts. Generate one stable
252
- observation ID for the run and reuse the same complete document when retrying an
253
- interrupted submission.
254
-
255
- Submit the matching complete JSON document through the installed CLI:
256
-
257
- ```text
258
- semantic-atlas observe task --stdin [--repo <repository-root>]
259
- semantic-atlas observe review --stdin [--repo <repository-root>]
260
- ```
261
-
262
- Report the recorded or idempotent outcome with the engineering result. When
263
- the observation command fails, the engineering result remains unchanged;
264
- report the observation failure separately so review can distinguish delivery
265
- evidence from missing accuracy evidence.
266
-
267
- ## Hand Off Canonical Maintenance
268
-
269
- Keep canonical map editing in a separate maintenance change after stable reviewed source is available.
270
- For this candidate-driven handoff, the `semantic-atlas-maintenance` Skill
271
- rechecks real business ownership using its common authoring rules, then handles
272
- one confirmed domain and owning YAML. Ownership corrections needing multiple
273
- files follow its ordinary reviewed authoring path with accurate separate origin
274
- accounting. Both paths validate the complete graph, inspect the affected Viewer
275
- areas and submit the Git diff for independent review.
276
-
277
- A post-integration maintenance run can examine retained candidates from
278
- business-changing results; an empty or no-change run is successful. Periodic
279
- reconciliation remains a fallback for accumulated drift, missed observations,
280
- and changes outside the normal engineering workflow. The understanding and
281
- maintenance contracts run independently of task orchestrators.
282
-
283
- ## Report The Result
284
-
285
- Report the business boundary, decisive current evidence, engineering scope,
286
- verification, accuracy-observation outcome, and maintenance disposition. For
287
- `candidate`, include the business domain, proposed durable correction, and
288
- evidence. For `already_represented`, `implementation_local`, or `unresolved`,
289
- state the evidence-based reason and record no map-update candidate.
103
+ 打开受影响流程,按实际变化核对必要的上下层进入与返回、主线、关键分支、数量/时间边界和备注。查看实际阅读尺寸下的文字、连线与角标。角标直接进入子流程;点击节点正文只在有业务备注时打开默认关闭的详情,详情不再承担进入操作。无备注的普通节点保持原样。
104
+
105
+ 结构校验证明文件与引用有效,源码证据证明行为,实际阅读证明表达清楚;三者不能互相替代。
106
+
107
+ ## 5. 合并时按最终行为消除冲突
108
+
109
+ 代码与流程图作为同一业务变更提交和合入。审查通过后,按当前授权执行仓库的提交或合并流程;只有本地修改时如实报告候选状态。
110
+
111
+ 遇到分支合并或重放冲突,先理解两边各自改变的规则、入口、结果和协作,再按合并后的代码重审受影响流程。即使文本没有冲突,也要检查两项行为变化叠加后,分支条件、顺序、子流程引用和备注是否仍然成立。不能仅保留两边文字或按格式拼接 YAML。
112
+
113
+ 解决后重跑受影响的业务验证、完整图校验和必要阅读检查,确保合并结果中的实现与流程一致。未取得业务决定或关键证据时,保留具体阻塞,不用测试断言替代决定。
114
+
115
+ ## 6. 可选:已有历史记录
116
+
117
+ 正常工程不要求先生成候选、记录观察或等待主分支更新。只有用户明确要求准确性记录,或要处理已有历史观察和候选时,才读取[观察记录](references/observations.md)与[历史候选校准](references/reconciliation.md),使用已有 `observe`、`reconcile` 命令。它们不替代本次同分支维护,也不阻断代码与流程的交付。
118
+
119
+ ## 7. 交付
120
+
121
+ 说明当前业务边界、关键依据、代码与流程分别改了什么,以及实际验证。没有业务变化或无需结构性改图时给出简短依据。直接画图提供阅读入口与文件;仅分析时说明建议改动。把已核实的覆盖、尚未调查的范围、资料缺口、未完成的运行验证,以及本地修改与实际合入状态分别讲清楚。当前结果已充分验证后结束,不补画无关业务。
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Semantic Atlas"
3
- short_description: "Build current-evidence business context for engineering work"
4
- default_prompt: "Use $semantic-atlas to understand this business-changing task with or without an existing business map, verify it in current evidence, and decide whether shared knowledge needs maintenance."
3
+ short_description: "理解整体业务,绘制总览并同步维护流程"
4
+ default_prompt: "使用 $semantic-atlas 根据已有 ID 或业务意图定位流程;项目建图先讲清业务全貌再深入细节,按业务缺口跨项目查证。业务行为变化时在同一分支同步代码和相关流程,核对实际阅读与行为,合并时按最终代码重审受影响路径。"
@@ -0,0 +1,58 @@
1
+ # 业务边界判断
2
+
3
+ 创建或改变业务划分,或某个所有者、生命周期与协作者可能改变工程结论时读取。本页负责判断业务责任;[文件编写](map-authoring.md)负责表达。按当前范围使用:项目请求核对其业务及必要协作,局部请求核对完整邻域,普通工程任务只建立足以决定改动的模型。代码仓库与业务边界分别判断。
4
+
5
+ ## 先确定责任,再安排流程
6
+
7
+ 一个业务范围承诺一个可理解的结果,拥有让结果成立的规则与状态,并解释这些状态如何建立、使用、改变和结束。同一客户旅程可以跨越多个这样的所有者;调用别人、使用同一张表、出现在同一路径,只能证明协作。
8
+
9
+ 从当前分块的证据建立责任判断,再选择所属文件;后续证据可能要求修改已定边界。对这块已经调查的范围回答:
10
+
11
+ | 问题 | 要取得的证据 |
12
+ | --- | --- |
13
+ | 谁依赖什么结果? | 用户、运营者或其他业务可以依赖的承诺 |
14
+ | 谁决定规则和状态? | 权威记录的含义、允许的变化和判断权 |
15
+ | 生命周期怎样开始与结束? | 真实入口、变更、停止、恢复及重要拒绝/失败路径 |
16
+ | 与谁交换什么? | 输入输出、协作契约、外部所有者与当前仓库的限度 |
17
+ | 哪里证明这些事实? | 当前入口、写入方、规则与测试;会改变边界的缺口 |
18
+
19
+ 简短任务可以把判断留在工作说明里,不必新增文档。以上问题用来检验现有责任,不形成没有业务依据的新功能。
20
+
21
+ ## 独立核对覆盖
22
+
23
+ 先从产品承诺和用户/运营入口发现支持的业务,再用旧图核对。检查会改变当前结论的状态写入、配置与权限所有者、事件/任务/回调和重要分支测试。技术目录帮助定位,不能决定业务划分。
24
+
25
+ 边读边补充覆盖记录,分清已证实、未调查和证据不足;不必等全部业务读完才落图。按需保留一张简表:`场景或生命周期 → 所有者 → 决定性证据 → 对应概念/流程,或省略原因`。协作、实现细节和待核实都可以成为明确的省略理由。已经画出某个节点,不证明覆盖完整。
26
+
27
+ 多个等价入口可以共用一个场景和多个锚点。只有动作具有独立业务判断或结果时才单独建场景。方法数量、CRUD 列表和每个接口一张图都不是完成标准。
28
+
29
+ ## 检验划分是否成立
30
+
31
+ | 可能的问题 | 如何用证据判断 |
32
+ | --- | --- |
33
+ | 过大 | 是否存在能分别交付结果、各自决定规则和状态的责任?分别保留所有者与协作。 |
34
+ | 过碎 | 这些片段是否共同建立、改变或结束同一个结果?保留一个责任,下分能力或场景。 |
35
+ | 遗漏 | 独立发现的入口、状态变化或退出路径是否有重要行为却没有所有者?补到相应层,或记录缺口。 |
36
+ | 放错位置 | 是否仅因调用、消费或目录相同,就放在某业务下面?按规则与生命周期的实际决定者修正归属。 |
37
+
38
+ 共享概念只定义一次,再表达已确认的读写和调用关系。同一物理表可能承担不同业务含义;同义业务也可能由多个技术模块实现。依业务语义保留身份。
39
+
40
+ 通用执行能力如果独立承诺取消、恢复、完成等生命周期,可以有自己的业务责任;辅助转换、队列包装和适配器的可调用方法,不足以证明独立业务。
41
+
42
+ ## 区分归属与阅读范围
43
+
44
+ `part_of` 记录业务归属。总览流程可以引用不同所有者的场景,解释真实存在的端到端旅程,但不把被引用的业务改归总览所有。图的范围与层次由实际业务和阅读需要决定;互不相连的业务保持独立路径,分类与导航不构成执行流程。具体表达见[流程设计](diagram-design.md)。
45
+
46
+ 业务旅程缺少用户入口、前置事件、状态所有者或结果使用方时,按这些缺口定位其他仓库,
47
+ 读取前端页面、调用方、生产者与消费者,补齐整体叙述。源码分在几个项目,不决定业务
48
+ 该拆成几张图,也不证明当前仓库里的半段流程已经自洽。业务资料的维护归属与证据所在
49
+ 项目分别记录;不因一张图包含跨项目协作而改变实际业务所有者。
50
+
51
+ 相关项目可读取时沿业务路径继续核实,不把“跨仓库”当成停止调查的理由。第三方或
52
+ 不可访问部分按已确认接口和必要交接表达,并保留具体缺口,不编造其内部实现。
53
+
54
+ ## 何时结束
55
+
56
+ 当前分块拥有可证实的结果、规则或状态,重要路径及协作在证据边界内可解释时,及时编码为概念和流程,保留仍准确的稳定 ID,继续下一处必要调查。新证据揭示归属错误、遗漏或跨业务交接时,回头重构已画部分,具体方法见[持续建图](diagram-design.md#2-分块调查并持续修正已画流程)。
57
+
58
+ 不确定性会改变归属时,明确记录并只推进有依据的部分。工程调查在行为、所有者和必要协作已足以决定本次改动时结束;画图任务在指定范围的覆盖与完整路径可解释时结束。结构校验和可读性都不能替代业务判断。