semantic-atlas 5.0.0 → 5.2.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 (56) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +48 -22
  2. package/.agents/skills/semantic-atlas/agents/openai.yaml +1 -1
  3. package/.agents/skills/semantic-atlas/references/boundary-design.md +1 -1
  4. package/.agents/skills/semantic-atlas/references/diagram-design.md +55 -16
  5. package/.agents/skills/semantic-atlas/references/map-authoring.md +9 -2
  6. package/.agents/skills/semantic-atlas/references/reconciliation.md +3 -2
  7. package/README.md +192 -243
  8. package/README.zh-CN.md +159 -221
  9. package/dist/cli/run-cli.d.ts.map +1 -1
  10. package/dist/cli/run-cli.js +3 -0
  11. package/dist/cli/run-cli.js.map +1 -1
  12. package/dist/i18n/index.d.ts +12 -0
  13. package/dist/i18n/index.d.ts.map +1 -1
  14. package/dist/i18n/locales/en/cli.d.ts +2 -0
  15. package/dist/i18n/locales/en/cli.d.ts.map +1 -1
  16. package/dist/i18n/locales/en/cli.js +2 -0
  17. package/dist/i18n/locales/en/cli.js.map +1 -1
  18. package/dist/i18n/locales/en/viewer.d.ts +4 -0
  19. package/dist/i18n/locales/en/viewer.d.ts.map +1 -1
  20. package/dist/i18n/locales/en/viewer.js +4 -0
  21. package/dist/i18n/locales/en/viewer.js.map +1 -1
  22. package/dist/i18n/locales/zh-CN/cli.d.ts +2 -0
  23. package/dist/i18n/locales/zh-CN/cli.d.ts.map +1 -1
  24. package/dist/i18n/locales/zh-CN/cli.js +2 -0
  25. package/dist/i18n/locales/zh-CN/cli.js.map +1 -1
  26. package/dist/i18n/locales/zh-CN/viewer.d.ts +4 -0
  27. package/dist/i18n/locales/zh-CN/viewer.d.ts.map +1 -1
  28. package/dist/i18n/locales/zh-CN/viewer.js +4 -0
  29. package/dist/i18n/locales/zh-CN/viewer.js.map +1 -1
  30. package/dist/rendering/flow-projector.js +8 -2
  31. package/dist/rendering/flow-projector.js.map +1 -1
  32. package/dist/rendering/viewer-browser.d.ts.map +1 -1
  33. package/dist/rendering/viewer-browser.js +76 -17
  34. package/dist/rendering/viewer-browser.js.map +1 -1
  35. package/dist/rendering/viewer-layout.d.ts.map +1 -1
  36. package/dist/rendering/viewer-layout.js +81 -13
  37. package/dist/rendering/viewer-layout.js.map +1 -1
  38. package/dist/rendering/viewer-location.d.ts +7 -0
  39. package/dist/rendering/viewer-location.d.ts.map +1 -0
  40. package/dist/rendering/viewer-location.js +16 -0
  41. package/dist/rendering/viewer-location.js.map +1 -0
  42. package/dist/rendering/viewer-page.js +7 -1
  43. package/dist/rendering/viewer-page.js.map +1 -1
  44. package/dist/web/local-web-application.d.ts +1 -0
  45. package/dist/web/local-web-application.d.ts.map +1 -1
  46. package/dist/web/local-web-application.js +14 -0
  47. package/dist/web/local-web-application.js.map +1 -1
  48. package/dist/web/web-command-service.d.ts +1 -0
  49. package/dist/web/web-command-service.d.ts.map +1 -1
  50. package/dist/web/web-command-service.js +4 -2
  51. package/dist/web/web-command-service.js.map +1 -1
  52. package/docs/architecture.md +40 -12
  53. package/docs/evaluation.md +88 -19
  54. package/docs/map-format.md +20 -12
  55. package/docs/product-contract.md +61 -39
  56. package/package.json +1 -1
package/README.md CHANGED
@@ -6,321 +6,270 @@
6
6
 
7
7
  English | [简体中文](README.zh-CN.md)
8
8
 
