semantic-atlas 2.1.1 → 2.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 (86) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +47 -9
  2. package/.agents/skills/semantic-atlas/references/observations.md +4 -0
  3. package/.agents/skills/semantic-atlas-maintenance/SKILL.md +126 -84
  4. package/.agents/skills/semantic-atlas-maintenance/references/reconciliation.md +59 -0
  5. package/README.md +53 -27
  6. package/README.zh-CN.md +42 -27
  7. package/dist/application/map-application.d.ts.map +1 -1
  8. package/dist/application/map-application.js +1 -0
  9. package/dist/application/map-application.js.map +1 -1
  10. package/dist/cli/observation-commands.d.ts +2 -1
  11. package/dist/cli/observation-commands.d.ts.map +1 -1
  12. package/dist/cli/observation-commands.js +19 -1
  13. package/dist/cli/observation-commands.js.map +1 -1
  14. package/dist/cli/reconciliation-command.d.ts +2 -1
  15. package/dist/cli/reconciliation-command.d.ts.map +1 -1
  16. package/dist/cli/reconciliation-command.js +32 -8
  17. package/dist/cli/reconciliation-command.js.map +1 -1
  18. package/dist/cli/run-cli.d.ts.map +1 -1
  19. package/dist/cli/run-cli.js +21 -4
  20. package/dist/cli/run-cli.js.map +1 -1
  21. package/dist/contracts/cli.d.ts +14 -1
  22. package/dist/contracts/cli.d.ts.map +1 -1
  23. package/dist/contracts/map.d.ts +80 -1
  24. package/dist/contracts/map.d.ts.map +1 -1
  25. package/dist/contracts/map.js +29 -0
  26. package/dist/contracts/map.js.map +1 -1
  27. package/dist/contracts/observation.d.ts +113 -1
  28. package/dist/contracts/observation.d.ts.map +1 -1
  29. package/dist/contracts/observation.js +71 -1
  30. package/dist/contracts/observation.js.map +1 -1
  31. package/dist/contracts/projection.d.ts +1 -0
  32. package/dist/contracts/projection.d.ts.map +1 -1
  33. package/dist/contracts/reconciliation.d.ts +11 -1
  34. package/dist/contracts/reconciliation.d.ts.map +1 -1
  35. package/dist/index.d.ts +4 -4
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/map/business-flow-validator.d.ts +3 -0
  40. package/dist/map/business-flow-validator.d.ts.map +1 -0
  41. package/dist/map/business-flow-validator.js +152 -0
  42. package/dist/map/business-flow-validator.js.map +1 -0
  43. package/dist/map/business-graph.d.ts +3 -1
  44. package/dist/map/business-graph.d.ts.map +1 -1
  45. package/dist/map/business-graph.js +11 -0
  46. package/dist/map/business-graph.js.map +1 -1
  47. package/dist/map/map-validator.d.ts.map +1 -1
  48. package/dist/map/map-validator.js +31 -2
  49. package/dist/map/map-validator.js.map +1 -1
  50. package/dist/observations/observation-application.d.ts +6 -0
  51. package/dist/observations/observation-application.d.ts.map +1 -1
  52. package/dist/observations/observation-application.js +34 -1
  53. package/dist/observations/observation-application.js.map +1 -1
  54. package/dist/observations/observation-store.d.ts +8 -1
  55. package/dist/observations/observation-store.d.ts.map +1 -1
  56. package/dist/observations/observation-store.js +22 -4
  57. package/dist/observations/observation-store.js.map +1 -1
  58. package/dist/query/context-query-service.d.ts.map +1 -1
  59. package/dist/query/context-query-service.js +1 -0
  60. package/dist/query/context-query-service.js.map +1 -1
  61. package/dist/reconciliation/reconciliation-service.d.ts +1 -0
  62. package/dist/reconciliation/reconciliation-service.d.ts.map +1 -1
  63. package/dist/reconciliation/reconciliation-service.js +56 -3
  64. package/dist/reconciliation/reconciliation-service.js.map +1 -1
  65. package/dist/rendering/flow-projector.d.ts +9 -0
  66. package/dist/rendering/flow-projector.d.ts.map +1 -0
  67. package/dist/rendering/flow-projector.js +226 -0
  68. package/dist/rendering/flow-projector.js.map +1 -0
  69. package/dist/rendering/map-projector.d.ts.map +1 -1
  70. package/dist/rendering/map-projector.js +6 -2
  71. package/dist/rendering/map-projector.js.map +1 -1
  72. package/dist/rendering/viewer-browser.d.ts.map +1 -1
  73. package/dist/rendering/viewer-browser.js +95 -6
  74. package/dist/rendering/viewer-browser.js.map +1 -1
  75. package/dist/rendering/viewer-page.d.ts +16 -0
  76. package/dist/rendering/viewer-page.d.ts.map +1 -1
  77. package/dist/rendering/viewer-page.js +79 -7
  78. package/dist/rendering/viewer-page.js.map +1 -1
  79. package/docs/architecture.md +120 -64
  80. package/docs/evaluation.md +18 -3
  81. package/docs/index.md +4 -4
  82. package/docs/map-format.md +99 -5
  83. package/docs/observations.md +54 -20
  84. package/docs/product-contract.md +64 -24
  85. package/examples/commerce.yaml +50 -0
  86. package/package.json +1 -1
