semantic-atlas 2.2.0 → 2.3.1

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 (71) hide show
  1. package/README.md +29 -13
  2. package/README.zh-CN.md +21 -9
  3. package/dist/application/map-application.d.ts +2 -1
  4. package/dist/application/map-application.d.ts.map +1 -1
  5. package/dist/application/map-application.js +3 -3
  6. package/dist/application/map-application.js.map +1 -1
  7. package/dist/cli/run-cli.d.ts +2 -0
  8. package/dist/cli/run-cli.d.ts.map +1 -1
  9. package/dist/cli/run-cli.js +40 -3
  10. package/dist/cli/run-cli.js.map +1 -1
  11. package/dist/contracts/cli.d.ts +7 -0
  12. package/dist/contracts/cli.d.ts.map +1 -1
  13. package/dist/contracts/project.d.ts +7 -0
  14. package/dist/contracts/project.d.ts.map +1 -0
  15. package/dist/contracts/project.js +6 -0
  16. package/dist/contracts/project.js.map +1 -0
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/projects/project-registration-service.d.ts +20 -0
  21. package/dist/projects/project-registration-service.d.ts.map +1 -0
  22. package/dist/projects/project-registration-service.js +41 -0
  23. package/dist/projects/project-registration-service.js.map +1 -0
  24. package/dist/projects/project-store.d.ts +20 -0
  25. package/dist/projects/project-store.d.ts.map +1 -0
  26. package/dist/projects/project-store.js +89 -0
  27. package/dist/projects/project-store.js.map +1 -0
  28. package/dist/rendering/flow-projector.d.ts.map +1 -1
  29. package/dist/rendering/flow-projector.js +61 -77
  30. package/dist/rendering/flow-projector.js.map +1 -1
  31. package/dist/rendering/latest-project-loader.d.ts +2 -0
  32. package/dist/rendering/latest-project-loader.d.ts.map +1 -0
  33. package/dist/rendering/latest-project-loader.js +26 -0
  34. package/dist/rendering/latest-project-loader.js.map +1 -0
  35. package/dist/rendering/map-camera.d.ts +1 -0
  36. package/dist/rendering/map-camera.d.ts.map +1 -1
  37. package/dist/rendering/map-camera.js +8 -1
  38. package/dist/rendering/map-camera.js.map +1 -1
  39. package/dist/rendering/map-projector.d.ts.map +1 -1
  40. package/dist/rendering/map-projector.js +46 -73
  41. package/dist/rendering/map-projector.js.map +1 -1
  42. package/dist/rendering/viewer-browser.d.ts.map +1 -1
  43. package/dist/rendering/viewer-browser.js +199 -23
  44. package/dist/rendering/viewer-browser.js.map +1 -1
  45. package/dist/rendering/viewer-diagram.d.ts +8 -0
  46. package/dist/rendering/viewer-diagram.d.ts.map +1 -0
  47. package/dist/rendering/viewer-diagram.js +99 -0
  48. package/dist/rendering/viewer-diagram.js.map +1 -0
  49. package/dist/rendering/viewer-layout.d.ts +40 -0
  50. package/dist/rendering/viewer-layout.d.ts.map +1 -0
  51. package/dist/rendering/viewer-layout.js +79 -0
  52. package/dist/rendering/viewer-layout.js.map +1 -0
  53. package/dist/rendering/viewer-page.d.ts +20 -1
  54. package/dist/rendering/viewer-page.d.ts.map +1 -1
  55. package/dist/rendering/viewer-page.js +149 -36
  56. package/dist/rendering/viewer-page.js.map +1 -1
  57. package/dist/web/local-web-application.d.ts +15 -2
  58. package/dist/web/local-web-application.d.ts.map +1 -1
  59. package/dist/web/local-web-application.js +62 -16
  60. package/dist/web/local-web-application.js.map +1 -1
  61. package/dist/web/local-web-server.d.ts.map +1 -1
  62. package/dist/web/local-web-server.js +46 -8
  63. package/dist/web/local-web-server.js.map +1 -1
  64. package/dist/web/web-command-service.d.ts +4 -2
  65. package/dist/web/web-command-service.d.ts.map +1 -1
  66. package/dist/web/web-command-service.js +6 -2
  67. package/dist/web/web-command-service.js.map +1 -1
  68. package/docs/architecture.md +89 -22
  69. package/docs/map-format.md +6 -0
  70. package/docs/product-contract.md +32 -17
  71. package/package.json +1 -1