9
- Semantic Atlas 用流程图帮助人和 AI 共同理解业务。AI 根据源码、文档与运行证据维护
10
- Git 中的业务资料,人通过只读画布检查流程、分支与结果,并逐层进入细节。
11
- 总览和子图统一为业务流程图;业务归属、源码锚点与查询为 AI 提供调查入口。
9
+ **Business flows are a first-class part of building software with AI.**
12
10
 
13
- The map is deliberately advisory. It helps an agent enter through the right
14
- business boundary; current source, tests, tracked product documents, and
15
- required runtime evidence still decide what the system does now.
16
- The installed Skill activates from business-changing task meaning, so a
17
- repository without a map still receives the same bounded business-understanding
18
- workflow and updates affected business flows in the same branch.
11
+ Semantic Atlas gives people and their coding agents a shared place to understand,
12
+ discuss, and maintain how a business works. People read interactive flow diagrams.
13
+ AI edits the underlying files, finds the relevant code, and keeps both together
14
+ as the business changes.
19
15
 
20
- ## Install
16
+ Use it with a coding agent such as Codex or Claude Code. The product provides a
17
+ read-only flow viewer, a local CLI, and one bundled Skill that guides the agent's
18
+ business investigation, drawing, and maintenance.
21
19
 
22
- Semantic Atlas requires Node.js 24 or later. CI verifies Node.js 24 and 26.
20
+ ## Start With The Business
23
21
 
24
- ```bash
25
- npm install --global semantic-atlas --allow-scripts=semantic-atlas
26
- semantic-atlas --version
27
- ```
22
+ As AI writes more code, people need a way to agree on its intended behavior.
23
+ Business flows make the actors, actions, conditions, and outcomes visible so
24
+ engineers and business teams can review the same decisions.
28
25
 
29
- 全局安装自动接入统一的 `semantic-atlas` Skill,并清理已识别的旧维护 Skill。Codex 与
30
- Claude 使用指向 `~/.agents/skills/semantic-atlas` 的共享入口,同事无需分别维护副本。
31
- `--allow-scripts=semantic-atlas` 允许 npm 12 执行本包的安装步骤,不改变全局 npm 配置。
32
- 普通项目依赖安装不会改动用户级 Skill;主动禁用安装脚本时,可运行 `semantic-atlas setup`。
26
+ **Confirmed flows define the business specification. Code implements it. Tests
27
+ and runtime evidence check whether the implementation delivers it.**
33
28
 
34
- ## Upgrade
29
+ When code and a flow disagree, the agent checks the business decision behind the
30
+ rule. The difference may be an implementation defect, an error in the diagram,
31
+ or a change in requirements. Existing code alone is insufficient reason to
32
+ rewrite an agreed rule. Unresolved differences stay explicit.
35
33
 
36
- ```bash
37
- semantic-atlas upgrade
38
- ```
34
+ For a project without flows, the agent investigates the existing implementation
35
+ and drafts them progressively. It distinguishes confirmed requirements from
36
+ current behavior and open questions, revising earlier work as it learns more.
39
37
 
40
- 旧版在 `check` 阶段提示无法取得单一稳定版本时,重新运行上面的全局安装命令即可更新。
41
- 4.1.1 已支持 npm 12 返回的单项版本数组;更新后继续使用 `upgrade`。
38
+ ## People Read, AI Maintains
42
39
 
43
- `upgrade` resolves npm's current stable version, installs that exact package,
44
- verifies the installed CLI identity, and synchronizes the single managed Skill.
45
-
46
- ### Skill conflicts
40
+ | People | AI |
41
+ | --- | --- |
42
+ | Read and explain the business | Investigate the business and its implementation |
43
+ | Follow branches and open local details | Write and reorganize flow source files |
44
+ | Discuss rules and decide intended behavior | Find relevant code and related business flows |
45
+ | Review changes against the agreed flows | Update flows and code in the same branch |
47
46
 