@@ -4,9 +4,10 @@ This page defines the stable responsibilities, data lifecycle, dependency
4
4
  direction, and failure semantics for the initial product. It applies to the
5
5
  public CLI, renderer, and business-understanding Agent Skill.
6
6
 
7
- **Status: query, validation, visual projection, Agent Skills, managed
8
- Skill lifecycle, accuracy observations, read-only reconciliation, and public
9
- release verification are implemented and released.**
7
+ **Status: query, validation, visual projection, Agent Skills, managed Skill
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.**
10
11
 
11
12
  ## System Model
12
13
 
@@ -14,15 +15,15 @@ release verification are implemented and released.**
14
15
  tracked map documents
15
16
  |
16
17
  v
17
- MapDocumentLoader -> MapValidator -> BusinessGraph
18
- |
19
- +--------------+--------------+
20
- | |
21
- v v
22
- ContextQueryService MapProjector
23
- | |
24
- v v
25
- stable JSON result SVG / static HTML
18
+ MapDocumentLoader -> MapValidator -> BusinessFlowValidator -> BusinessGraph
19
+ |
20
+ +---------------------------+-------------------+
21
+ | |
22
+ v v
23
+ ContextQueryService MapProjector + FlowProjector
24
+ | |
25
+ v v
26
+ relationship + flow JSON shared relationship / flow Viewer
26
27
 
27
28
  Calling Agent
28
29
  -> activates from business task meaning
@@ -53,12 +54,12 @@ Independent review -----------+ v
53
54
  |
54
55
  v
55
56
  ReconciliationService
56
- |
57
- v
58
- deterministic candidate report
59
- |
60
- v
61
- Maintenance Agent Skill
57
+ / \
58
+ v v
59
+ required boolean deterministic candidate report
60
+ | |
61
+ v v
62
+ task orchestrator Maintenance Agent Skill
62
63
  |
63
64
  v
64
65
  current evidence + reviewed YAML
@@ -92,19 +93,28 @@ actionable issue that can be collected safely in one run, including duplicate
92
93
  IDs, missing relation endpoints, containment cycles, invalid kinds, and
93
94
  malformed anchors. It owns deterministic validity, not current-source truth.
94
95
 
96
+ ### BusinessFlowValidator
97
+
98
+ Validates scenario ownership, flow and step identity, concept and transition
99
+ references, action/decision/outcome branch shape, and reachability. Cycles are
100
+ valid. It owns structural flow coherence while current source and durable
101
+ product evidence decide whether the described business path is current.
102
+
95
103
  ### BusinessGraph
96
104
 
97
- Holds normalized immutable nodes, relations, aliases, containment indexes, and
98
- incoming/outgoing relation indexes for one command. It exposes domain
99
- operations in terms of business concepts rather than file layout or parser
100
- objects.
105
+ Holds normalized immutable nodes, relations, flows, aliases, containment
106
+ indexes, and incoming/outgoing relation indexes for one command. It exposes
107
+ domain operations in terms of business concepts and scenario paths rather than
108
+ file layout or parser objects. Related flows are derived from scenario
109
+ containment and step concept references.
101
110
 
102
111
  ### ContextQueryService
103
112
 