@@ -6,8 +6,8 @@ public CLI, renderer, and business-understanding Agent Skill.
6
6
 
7
7
  **Status: query, validation, visual projection, Agent Skills, managed Skill
8
8
  lifecycle, accuracy observations, read-only reconciliation, and public release
9
- verification are implemented. The business-flow extension is implemented in
10
- the current source candidate.**
9
+ verification are implemented. Persistent project registration and on-demand
10
+ Web loading are implemented in the current source candidate.**
11
11
 
12
12
  ## System Model
13
13
 
@@ -71,11 +71,21 @@ verified source candidate -> annotated release tag -> published GitHub Release
71
71
  |
72
72
  v
73
73
  provenance publication + public read-back
74
+
75
+ project add [path] -> complete map validation -> user-local ProjectStore
76
+ |
77
+ parameterless web ----------------------------------+
78
+ explicit web --repo -> temporary session paths -----+-> LocalWebApplication
79
+ |
80
+ Viewer catalog <- GET / -----------------------------+
81
+ Viewer selection -> GET /api/projects/<opaque-id> -> one validated projection
74
82
  ```
75
83
 
76
84
  The tracked documents and their Git history are the shared product state. Each
77
- command creates an in-memory graph for its own invocation. Rendering and future
78
- local acceleration remain derived behavior around that same graph.
85
+ map load creates an in-memory graph for its own invocation. Rendering and future
86
+ local acceleration remain derived behavior around that same graph. The
87
+ user-local project list supplies only checkout selection and never becomes a
88
+ second graph or map-authoring source.
79
89
 
80
90
  ## Stable Responsibilities
81
91
 
@@ -126,34 +136,77 @@ identities for repeatable layout and inspection.
126
136
 
127
137
  ### FlowProjector
128
138
 
129
- Builds one deterministic top-to-bottom SVG per business flow. Dagre owns step
139
+ Builds one deterministic top-to-bottom diagram per business flow. Dagre owns step
130
140
  placement and transition routing; action, decision, and outcome steps preserve
131
141
  distinct visual semantics, while labeled decision branches remain visible on
132
142
  their transitions. The projector reads normalized flow meaning and owns no
133
143
  query or maintenance decisions.
134
144
 
145
+ ### Diagram Layout
146
+
147
+ Relationship and flow projectors share `layoutDiagram` for both initial
148
+ server-side size estimates and browser-measured text dimensions. SVG owns
149
+ shapes and routed lines; an ordinary HTML sibling layer owns complete names,
150
+ summaries, kinds, and branch labels so page translators can read full sentences.
151
+ The same layout positions both layers and connects decision edges to the actual
152
+ diamond boundary.
153
+
154
+ The browser observes card and label sizes. Appending a translation, changing
155
+ fonts, or restoring original text reflows the affected diagram without replacing
156
+ its text DOM. Nodes grow with their content and Dagre reserves the measured
157
+ label space. Translation remains browser presentation rather than a second
158
+ tracked business-map copy.
159
+
135
160
  ### ViewerPage
136
161
 
137
162
  Owns the compact human inspection surface shared by static export and Web. It
138
163
  combines project selection, relationship/flow switching, business-domain or
139
164
  flow selection, map statistics, a restrained legend, pan, zoom, and fit-to-view
140
- around deterministic SVG projections. Cards render stable business meaning
141
- only. Pointer or keyboard selection opens the node's navigation anchors and
165
+ around shared SVG geometry and selectable HTML text. Dragging text uses native
166
+ selection and copying; dragging diagram space pans the map. Cards render stable
167
+ business meaning only. Clicking a node or activating it with the keyboard opens its navigation anchors and
142
168
  derived related-flow links in an overlaid desktop side panel or narrow-screen
143
169
  bottom panel. Selecting a related flow switches to its projected path. Camera
144
170
  coordinates use the SVG `xMidYMid meet` scale and letterbox offsets for both
145
- pointer zoom and pan. Its browser interaction state is disposable and never
171
+ pointer zoom, pan, and HTML placement, including viewport resizing. A fitted
172
+ camera follows content reflow; an explicitly zoomed or panned camera keeps its
173
+ current view. Its browser interaction state is disposable and never
146
174
  enters tracked map data.
147
175
 
176
+ Static export embeds its complete project model, diagram layers, and the bundled
177
+ Dagre browser runtime, with no network dependency. Web mode initially
178
+ receives only project IDs and display names, then replaces its single current
179
+ model and SVG set when a selection loads. Empty, loading, ready, and unavailable
180
+ states are browser-session state. A monotonically increasing request generation
181
+ and cancellation signal prevent an older project request from replacing a
182
+ newer selection.
183
+
184
+ ### ProjectStore And ProjectRegistrationService
185
+
186
+ `ProjectStore` owns the versioned `~/.semantic-atlas/projects.json` document. A
187
+ missing file means an empty project list. It strictly reads normalized absolute
188
+ checkout paths, appends a new path idempotently, and publishes the complete list
189
+ through a unique temporary file and atomic replacement. This disposable local
190
+ configuration is separate from observations and tracked business-map YAML.
191
+
192
+ `ProjectRegistrationService` validates the complete map through
193
+ `MapApplication` before storing its resolved root. A missing, invalid, or
194
+ unresolvable map therefore leaves the project file unchanged.
195
+
148
196
  ### LocalWebApplication And LocalWebServer
149
197
 
150
- `LocalWebApplication` reloads only the repository paths supplied by the CLI and
151
- renders the shared Viewer. `LocalWebServer` binds to `127.0.0.1`, serves GET and
152
- HEAD, rejects mutation methods, and accepts no repository path from HTTP. The
153
- server owns transport lifetime only; map loading, validation, layout, and HTML
154
- remain in their existing application and rendering owners. When allowed
155
- repositories share a basename, `ViewerPage` adds deterministic numeric labels
156
- without revealing parent or absolute paths.
198
+ `LocalWebApplication` turns one saved or explicit path set into a session-local
199
+ catalog with opaque project IDs. It renders the initial list without loading a
200
+ map and resolves a selected ID back to its server-only path for one
201
+ `MapApplication.viewerProject` call. Duplicate basenames receive deterministic
202
+ numeric labels without revealing parent or absolute paths. A project load
203
+ failure becomes a safe unavailable result and does not affect another project.
204
+
205
+ `LocalWebServer` binds to `127.0.0.1`, serves GET and HEAD, rejects mutation
206
+ methods, and accepts no repository path from HTTP. Its root serves the Viewer
207
+ shell and catalog; its opaque-ID project endpoint serves one current model and
208
+ SVG set with caching disabled. The server owns transport lifetime only; map
209
+ loading, validation, layout, and HTML remain in their existing owners.
157
210
 
158
211
  ### CLI
159
212
 
@@ -313,6 +366,9 @@ rather than local build effects.
313
366
  | Parsed documents | One CLI invocation | Parse phase | Recreated from tracked files |
314
367
  | Normalized map with relationships and flows | One CLI invocation | Query/render phase | Recreated after validation |
315
368
  | Rendered output | Calling workflow | Reproducible artifact | Regenerated from the graph |
369
+ | Registered project paths | User home | Across Web sessions | Validated `project add` and atomic project-file replacement |
370
+ | Web project catalog | One local Web session | Server lifetime | Recreated from either registered or explicit paths |
371
+ | Current Web project model and SVG | Browser selection | Until the next selection | Loaded through one opaque server-assigned project ID |
316
372
  | Bundled Skill payloads | Installed npm package | Package version | Replaced only by exact package installation |
317
373
  | Managed user Skills | User home | Across repositories and CLI invocations | Per-Skill `semantic-atlas setup` atomic replacement |
318
374
  | Managed Skill markers | Managed Skill directories | Same as each installed payload | Written into each staged copy before activation |
@@ -362,6 +418,7 @@ lifecycle commands:
362
418
  semantic-atlas validate [--repo <path>]
363
419
  semantic-atlas context <id-or-term> [--repo <path>]
364
420
  semantic-atlas render [--repo <path>] [--output <path>]
421
+ semantic-atlas project add [path]
365
422
  semantic-atlas web [--repo <path...>] [--port <port>] [--no-open]
366
423
  semantic-atlas setup
367
424
  semantic-atlas upgrade
@@ -375,11 +432,13 @@ semantic-atlas --version
375
432
  ```