48
- `setup` 和 `upgrade` 使用同一安装流程。`semantic-atlas` 与
49
- `semantic-atlas-maintenance` 是本产品管理的 Skill 名称;当前管理标记或匹配的
50
- `SKILL.md` 身份可识别旧安装。旧格式会被接管并更新,旧维护入口在新 Skill 生效后移除。
47
+ The browser is a read-only canvas. Distinct node styles identify starting
48
+ points, decisions, outcomes, and steps with deeper flows. Click a step's corner
49
+ icon to enter a deeper flow, then use **Previous level** to return. A small
50
+ information marker identifies notes; click the node body to read them.
51
+ Each declared entry has a **Start** badge and a blue outline so readers can find
52
+ where to begin, including flows with multiple entries.
53
+ **Other flows** opens a cascading menu for direct navigation.
51
54
 
52
- `MANAGED_SKILL_CONFLICT` 表示目标目录实为其他 Skill,或没有可识别的本产品身份。
53
- 该目录会保留。需要让出这个位置时,将错误中的确切目录移到所有 Skill 发现目录之外,
54
- 再运行 `semantic-atlas setup`。`upgrade` 若在 `step: "setup"` 失败,已安装的 CLI 保持,
55
- 处理这个目录后重跑 setup 即可,无需重新安装软件。不要手工伪造管理标记。
55
+ Business readers see the process and its explanations. Code file and method
56
+ references remain available to AI through the source files and CLI.
56
57
 
57
- ## Add A Business Map
58
+ ## Install
58
59
 
59
- A target repository owns only its Git-tracked map documents:
60
+ Requires Node.js 24 or later.
60
61
 