104
113
  Resolves a concept by stable ID, name, or alias and returns the smallest useful
105
114
  business neighborhood: ancestors, direct children, incoming and outgoing
106
- relations, referenced concepts, summaries, and navigation anchors. It reports
107
- ambiguity explicitly rather than selecting a hidden match.
115
+ relations, referenced concepts, summaries, navigation anchors, and complete
116
+ related flows. It reports ambiguity explicitly rather than selecting a hidden
117
+ match.
108
118
 
109
119
  ### MapProjector
110
120
 
@@ -114,16 +124,26 @@ concepts as visible boundary nodes. Every projection distinguishes semantic
114
124
  containment from directed horizontal relations and preserves stable element
115
125
  identities for repeatable layout and inspection.
116
126
 
127
+ ### FlowProjector
128
+
129
+ Builds one deterministic top-to-bottom SVG per business flow. Dagre owns step
130
+ placement and transition routing; action, decision, and outcome steps preserve
131
+ distinct visual semantics, while labeled decision branches remain visible on
132
+ their transitions. The projector reads normalized flow meaning and owns no
133
+ query or maintenance decisions.
134
+
117
135
  ### ViewerPage
118
136
 
119
137
  Owns the compact human inspection surface shared by static export and Web. It
120
- combines project and business-domain selection, map statistics, a restrained
121
- legend, pan, zoom, and fit-to-view around deterministic SVG projections. Cards
122
- render stable business meaning only. Pointer or keyboard selection opens the
123
- node's navigation anchors in an overlaid desktop side panel or narrow-screen
124
- bottom panel without relaying out the graph. Camera coordinates use the SVG
125
- `xMidYMid meet` scale and letterbox offsets for both pointer zoom and pan. Its
126
- browser interaction state is disposable and never enters tracked map data.
138
+ combines project selection, relationship/flow switching, business-domain or
139
+ 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
142
+ derived related-flow links in an overlaid desktop side panel or narrow-screen
143
+ bottom panel. Selecting a related flow switches to its projected path. Camera
144
+ 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
146
+ enters tracked map data.
127
147
 
128
148
  ### LocalWebApplication And LocalWebServer
129
149
 
@@ -146,9 +166,12 @@ interpretation of its own.
146
166
  Owns the business-understanding workflow for every business-changing task. It
147
167
  activates from task meaning, converts a natural-language task into one bounded
148
168
  map probe, interprets advisory results or `MAP_NOT_FOUND`, builds the smallest
149
- current-evidence business model needed for the decision, and continues through
150
- the repository's normal implementation and verification process. Source editing
151
- and engineering judgment remain with the calling Agent.
169
+ current-evidence business model needed for the decision, traces relevant
170
+ business-flow branches before and after the change, and continues through the
171
+ repository's normal implementation and verification process. It classifies a
172
+ source/flow discrepancy before proposing either a code repair or a `flow`
173
+ maintenance candidate. Source editing and engineering judgment remain with the
174
+ calling Agent.
152
175
 
153
176
  The Skill invokes `context` through a small contract-checking adapter. The
154
177
  adapter prefers the CLI distributed with the Skill and accepts a PATH command
@@ -160,13 +183,20 @@ contract when another installed product uses the same executable name.
160
183
  Owns post-integration and periodic candidate triage after
161
184
  `ReconciliationService` has produced one read-only report. It selects one
162
185
  business domain, confirms proposed corrections against current source and
163
- tracked product meaning, resolves an existing or initial domain-owned YAML
164
- surface, leaves unresolved and implementation-local observations outside the
165
- canonical map, and submits any accepted correction as one normal reviewed YAML
166
- change. A `MAP_NOT_FOUND` repository can bootstrap one bounded domain when
167
- current evidence establishes its stable identity. Source confirmation, map
168
- editing, validation, rendering, Git diff, and independent review remain Agent
169
- and repository responsibilities rather than CLI side effects.
186
+ tracked product meaning, reconstructs `flow` candidates at business granularity,
187
+ resolves an existing or initial domain-owned YAML surface, leaves unresolved
188
+ and implementation-local observations outside the canonical map, and submits
189
+ any accepted correction as one normal reviewed YAML change. A `MAP_NOT_FOUND`
190
+ repository can bootstrap one bounded domain when current evidence establishes
191
+ its stable identity. Source confirmation, map editing, validation, rendering,
192
+ Git diff, and independent review remain Agent and repository responsibilities
193
+ rather than CLI side effects.
194
+
195
+ The Skill keeps Work, Review, and Integration as separate evidence stages. Work
196
+ prepares classifications and an observation document without consuming any
197
+ candidate. Integration adds the actual merged commit when a map changed and
198
+ records the reviewed result through `observe maintenance`. A no-map-change
199
+ discarded or unresolved result follows the same independent-review boundary.
170
200
 