376
433
 
377
434
  Map commands resolve and report the repository root and map-document set they
378
- used. `web` reports its loopback URL and repository count without exposing
379
- those roots to the browser. Observation commands report the derived repository
380
- identity, while package lifecycle commands remain repository-independent.
381
- Machine output uses a versioned envelope with a stable success or error
382
- discriminant.
435
+ used. `project add` defaults to the current directory, validates the complete
436
+ map, and reports `added` or `already_exists`. Parameterless `web` reads the
437
+ registered list; `web --repo` uses only its explicit temporary paths. `web`
438
+ reports its loopback URL and repository count without exposing roots to the
439
+ browser. Observation commands report the derived repository identity, while
440
+ package lifecycle commands remain repository-independent. Machine output uses
441
+ a versioned envelope with a stable success or error discriminant.
383
442
 
384
443
  `context` returns ambiguity when multiple concepts match the term. Callers can
385
444
  then use a stable ID. A missing concept is a bounded map result and routes the
@@ -463,8 +522,16 @@ Errors fall into stable categories:
463
522
  summary.
464
523
  - `RECONCILIATION_READ_FAILED`: retained candidate and review evidence cannot
465
524
  produce a trustworthy reconciliation report.
466
- - `WEB_START_FAILED`: one of the explicitly selected repositories cannot load,
467
- the loopback port cannot bind, or the local Viewer cannot start.
525
+ - `PROJECT_CONFIG_INVALID`: the user-local project file violates its versioned
526
+ shape, normalized absolute-path rule, or uniqueness rule and remains unchanged.
527
+ - `PROJECT_CONFIG_STORAGE_FAILED`: the project file cannot be read or atomically
528
+ replaced; the previous complete file remains authoritative.
529
+ - `WEB_START_FAILED`: the registered list cannot be read, the loopback port
530
+ cannot bind, or the local Viewer cannot start.
531
+
532
+ A selected checkout that is missing or has an invalid map is a project-level
533
+ unavailable result, not `WEB_START_FAILED`. The HTTP response uses a safe
534
+ summary and never forwards a repository path or lower-level error message.
468
535
 