61
- ```text
62
- docs/business-map/*.yaml
62
+ ```bash
63
+ npm install --global semantic-atlas --allow-scripts=semantic-atlas
64
+ semantic-atlas --version
63
65
  ```
64
66
 
65
- Start with one file per stable business domain:
66
-
67
- ```yaml
68
- schemaVersion: 1
69
- map:
70
- id: commerce
71
- title: Commerce
72
- summary: Customer-facing product discovery and purchase.
73
-
74
- nodes:
75
- - id: commerce
76
- kind: domain
77
- name: Commerce
78
- summary: Customer-facing product discovery and purchase.
79
- aliases: []
80
- anchors:
81
- - kind: directory
82
- value: src/commerce
83
- description: Likely source entry point for Commerce behavior.
84
-
85
- relations: []
86
- flows: []
87
- ```
67
+ Global installation also installs the unified `semantic-atlas` Skill. Codex and
68
+ Claude share its entry at `~/.agents/skills/semantic-atlas`; recognized older
69
+ maintenance Skills are removed during setup. The npm 12 `--allow-scripts` option
70
+ allows this package's installation step without changing global npm settings.
88
71
 
89
- The [map format](docs/map-format.md) defines supported concepts, relations,
90
- business flows, anchors, validation rules, and lookup behavior.
72
+ ## Create And Read Your First Flows
91
73
 
92
- For an operation implemented by a known method, bind its symbol to the source
93
- file so the Agent can begin with that declaration:
74
+ Ask your coding agent:
94
75
 
95
- ```yaml
96
- anchors:
97
- - kind: symbol
98
- file: src/orders/place-order.service.ts
99
- value: PlaceOrderService.execute
100
- description: Confirm inventory and create a durable customer order.
101
- ```
76
+ > Use Semantic Atlas to map this project's business so I can explain it to a new
77
+ > teammate.
102
78
 
103
- Queries retain both fields with `resolution: "hint"`; they do not guess a declaration's code line.
104
- A missing local path is marked `missing`. The business-facing Viewer hides source anchors.
105
- The Agent locates the current method using normal repository tools and confirms its behavior.
106
- Existing file references and unbound symbols remain compatible; maintenance
107
- can refine them when current evidence establishes a more precise business entry.
79
+ The agent uses the bundled Skill to investigate and write flow source files in
80
+ `docs/business-map/*.yaml`, alongside the project's code and Git history.
81
+ The [Skill](.agents/skills/semantic-atlas/SKILL.md) contains the drawing and
82
+ maintenance guidance; the [file format](docs/map-format.md) defines the fields.
108
83
 
109
- ## Query And Render
84
+ After the files exist, register the project and open the viewer:
110
85
 
111
86
  ```bash
112
- semantic-atlas validate --repo /path/to/repository
113
- semantic-atlas search "order confirmation notification" --flows --repo /path/to/repository
114
- semantic-atlas flows "engagement.notifications.confirm-order-flow" --repo /path/to/repository
115
- semantic-atlas context "engagement.notifications.send-order-confirmation" --repo /path/to/repository
116
- semantic-atlas render --repo /path/to/repository --output ./business-map.html
117
- semantic-atlas project add /path/to/repository
87
+ semantic-atlas project add /path/to/my-app
118
88
  semantic-atlas project list
119
- semantic-atlas search "order confirmation notification" --flows --project repository
120
89
  semantic-atlas web
121
90
  ```
122
91
 
123
- 登记项目后,可从任意目录使用 `--project <项目名称或ID>` 查询。`project list` 返回名称、
124
- 展示名、ID 与实际路径;名称从仓库目录名派生。重名时用 ID,误拼时返回“你是不是在找”
125
- 的候选,由 AI 判断后明确重试。`validate/search/flows/context/render/web` 支持该参数,
126
- 与显式 `--repo` 互斥。也可直接用 `--repo <路径>`,两项均省略时地图命令只读取当前目录。
127
- 流程与源码保留在同一仓库,锚点相对它解析;不同项目分别查询,不递归混合子项目。
128
-
129
- `validate` checks every map document as one graph. `search` ranks up to five
130
- concepts with stable IDs, query-relative scores, matched fields, and current YAML
131
- maintenance locations. The first candidate's ID appears in `contextFor`: only
132
- that candidate has an attached business summary. It remains a lexical candidate
133
- for the Agent to assess; use another candidate's ID with `context` when needed.
134
-
135
- The shared summary returns unique concept details and source anchors, typed
136
- relations with business reasons, and related flow references with step locations.
137
- It covers direct relations and other recorded users of shared data, interfaces,
138
- and invariants. `scope: "recorded"` marks this as investigation evidence to
139
- confirm in source. It does not establish complete change impact.
140
-
141
- `context` retains exact and partial selectors and adds the selected concept,
142
- ancestor IDs and direct child IDs. Related flows remain summaries;
143
- `flows <id>` expands that flow's full local steps and
144
- transitions. Scenario, parent, step concept and child-flow references use IDs;
145
- concept details and anchors appear once in the same response. Query commands
146
- emit compact versioned JSON with only `repository.root`, without a map-file
147
- inventory. Each item's `map` locates its current YAML declaration. See the
148
- [query contract](docs/map-format.md#context-projection) for fields and limits.
149
- `render` produces a deterministic, self-contained interactive HTML Viewer from
150
- that same normalized map.
151
-
152
- AI 按业务问题直接定位流程:已知编号时直接 `flows <flow-id>`,未知时用
153
- `search "<业务描述>" --flows` 返回相关流程及命中步骤的维护位置。`contextFor` 标明
154
- 第一流程候选的关联摘要;另一个候选更合适时按其流程 ID 读取,或用 `scenarioId`
155
- 查询概念上下文。完整步骤与子流程按需读取,没有必须先读总览的顺序。
156
- 搜索使用业务名称、别名、步骤和说明做词面匹配,AI 仍需判断业务含义,不能把分数当成证据。
157
-
158
- 人通过画布阅读。所有页面统一为流程图;节点角标直接进子流程,多目标先选择。
159
- 正文有备注才打开默认关闭的说明,说明中没有进入按钮。“上一层”沿实际来路返回。
160
- “查看其他流程”按父子流程逐列展开,单项目名不重复显示。源码与 AI 编排理由在界面隐藏。
161
-
162
- AI 根据真实业务决定每张图的范围、平级关系与必要详图。项目可以直接提供多张平级
163
- 业务图,无需共同父图或专门的“业务全貌”图。每张图讲清自己的业务,相关主线不拆散,
164
- 独立业务不强行合并;跨项目环节沿实际业务找源码,软件不自动拼图或推断执行关系。
165
-
166
- 同一流程的 `startsAt` 可写多个真实入口;普通动作可以连接多个无条件后续,表示各条
167
- 路径都成立。带条件的选择继续使用判断节点。CLI 的 `startsAt` 统一返回 ID 列表,
168
- 这是 4.0 的公开结果类型变化;原有单 ID 输入仍可读取。详见[格式](docs/map-format.md)。
169
-
170
- 没有 `flows` 时显示空状态。可运行[订单管理阅读样例](examples/订单管理/README.md)。
171
-
172
- `project add [path]` validates the complete business map and saves its
173
- normalized checkout path in the versioned user-local
174
- `~/.semantic-atlas/projects.json` file. Omitting `path` uses the current
175
- directory. Repeating a valid path is idempotent; a missing or invalid map leaves
176
- the file unchanged.
177
-
178
- `web` starts the same Viewer on a read-only `127.0.0.1` server and opens the
179
- default browser. With neither `--repo` nor `--project`, it reads the registered list from any current
180
- directory. An empty list opens an instructional empty state. The initial page
181
- contains only project names and opaque IDs; it loads and validates a map only
182
- when that project is initially selected or selected later. An unavailable path
183
- stays in the list and does not prevent another project from loading.
184
-
185
- Pass several repositories after one `--repo` option for a temporary session:
92
+ Registered projects are available by name or ID from any working directory.
93
+ Names come from checkout directory names: the example above becomes `my-app`.
94
+ For duplicate names, use the ID returned by `project list`. A misspelled project
95
+ name returns suggestions for the agent to assess and retry explicitly.
96
+
97
+ You can also open repositories for a temporary session:
186
98
 
187
99
  ```bash
188
100
  semantic-atlas web --repo /path/to/api /path/to/frontend --port 4310 --no-open
189
101
  ```
190
102
 
191
- Explicit paths are not saved and are not merged with registered projects. The
192
- browser cannot provide arbitrary repository paths and never receives the saved
193
- paths. Reselecting or refreshing a project reloads its tracked YAML.
194
- Repositories with the same directory name receive deterministic numbered
195
- labels without exposing their parent paths. `Ctrl+C` stops the server.
103
+ Temporary paths are not merged with registered projects and are not saved.
104
+ Each project loads its own files. Reselect or refresh a project to read its latest
105
+ flows; press `Ctrl+C` to stop the server. To read an existing flow collection,
106
+ start here; generating new files is only needed when the relevant flows are absent.
107
+
108
+ To try a fictional flow from a source checkout, see the
109
+ [order-management example](examples/订单管理/README.md).
110
+
111
+ ### Open A Specific Flow
112
+
113
+ ```bash
114
+ semantic-atlas web --project my-app --flow "<flow-id>" --no-open
115
+ ```
196
116
 
197
- ## Language
117
+ The command validates the target and returns its full local URL in `data.url`,
118
+ including `#project=<project-id>&flow=<flow-id>`. The agent gives you that link
119
+ to open the exact diagram. For an unregistered project, use a single
120
+ `--repo /path/to/my-app`. With several registered projects, select one explicitly.
198
121
 
199
- The CLI follows your system language (`LC_ALL`, `LC_MESSAGES`, then `LANG`).
200
- Both the Web Viewer and exported HTML follow your browser's language preferences.
201
- English and Simplified Chinese are supported, with English as the fallback.
202
- No language configuration is required for normal use.
122
+ Switching projects or flows updates the URL. Copy it to reopen the same diagram;
123
+ refresh and browser back/forward restore the target. Unknown targets show a
124
+ clear message. Exported HTML uses the same fragment format with its embedded
125
+ project ID.
203
126
 
204
- See [language selection and adding translations](docs/architecture.md#internationalization)
205
- for implementation details and the optional debugging override.
127
+ ## Let The Business Decide The Diagram
206
128
 
207
- ## Evidence Order
129
+ Each diagram should explain a meaningful business process: who wants what,
130
+ which actions and conditions matter, and how the result is used. A project may
131
+ have several peer flows. Keep a coherent process together, and move a complex
132
+ local part into a deeper flow when that helps the reader understand it.
208
133
 
209
- For a business-changing engineering task:
134
+ The agent chooses boundaries and depth from the business. A flow may cross a
135
+ frontend, backend, background job, and another repository; missing parts of the
136
+ story guide the next investigation. Multiple entry points and parallel paths
137
+ can be expressed when the business has them.
210
138
 
211
- 1. Probe the smallest useful map neighborhood whether or not map files exist.
212
- 2. Use returned map knowledge as investigation leads, or build the smallest
213
- source-supported business model after `MAP_NOT_FOUND`.
214
- 3. Trace any related business flow and identify the decisions, branches, and
215
- outcomes that the task can affect.
216
- 4. Confirm every change-controlling claim in current source and tests.
217
- 5. Use tracked product documents for durable intent and runtime evidence for
218
- state-dependent behavior.
219
- 6. Let current evidence override missing, stale, or contradicted map knowledge.
220
- 7. Implement, verify, and recheck the affected business paths through the
221
- repository's normal engineering workflow.
222
- 8. 业务行为变化时,在同一分支同步代码与流程,一起验证和合入;纯实现调整不强制改图。
139
+ Node text states the concrete action or condition concisely. Notes carry longer
140
+ explanations, lists, and the business reasons behind a rule. The agent reviews
141
+ the source files for complete paths, misplaced fragments, unclear language, and
142
+ agreement with the business before handing them over.
223
143
 
224
- The final engineering conclusion is expected to be more accurate than the map
225
- that helped locate it.
144
+ Semantic Atlas manages, searches, validates, and renders these files. The Skill
145
+ teaches how to use those capabilities. The agent decides what to draw and how to
146
+ organize it, using the [flow-design guidance](.agents/skills/semantic-atlas/references/diagram-design.md).
226
147
 
227
- ## Agent Skills
148
+ ## Change The Business And Its Implementation Together
228
149
 
229
- `semantic-atlas setup` 只安装一个 `semantic-atlas` Skill。它根据当前任务先理解业务、
230
- 核实源码与运行证据,再决定实现、编写流程或维护共享资料;相关方法按需读取。
231
- 理解、画图与维护使用同一份业务知识,不再交接给另一个 Skill。
150
+ 1. Locate the relevant business flow and related code.
151
+ 2. Express a changed business rule in the flow before implementing it. When fixing
152
+ code that violates an existing rule, preserve the correct flow.
153
+ 3. Implement and verify the behavior. Check related flows when their conditions,
154
+ outcomes, or collaborators are affected.
155
+ 4. Review and commit the flow and code changes in the same branch.
232
156
 
233
- 所有图都用 `flows` 显式编写。总览交代主要路径与条件,子流程解释具体环节,
234
- `part_of` 继续表达所有权,不作为执行顺序。安装和升级会清理已识别的旧维护 Skill,
235
- 持续提供同一入口。业务资料仍随所属仓库通过 Git 维护。
157
+ Internal refactoring or a comment change can leave the business flow unchanged.
158
+ During a merge, establish the combined business rules first, then check that the
159
+ merged implementation satisfies them.
236
160
 
237
- 业务代码和相关流程在同分支一起修改、检查、评审与合入。合并冲突按最终代码的业务
238
- 行为重新梳理,不机械拼接图文件。只有实现组织变化时无需重画。旧业务文件不要求兼容,
239
- 新版发布后再按新契约重写,当前不迁移其他项目。
161
+ ## Query Business Context For AI
240
162
 
241
- ## Accuracy Observations
163
+ <a id="query-and-render"></a>
242
164
 
243
- 观察与候选工具保留为明确请求下的历史资料操作,不属于普通开发的默认步骤:
165
+ An agent can enter through a known flow or concept ID, or search by business
166
+ intent. It chooses the relevant entry directly; the viewer's hierarchy is for
167
+ human navigation.
244
168
 
245
169
  ```bash
246
- semantic-atlas observe task --stdin --repo /path/to/repository
247
- semantic-atlas observe review --stdin --repo /path/to/repository
248
- semantic-atlas observe maintenance --stdin --repo /path/to/repository
249
- semantic-atlas insights summary --repo /path/to/repository --period 4w
170
+ semantic-atlas search "cancel an order before shipment" --flows --project my-app
171
+ semantic-atlas flows "<flow-id>" --project my-app
172
+ semantic-atlas context "<concept-id>" --project my-app
250
173
  ```
251
174
 
252
- 具体不可变记录与重放语义见[观察契约](docs/observations.md)。
175
+ Use the IDs returned by the query. Results are compact JSON with business rules,
176
+ recorded relationships, related flow references, flow-file locations, and code
177
+ file or symbol anchors. These help the agent find the implementation and the
178
+ flow files affected by a change. Recorded links describe known relationships;
179
+ the agent still traces any missing callers or consumers needed for the task.
180
+
181
+ Search ranks up to five candidates using words in business names, aliases,
182
+ steps, and descriptions. The attached context belongs to the first candidate;
183
+ the agent assesses it and fetches another candidate by ID when appropriate.
184
+ Code symbols are navigation hints, while flow-file line locations point to the
185
+ current declarations to maintain. See the [query contract](docs/map-format.md#context-projection).
253
186
 
254
- ## Reconciliation
187
+ Use `--repo /path/to/my-app` instead of `--project my-app` for an unregistered
188
+ checkout. To validate or export a self-contained interactive HTML file:
255
189
 
256
190
  ```bash
257
- semantic-atlas reconcile status --repo /path/to/repository
258
- semantic-atlas reconcile candidates --repo /path/to/repository
191
+ semantic-atlas validate --project my-app
192
+ semantic-atlas render --project my-app --output ./business-flows.html
259
193
  ```
260
194
 
261
- 这些只读命令查询已有的历史候选,只有明确要求时使用。正常流程维护随代码变化,
262
- 不先生成候选,不等待代码合入。业务仓库只共享版本控制中的资料。
195
+ ## Upgrade
196
+
197
+ ```bash
198
+ semantic-atlas upgrade
199
+ ```
200
+
201
+ This installs the current stable package, verifies the CLI version, and updates
202
+ the bundled Skill together. If an older CLI cannot complete its version check,
203
+ run the global installation command again.
204
+
205
+ <details>
206
+ <summary>Skill installation and conflicts</summary>
207
+
208
+ ### Skill conflicts
209
+
210
+ If installation scripts were disabled, run `semantic-atlas setup`. Installing as
211
+ a project dependency leaves user-level Skills unchanged.
212
+
213
+ `MANAGED_SKILL_CONFLICT` means the destination cannot be identified as a Semantic
214
+ Atlas Skill. Move the reported directory outside agent Skill discovery paths,
215
+ then run `semantic-atlas setup` again. If `upgrade` fails at `step: "setup"`, the
216
+ CLI is already installed; resolve the directory conflict and rerun setup.
217
+
218
+ </details>
263
219
 
264
220
  ## Local Data And Privacy
265
221
 
266
- Business maps stay in the target repository. Accuracy observations stay in
267
- immutable JSON files under a hashed user-local repository partition:
222
+ Flow source files stay in their project repositories. Project registration
223
+ stores local checkout paths in `~/.semantic-atlas/projects.json`. The viewer
224
+ listens on `127.0.0.1`; repository paths stay server-side. Export writes a local
225
+ HTML file to the requested destination. Semantic Atlas works locally without
226
+ an account or telemetry uploads.
227
+
228
+ The CLI follows the terminal's language environment. The viewer and exported
229
+ HTML follow browser language preferences. English and Simplified Chinese are
230
+ supported; see [language selection](docs/architecture.md#internationalization).
268
231
 
269
- ```text
270
- ~/.semantic-atlas/observations/v1/repositories/<repository-id>/
232
+ <details>
233
+ <summary>Optional historical observations and reconciliation</summary>
234
+
235
+ These tools read or record explicit engineering observations. Use them when
236
+ working with retained evidence; ordinary maintenance keeps flows and code
237
+ together in the development branch.
238
+
239
+ ```bash
240
+ semantic-atlas observe task --stdin --repo /path/to/my-app
241
+ semantic-atlas reconcile status --repo /path/to/my-app
242
+ semantic-atlas reconcile candidates --repo /path/to/my-app
271
243
  ```
272
244
 
273
- Observation files contain neither repository paths nor remote URLs. The
274
- separate `~/.semantic-atlas/projects.json` Viewer configuration stores only the
275
- checkout paths the user explicitly registers. Those paths remain server-side
276
- and are never sent to the browser. Semantic Atlas has no remote observation
277
- service, account, telemetry upload, persistent graph database, or automatic
278
- source/map mutation. `setup` and observation commands do not add files to a
279
- target repository; `render` writes only the explicitly requested local output.
280
- `web` binds only to loopback, exposes GET and HEAD, and reads either the
281
- registered list or the explicit temporary `--repo` set.
245
+ See the [observation contract](docs/observations.md) for record formats and
246
+ historical-tool behavior.
247
+
248
+ </details>
282
249
 
283
250
  ## Development
284
251
 
285
- For upstream contributions, forks, and pull requests, start with the
286
- [contribution guide](https://github.com/lzj960515/semantic-atlas/blob/main/CONTRIBUTING.md).
252
+ Read the [contribution guide](https://github.com/lzj960515/semantic-atlas/blob/main/CONTRIBUTING.md)
253
+ for the upstream repository and PR workflow.
287
254
 
288
255
  ```bash
289
256
  pnpm install --frozen-lockfile
290
- pnpm lint
291
- pnpm format:check
292
257
  pnpm release:verify
293
258
  ```
294
259
 
295
- `pnpm lint` runs Oxlint correctness rules and fails on errors or warnings.
296
- `pnpm lint:fix` applies safe lint fixes; `pnpm format` writes Oxfmt formatting,
297
- and `pnpm format:check` checks formatting without changing files. These commands
298
- cover TypeScript source, tests, release and smoke scripts, the bundled Skill
299
- script, and Vitest configuration. Map YAML and Markdown stay outside automatic
300
- formatting. The shared formatter uses two-space indentation, double quotes,
301
- semicolons, trailing commas, and a 100-column print width, while preserving
302
- import order and embedded language content.
303
-
304
- The release-candidate gate runs lint and formatting checks, contract and source
305
- tests, typecheck, build,
306
- rendering checks, packed-tarball privacy checks, an anonymous installed-product
307
- flow, package dry-run, and Git diff validation.
308
-
309
- Publication is a separate operation. After the repository's immutable-release
310
- setting is enabled, a non-prerelease GitHub Release for an annotated version tag
311
- triggers the protected npm workflow. The workflow verifies the specific Release
312
- is immutable in a read-only job before any tag checkout or npm credential
313
- boundary. Only then does the protected publish job repeat the candidate gate
314
- and publish with npm provenance. A separate read-only job verifies public npm
315
- visibility within five minutes and can be rerun without publishing again.
316
-
317
- ## Documentation
260
+ The candidate check covers lint, formatting, tests, types, build, rendering, and
261
+ packaged installation. Public releases use an immutable GitHub Release and the
262
+ protected npm workflow, with npm provenance and independent public-package
263
+ verification. See the [release procedure](https://github.com/lzj960515/semantic-atlas/blob/main/.claude/commands/release.md).
264
+
265
+ ## Further Reading
318
266
 
267
+ - [Unified Skill](.agents/skills/semantic-atlas/SKILL.md)
268
+ - [Flow-design guidance](.agents/skills/semantic-atlas/references/diagram-design.md)
269
+ - [Flow source format and query contract](docs/map-format.md)
319
270
  - [Product contract](docs/product-contract.md)
320
271
  - [Architecture](docs/architecture.md)
321
- - [Map format](docs/map-format.md)
322
- - [Accuracy observations](docs/observations.md)
323
- - [Evaluation](docs/evaluation.md)
272
+ - [Evaluation and its evidence limits](docs/evaluation.md)
324
273
 
325
274
  ## License
326
275