171
201
  ### ManagedSkillsInstaller
172
202
 
@@ -203,10 +233,12 @@ and exposes neither repository paths nor remote URLs in retained artifacts.
203
233
 
204
234
  ### ObservationApplication
205
235
 
206
- Owns complete task and review input validation and the accuracy-authority
207
- boundary. It creates a repository-bound artifact only after strict schema
208
- validation. Review recording additionally resolves the referenced task
209
- observation from the same repository partition before persistence.
236
+ Owns complete task, review, and maintenance input validation and the
237
+ accuracy-authority boundary. It creates a repository-bound artifact only after
238
+ strict schema validation. Review recording additionally resolves the referenced
239
+ task observation from the same repository partition before persistence.
240
+ Maintenance recording resolves every exact candidate position and verifies its
241
+ business domain before persistence.
210
242
 
211
243
  ### ObservationClaimManager
212
244
 
@@ -221,8 +253,8 @@ Owns immutable, versioned user-local observation files and composes the claim
221
253
  manager around each write. The store writes and syncs a complete observation
222
254
  staging file, atomically renames it into place, returns idempotency for an exact
223
255
  replay, and reports a conflict for changed content under an existing ID. Its
224
- write boundary accepts current task v2 and review v1 artifacts. Its read
225
- boundary accepts the same current task and review contracts; unsupported stored
256
+ write boundary accepts current task v2, review v1, and maintenance v1 artifacts.
257
+ Its read boundary accepts those same contracts; unsupported stored
226
258
  artifacts fail the read instead of being reinterpreted.
227
259
 
228
260
  ### InsightService
@@ -236,10 +268,18 @@ contradicted map knowledge.
236
268
 
237
269
  Owns deterministic read-only grouping of retained map-update candidates. It
238
270
  uses explicit business-domain ownership plus exact candidate kind and summary,
239
- preserves each candidate occurrence, evidence disposition, task query record,
240
- human correction, and linked independent review, and marks groups with multiple
241
- origins as duplicates. It reads repository identity and observations without
242
- loading or editing the business map.
271
+ preserves each actionable candidate occurrence, evidence disposition, task
272
+ query record, human correction, linked independent review, and unresolved
273
+ maintenance history, and marks groups with multiple origins as duplicates.
274
+ Terminal maintenance results remove their exact origins. A group containing
275
+ only previously unresolved origins waits for a new origin before becoming
276
+ actionable again. The service reads repository identity and observations
277
+ without loading or editing the business map.
278
+
279
+ The service also owns the narrow maintenance-status projection used by task
280
+ orchestrators. That path reads task and maintenance observations only and
281
+ returns whether any exact origin remains actionable; Review joins and complete
282
+ candidate reports are deferred until a maintenance Agent requests them.
243
283
 
244
284
  ### Release Candidate Verification
245
285
 
@@ -271,7 +311,7 @@ rather than local build effects.
271
311
  | --- | --- | --- | --- |
272
312
  | Business-map documents | Target repository | Git history | Normal reviewed file edit |
273
313
  | Parsed documents | One CLI invocation | Parse phase | Recreated from tracked files |
274
- | Normalized graph | One CLI invocation | Query/render phase | Recreated after validation |
314
+ | Normalized map with relationships and flows | One CLI invocation | Query/render phase | Recreated after validation |
275
315
  | Rendered output | Calling workflow | Reproducible artifact | Regenerated from the graph |
276
316
  | Bundled Skill payloads | Installed npm package | Package version | Replaced only by exact package installation |
277
317
  | Managed user Skills | User home | Across repositories and CLI invocations | Per-Skill `semantic-atlas setup` atomic replacement |
@@ -279,7 +319,9 @@ rather than local build effects.
279
319
  | Repository identity | One local repository across worktrees | Observation lookup | Re-derived from the Git common directory or selected directory |