469
536
  Unexpected infrastructure errors propagate to the CLI boundary with a safe
470
537
  message and a nonzero exit status. The implementation adds contextual details
@@ -71,6 +71,12 @@ IDs use lowercase dot-separated business vocabulary, for example
71
71
  `commerce.orders.place-order`. They remain stable when implementation paths or
72
72
  semantic parents change. Containment lives in explicit `part_of` relations.
73
73
 
74
+ Human-facing names, summaries, and branch labels accept Chinese or English.
75
+ Use the author's working language for the single retained description. A Chinese
76
+ node name can keep an English stable ID and English search terms in `aliases`;
77
+ both Chinese names and English aliases participate in the lookup rules below.
78
+ Browser translation changes presentation only and does not write another map.
79
+
74
80
  Supported node kinds are:
75
81
 
76
82
  ```text
@@ -4,9 +4,9 @@ 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 business-flow
8
- extension is implemented in the current source candidate, and longitudinal
9
- acceptance remains in progress.**
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.**
10
10
 
11
11
  ## Purpose
12
12
 
@@ -64,13 +64,25 @@ implementation vocabulary differ.
64
64
 
65
65
  A person views deterministic projections of the same tracked map to discuss
66
66
  business boundaries and relationships. A self-contained export and a local
67
- read-only Web command share the same interactive Viewer, including project and
68
- business-domain selection, relationship and flow views, pan, zoom, and
69
- fit-to-view. Graph cards prioritize business meaning by showing type, title,
70
- and description; selecting a card reveals its navigation anchors and related
71
- flows in a side panel or narrow-screen bottom panel. A related flow link
72
- switches directly to the scenario path. The visual surface does not become a
73
- second authoring format.
67
+ read-only Web command share the same interactive Viewer. The user manually
68
+ registers checkouts with `semantic-atlas project add [path]`; an omitted path
69
+ means the current directory. A parameterless `semantic-atlas web` can then
70
+ start from any directory, list the registered projects, and load only the
71
+ initially selected or newly selected map. An unavailable checkout remains in
72
+ the list and affects only its own view.
73
+
74
+ The explicit `web --repo <paths...>` form remains a temporary project set for
75
+ one session. It neither writes the user-local project file nor implicitly
76
+ merges registered paths. The browser receives service-assigned project IDs and
77
+ display names, never repository paths, and cannot submit a filesystem path.
78
+ Project and business-domain selection, relationship and flow views, pan, zoom,
79
+ fit-to-view, navigation details, and related-flow links remain read-only. The
80
+ visual surface does not become a second authoring or registration format.
81
+
82
+ Diagram text is selectable ordinary HTML that supports whole-page translation.
83
+ When a translator appends Chinese alongside English, cards grow to show the
84
+ complete content and the diagram rearranges nodes, labels, and connecting lines.
85
+ The original tracked map remains the single business-knowledge source.
74
86
 
75
87
  ### Post-task maintenance decision and reconciliation
76
88
 
@@ -181,8 +193,10 @@ The initial product delivers one coherent path:
181
193
  8. Exercise the workflow against real engineering tasks, including stale and
182
194
  incomplete map cases.
183
195
 
184
- The runtime is stateless between commands. Derived render artifacts and future
185
- performance caches are reproducible from tracked files.
196
+ Map loading, validation, querying, and rendering remain stateless between
197
+ commands. Derived render artifacts and future performance caches are
198
+ reproducible from tracked files. The user-local, versioned project-path list is
199
+ disposable Viewer configuration rather than business knowledge.
186
200
 
187
201
  ## Current Non-Goals
188
202
 
@@ -200,7 +214,9 @@ The initial product does not provide:
200
214
  synchronization;
201
215
  - a general workflow engine or full visual-diagram authoring system;
202
216
  - real-time multi-user map editing;
203
- - a second visual authoring representation.
217
+ - a second visual authoring representation;
218
+ - browser-side project registration or automatic repository discovery;
219
+ - branch and worktree management for registered checkout paths.
204
220
 
205
221
  These boundaries keep the first product centered on better engineering
206
222
  judgment. Later capabilities require observed evidence that they improve that
@@ -238,10 +254,9 @@ human-intervention evidence as acceptance conditions.
238
254
  The initial product, managed setup, versioned observations, read-only
239
255
  reconciliation, public repository, and npm publication are complete. The first
240
256
  real target-domain map and reviewed observation pair are in local use. The
241
- current `semantic-atlas@2.2.0` release adds scenario-owned business flows and a
242
- linked relationship/flow Viewer while preserving reviewed maintenance outcomes,
243
- the narrow orchestration-status contract, and current managed Skill,
244
- observation, and claim contracts.
257
+ current `semantic-atlas@2.3.0` release adds manual project registration,
258
+ parameterless Web startup, on-demand single-project loading, and project-level
259
+ unavailable states without changing the tracked YAML business-map source.
245
260
  Target-repository sharing and longitudinal acceptance remain separate verified
246
261
  stages.
247
262
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-atlas",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "A Git-native advisory business map for coding agents.",
5
5
  "keywords": [
6
6
  "ai-agents",