280
320
  | Task observation | User-local repository partition | Immutable retained evidence | Strict validation and one atomic file publication |
281
321
  | Review observation | User-local repository partition | Immutable retained evidence | Existing task reference plus strict validation and atomic publication |
322
+ | Maintenance observation | User-local repository partition | Immutable retained evidence | Exact candidate validation after review and integration plus atomic publication |
282
323
  | Accuracy summary | One CLI invocation | Read phase | Re-derived from retained task and review files |
324
+ | Reconciliation status | One CLI invocation | Read phase | Re-derived from retained task and maintenance files |
283
325
  | Reconciliation candidate report | One CLI invocation | Read phase | Re-derived from retained candidate and review provenance |
284
326
  | Packed npm candidate | One verified source revision | Release review | Rebuilt from the package allowlist |
285
327
  | Public release identity | Annotated tag and immutable GitHub Release | Permanent remote history | Explicit release command after repository cutover and immutable-release enablement |
@@ -303,7 +345,7 @@ application services
303
345
  filesystem, parser, CLI, and rendering adapters
304
346
  ```
305
347
 
306
- Domain contracts contain concept kinds, relation types, normalized graph
348
+ Domain contracts contain concept kinds, relation and flow types, normalized map
307
349
  objects, selectors, and query results. They do not import CLI, YAML, rendering,
308
350
  filesystem, Git, or framework types.
309
351
 
@@ -325,7 +367,9 @@ semantic-atlas setup
325
367
  semantic-atlas upgrade
326
368
  semantic-atlas observe task --stdin [--repo <path>]
327
369
  semantic-atlas observe review --stdin [--repo <path>]
370
+ semantic-atlas observe maintenance --stdin [--repo <path>]
328
371
  semantic-atlas insights summary [--repo <path>] [--period <duration>]
372
+ semantic-atlas reconcile status [--repo <path>]
329
373
  semantic-atlas reconcile candidates [--repo <path>]
330
374
  semantic-atlas --version
331
375
  ```
@@ -340,19 +384,24 @@ discriminant.
340
384
  `context` returns ambiguity when multiple concepts match the term. Callers can
341
385
  then use a stable ID. A missing concept is a bounded map result and routes the
342
386
  Agent to a bounded current-evidence business model; it is not a repository
343
- failure.
387
+ failure. A successful result includes every flow related through scenario
388
+ containment or direct step concept references.
344
389
 
345
390
  `setup`, `upgrade`, and `--version` do not discover a repository or load a
346
391
  business map. Their results expose the package version and managed Skill paths
347
392
  needed to verify one installed identity. Business repositories retain only
348
393
  their Git-tracked map documents.
349
394
 
350
- `observe task` and `observe review` read one complete JSON object from standard
351
- input. They derive a private repository identity, validate before publication,
352
- and return recorded, idempotent, or explicit conflict results. `insights
353
- summary` reads those retained files without changing them or the business map.
354
- `reconcile candidates` groups retained candidates and linked reviews without
355
- changing observations, source, maps, rendered artifacts, or Git state.
395
+ The three `observe` commands read one complete JSON object from standard input.
396
+ They derive a private repository identity, validate before publication, and
397
+ return recorded, idempotent, or explicit conflict results. Maintenance input
398
+ also verifies every candidate source and its business-domain ownership.
399
+ `insights summary` reads retained task and review files without changing them or
400
+ the business map. `reconcile status` reads only retained task and maintenance
401
+ files and returns whether any origin is actionable. `reconcile candidates`
402
+ derives actionable candidates and
403
+ unresolved waiting counts without changing observations, source, maps, rendered
404
+ artifacts, or Git state.
356
405
 
357
406
  ## Validation Boundary
358
407
 
@@ -366,12 +415,15 @@ checks:
366
415
  - at most one direct `part_of` parent per node;
367
416
  - acyclic `part_of` containment;
368
417
  - well-formed aliases and navigation anchors;
418
+ - unique scenario-owned flow identities and resolvable step references;
419
+ - valid action, decision, and outcome branch shape;
420
+ - reachability of every step from its flow entry while allowing cycles;
369
421
  - deterministic normalization independent of input file order.
370
422
 
371
423
  Validation does not claim that a path exists, a symbol still has the same name,
372
- or a business relation still matches current code. Those are task-time
373
- investigation questions. A separate advisory diagnostic may report obviously
374
- missing paths without changing graph validity.
424
+ or a business relation or flow still matches current behavior. Those are
425
+ task-time investigation questions. A separate advisory diagnostic may report
426
+ obviously missing paths without changing graph validity.
375
427
 
376
428
  ## Error Semantics
377
429
 
@@ -399,6 +451,9 @@ Errors fall into stable categories:
399
451
  versioned task or review contract and no observation is written.
400
452
  - `TASK_OBSERVATION_NOT_FOUND`: a review references no task observation in the
401
453
  selected repository partition.
454
+ - `MAINTENANCE_CANDIDATE_INVALID`: a maintenance result references no exact
455
+ candidate position in the selected repository or uses another business
456
+ domain.
402
457
  - `OBSERVATION_CONFLICT`: an immutable ID already belongs to different content.
403
458
  - `OBSERVATION_STORAGE_FAILED`: atomic publication could not complete and no
404
459
  new final artifact is reported.
@@ -424,7 +479,8 @@ documents load.
424
479
 
425
480
  Ordinary feature branches read their branch's map revision. Durable changes use
426
481
  normal Git merge behavior. Review focuses on business meaning, stable IDs,
427
- relationship direction, and whether the update belongs in the shared map.
482
+ relationship direction, labeled branch outcomes, and whether the update belongs
483
+ in the shared map.
428
484
 
429
485
  Every business-changing task writes its own immutable observation and maintenance
430
486
  disposition. Candidate-producing results can enter post-integration maintenance
@@ -4,8 +4,9 @@ This page defines how the initial product proves that an advisory business map
4
4
  improves engineering accuracy and reduces routine human supervision. It applies
5
5
  to the CLI, renderer, Agent Skill, and real-project evaluation.
6
6
 
7
- **Status: accepted initial protocol; controlled Skill fixtures and the private
8
- real-project evaluation pass.**
7
+ **Status: accepted initial protocol; controlled relationship fixtures and the
8
+ private real-project evaluation pass. Business-flow behavior is covered by the
9
+ current source candidate and still needs longitudinal real-task evidence.**
9
10
 
10
11
  ## Evaluation Question
11
12
 
@@ -43,6 +44,13 @@ The agent identifies required incoming and outgoing collaborators, affected
43
44
  data, invariants, interfaces, tests, and asynchronous consumers. It avoids
44
45
  unsupported expansion into unrelated areas.
45
46
 
47
+ ### Business-path accuracy
48
+
49
+ For a task that intersects a retained flow, the agent identifies the affected
50
+ actions, decisions, labeled branches, and outcomes. A refactor preserves every
51
+ confirmed branch that remains part of the product behavior, while a deliberate
52
+ business change produces an explicit flow-maintenance decision.
53
+
46
54
  ### Evidence accuracy
47
55
 
48
56
  Every claim that controls the change is confirmed in current source, tests,
@@ -83,6 +91,8 @@ The first real-project suite contains at least:
83
91
  7. A contradicted-relation case where current evidence must override the map.
84
92
  8. A code-quality case where the first runnable implementation would create an
85
93
  unclear responsibility or unnecessary mechanism.
94
+ 9. A branch-sensitive refactor where a broad implementation still appears to
95
+ work but violates a retained business decision or outcome.
86
96
 
87
97
  Cases use real repository structure and behavior. Private business facts stay
88
98
  inside the private evaluation workspace and are summarized publicly only in
@@ -94,7 +104,9 @@ The public repository contains a de-identified miniature engineering system at
94
104
  `tests/fixtures/agent-skill/repository`. Its case contract covers an upstream
95
105
  root cause, an interface with a downstream consumer, missing map knowledge, an
96
106
  ambiguous term, a node without anchors, a stale anchor, and a relation that
97
- current source contradicts.
107
+ current source contradicts. The controlled Commerce map also contains one
108
+ authorization flow so contract tests prove that `context` returns relevant
109
+ scenario paths without treating them as current-source truth.
98
110
 
99
111
  Automated checks prove that each initial selector produces the intended public
100
112
  CLI outcome and that every acceptance oracle points to present source, test, or
@@ -140,6 +152,7 @@ The map file does not have to be repaired inside the engineering task.
140
152
  Each run records:
141
153
 
142
154
  - selected map nodes and relationships;
155
+ - related business flows and affected paths;
143
156
  - map statements used as investigation leads;
144
157
  - current files, tests, documents, or runtime evidence opened;
145
158
  - confirmed and contradicted map statements;
@@ -166,6 +179,8 @@ The initial product passes when:
166
179
  mechanical control produces no business-maintenance work;
167
180
  - required business boundaries and impact surfaces are identified in every
168
181
  case;
182
+ - each relevant flow is traced before and after the task, with confirmed
183
+ branches preserved or classified for maintenance;
169
184
  - implementation cases pass their behavioral tests and independent code-quality
170
185
  review;
171
186
  - map-assisted runs require no routine human correction after the task contract
package/docs/index.md CHANGED
@@ -14,10 +14,10 @@ verified gates.
14
14
  - [Architecture](architecture.md): stable responsibilities, lifecycle,
15
15
  dependency direction, collaboration model, and failure semantics.
16
16
  - [Map format](map-format.md): tracked graph documents, concepts, relations,
17
- anchors, validation, and query projections.
18
- - [Accuracy observations](observations.md): task and independent-review
19
- evidence schemas, immutable local persistence, replay, privacy, derived
20
- summaries, and read-only reconciliation candidate reports.
17
+ business flows, anchors, validation, and query projections.
18
+ - [Accuracy observations](observations.md): task, independent-review, and
19
+ maintenance evidence schemas, immutable local persistence, replay, privacy,
20
+ derived summaries, and read-only actionable candidate reports.
21
21
  - [Evaluation](evaluation.md): real-task accuracy, stale-map recovery, code
22
22
  quality, and human-intervention evidence.
23
23
  - [Delivery plan](delivery-plan.md): integrated initial slices and the ordered,
@@ -1,8 +1,7 @@
1
1
  # Semantic Atlas Map Format
2
2
 
3
- This page defines the initial tracked document model, graph meaning, validation
4
- rules, and context projection. The implementation will publish a machine schema
5
- that follows this contract.
3
+ This page defines the tracked document model, relationship and flow meaning,
4
+ validation rules, and context projection.
6
5
 
7
6
  **Status: implemented by the `schemaVersion: 1` validation and context-query
8
7
  path.**
@@ -47,6 +46,8 @@ relations:
47
46
  type: part_of
48
47
  to: commerce
49
48
  summary: Orders is a durable Commerce capability.
49
+
50
+ flows: []
50
51
  ```
51
52
 
52
53
  Top-level `map` metadata identifies the owning document for diagnostics and
@@ -119,6 +120,86 @@ Relations describe durable business collaboration. They do not encode branch
119
120
  conditions, total order, retry behavior, loops, timing, or runtime execution
120
121
  state.
121
122
 
123
+ ## Business Flow Contract
124
+
125
+ A business flow describes one scenario's business-relevant actions,
126
+ decisions, labeled branches, and outcomes. It complements the relationship
127
+ graph: relations explain which concepts collaborate, while a flow explains how
128
+ one stable business path can reach different results.
129
+
130
+ ```yaml
131
+ flows:
132
+ - id: commerce.orders.place-order-flow
133
+ name: Place order
134
+ summary: Available stock becomes a reserved customer order.
135
+ scenario: commerce.orders.place-order
136
+ startsAt: check-inventory
137
+ steps:
138
+ - id: check-inventory
139
+ kind: decision
140
+ name: Is inventory available?
141
+ summary: Only available stock may proceed to order creation.
142
+ concept: commerce.orders.place-order.check-inventory
143
+ - id: create-order
144
+ kind: action
145
+ name: Create order
146
+ summary: The purchase becomes a durable customer order.
147
+ concept: commerce.orders.place-order.create-order
148
+ - id: order-placed
149
+ kind: outcome
150
+ name: Order placed
151
+ summary: The shopper receives a durable order.
152
+ concept: commerce.orders.order
153
+ - id: order-not-created
154
+ kind: outcome
155
+ name: Order not created
156
+ summary: Unavailable stock ends the attempt without an order.
157
+ transitions:
158
+ - from: check-inventory
159
+ when: available
160
+ to: create-order
161
+ - from: check-inventory
162
+ when: unavailable
163
+ to: order-not-created
164
+ - from: create-order
165
+ to: order-placed
166
+ ```
167
+
168
+ Each flow contains:
169
+
170
+ | Field | Required | Meaning |
171
+ | --- | --- | --- |
172
+ | `id` | yes | Stable repository-wide flow identity |
173
+ | `name` | yes | Human-facing scenario path name |
174
+ | `summary` | yes | Durable business result represented by the flow |
175
+ | `scenario` | yes | Existing `scenario` node that owns the flow |
176
+ | `startsAt` | yes | Entry step ID within the flow |
177
+ | `steps` | yes | One or more business-granularity steps |
178
+ | `transitions` | yes | Directed step connections and decision labels |
179
+ | `notes` | no | Durable qualification or known uncertainty |
180
+
181
+ Step kinds are:
182
+
183
+ - `action`: a meaningful business action with at most one unlabeled next step;
184
+ - `decision`: a business choice with at least two uniquely labeled branches;
185
+ - `outcome`: a business result that ends its path.
186
+
187
+ Each step has an ID unique within its flow, a name, a summary, and an optional
188
+ `concept` reference to an existing graph node. Referencing the same concept is
189
+ what lets the Viewer navigate from a relationship card into related flows;
190
+ there is no separately maintained link list.
191
+
192
+ Record a step when changing it can alter a user-visible result, durable data,
193
+ cost or provider usage, authorization or tenant isolation, an interface, or a
194
+ business outcome. Keep parameter validation, DTO conversion, helpers,
195
+ framework wiring, Service or Queue names, retries, and timing in current-source
196
+ evidence. Cycles are valid when the repeated business path itself is durable.
197
+
198
+ Flows remain advisory knowledge. A source discrepancy starts an investigation
199
+ into whether source regressed, product intent changed, the flow was already
200
+ stale, or available evidence is unresolved. It never synchronizes either side
201
+ automatically.
202
+
122
203
  ## Navigation Anchors
123
204
 
124
205
  Anchors help an agent enter the current repository. They are hints rather than
@@ -168,6 +249,13 @@ The complete repository map must satisfy:
168
249
  10. Aliases are unique for one node after case-insensitive normalization.
169
250
  11. Repository-relative anchors remain relative and normalized.
170
251
  12. Normalized graph order is deterministic across file discovery order.
252
+ 13. Flow IDs are repository-wide unique and each flow belongs to an existing
253
+ `scenario`.
254
+ 14. Step IDs are unique within a flow; `startsAt`, transition endpoints, and
255
+ optional concept references resolve.
256
+ 15. Actions have at most one unlabeled outgoing transition, decisions have at
257
+ least two uniquely labeled outgoing transitions, and outcomes have none.
258
+ 16. Every flow step is reachable from `startsAt`; cycles remain valid.
171
259
 
172
260
  Horizontal relation endpoints follow their business meaning:
173
261
 
@@ -209,7 +297,12 @@ For one selected node, `context` returns:
209
297
  - complete summaries for referenced endpoint nodes;
210
298
  - navigation anchors for all directly returned nodes;
211
299
  - the document IDs that supplied each item;
212
- - advisory anchor diagnostics when requested and available.
300
+ - advisory anchor diagnostics when requested and available;
301
+ - complete related flows, including steps and labeled transitions.
302
+
303
+ A flow is related when it belongs to the selected scenario, belongs to a
304
+ scenario under the selected domain or capability, or directly references the
305
+ selected operation, data, invariant, or interface from one of its steps.
213
306
 
214
307
  The result is intentionally local. The caller can query another returned stable
215
308
  ID when it needs to expand the investigation.
@@ -220,7 +313,8 @@ Agents edit the owning YAML file directly and use `semantic-atlas validate`
220
313
  before submitting a map change. Git diff is the review surface.
221
314
 
222
315
  Business-changing engineering tasks record observations outside the canonical
223
- map and create candidates only for stable meaning that needs maintenance.
316
+ map and create node, relation, anchor, or flow candidates only for stable
317
+ meaning that needs maintenance.
224
318
  Post-integration or periodic reconciliation confirms candidates in current
225
319
  evidence, updates one bounded neighborhood, validates the complete graph, and
226
320
  submits the normal repository change for review. A mapless repository can use