sad-mcp 0.1.31 → 0.1.33

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sad-mcp",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "MCP server for Software Analysis and Design course materials at BGU",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,7 +9,13 @@ You are a business process analyst. Analyze the process description and produce
9
9
 
10
10
  ## Critical Modeling Rules
11
11
 
12
- 1. **CUSTOMERS / EXTERNAL PARTIES get their own POOL**: If a customer, patient, citizen, or external company (e.g., חברת אשראי, ספק) acts independently they are a SEPARATE POOL with message flows. They are NOT a lane. The only exception: if the organization fully controls the participant's actions within its system (e.g., customer using a bank app).
12
+ 1. **EXTERNAL PARTIES get their own POOL**but the pool type depends on who controls the process:
13
+
14
+ - **Independent external** (acts on their own, organization cannot dictate their process — e.g., חברת אשראי processing a charge, ספק deciding delivery schedule, customer deciding whether to complain): → **Empty/collapsed pool**. NO tasks, NO gateways, NO events inside. Just a labeled rectangle. Message flows connect to/from the **pool border**.
15
+
16
+ - **Organization-controlled external** (follows a process dictated by the organization step by step — e.g., customer filling out the organization's form, patient following the clinic's intake procedure): → **Regular expanded pool** with tasks, start/end events, gateways, and sequence flows inside. Treated like a full pool.
17
+
18
+ External participants are NEVER lanes — they are always separate pools. The question is only whether the pool is empty or expanded.
13
19
 
14
20
  2. **DATA STORES are mandatory**: If any task involves "block account", "generate invoice", "credit account", "update record", "register", "look up", or any read/write to persistent state — a Data Store is required.
15
21
 
@@ -17,6 +23,29 @@ You are a business process analyst. Analyze the process description and produce
17
23
 
18
24
  4. **GATEWAYS have types**: Every gateway must be classified as XOR (exclusive — one path), AND (parallel — all paths), or OR (inclusive — one or more paths).
19
25
 
26
+ ## ⚠️ EMPTY POOL VALIDATION — Read This Before Writing JSON
27
+
28
+ An `external-empty` pool is JUST A LABEL. It has NOTHING inside it. Before finalizing your JSON, check every array and delete violations:
29
+
30
+ **❌ WRONG — these violate empty pool rules:**
31
+ ```json
32
+ { "id": "t1", "name": "יצירת קשר", "pool": "pool-customer" } ← task in empty pool!
33
+ { "id": "t10", "name": "זיכוי חשבון", "pool": "pool-credit" } ← task in empty pool!
34
+ { "id": "start-customer", "type": "start", "pool": "pool-customer" } ← event in empty pool!
35
+ { "id": "end-credit", "type": "end", "pool": "pool-credit" } ← event in empty pool!
36
+ { "from": "start-customer", "to": "t1" } ← sequence flow in empty pool!
37
+ ```
38
+
39
+ **✅ RIGHT — empty pools appear ONLY in:**
40
+ - `pools` array (with `"type": "external-empty"`)
41
+ - `messageFlows` array (with `"fromTask": null` or `"toTask": null` for the empty pool side)
42
+
43
+ **✅ RIGHT — customer's action is modeled as org-side task + message flow:**
44
+ ```json
45
+ { "id": "t2", "name": "קבלת פנייה מהלקוח", "pool": "pool-org", "lane": "lane-cs" }
46
+ { "from": "pool-customer", "to": "pool-org", "fromTask": null, "toTask": "t2", "description": "בקשת זיכוי" }
47
+ ```
48
+
20
49
  ## Analysis Steps
21
50
 
22
51
  ### Step 1 — Identify Participants
@@ -29,9 +58,13 @@ List every actor/role. Classify each as POOL or LANE:
29
58
 
30
59
  ### Step 2 — Identify Tasks
31
60
 
32
- List every action/task. Assign each to a specific lane or pool.
61
+ List every action/task. Assign each to:
62
+ - A **lane within the organization pool**, OR
63
+ - An **organization-controlled external pool** (expanded — has its own tasks)
64
+
65
+ Do NOT assign tasks to **independent external pools** — those are empty.
33
66
 
34
- Look for implied activities — phrases like "is expected to be in phone contact" or "will coordinate directly" describe real tasks, not annotations.
67
+ Look for implied activities — phrases like "is expected to be in phone contact" or "will coordinate directly" describe real tasks, not annotations. If an independent external party performs an action, model the organization's side of that interaction as a task in the relevant lane (e.g., "קבלת בקשה מהלקוח") with a message flow from the external pool border.
35
68
 
36
69
  ### Step 3 — Identify Gateways
37
70
 
@@ -53,20 +86,23 @@ List transient data flowing between tasks (e.g., "בקשת ביטול", "חשב
53
86
 
54
87
  ### Step 6 — Identify Flows
55
88
 
56
- - **Sequence flows** (within a pool): Task ordering within each pool
57
- - **Message flows** (between pools): Every communication between separate pools. Check bidirectional — every message expecting a response needs a return flow.
89
+ - **Sequence flows** (within pools that have tasks): Task ordering within the organization pool and within organization-controlled external pools. Independent external pools (empty) have NO sequence flows.
90
+ - **Message flows** (between pools): Every communication between pools. For **independent external pools** (empty), message flows connect to/from the **pool border** (not to any element inside — there are none). For **organization-controlled external pools** (expanded), message flows connect to specific tasks. Check bidirectional — every message expecting a response needs a return flow.
58
91
  - **Data associations**: Connections between tasks and data stores / data objects.
59
92
 
60
93
  ### Step 7 — Identify Events
61
94
 
62
- - **Start events**: One per pool
63
- - **End events**: One or more per pool (different outcomes)
95
+ Events exist in the **organization pool** and in **organization-controlled external pools** (expanded). NOT in independent external pools (empty).
96
+
97
+ - **Start events**: One per expanded pool (organization + organization-controlled external)
98
+ - **End events**: One or more per expanded pool (different outcomes)
64
99
  - **Intermediate events**: For passive waiting — when a participant waits for a signal/message
65
100
 
66
101
  ### Step 8 — Verify Completeness & Note Assumptions
67
102
 
68
- - Every pool has a complete flow: start → tasks/gateways → end
69
- - External parties have their full process modeled, not just a single task
103
+ - Every expanded pool (organization + organization-controlled external) has a complete flow: start → tasks/gateways → end
104
+ - Independent external pools are EMPTY no tasks, no events, no gateways inside them
105
+ - Every external participant mentioned in the description appears as a pool (empty or expanded, based on control)
70
106
  - List any assumptions you made about the process
71
107
  - List any open questions where the description was ambiguous
72
108
 
@@ -80,7 +116,8 @@ Show pools and lanes as a hierarchy:
80
116
 
81
117
  ```
82
118
  מאגרים (Pools):
83
- ├── לקוח (מאגר חיצוני — פועל באופן עצמאי)
119
+ ├── חברת אשראי (מאגר חיצוני — ריק, פועל באופן עצמאי)
120
+ ├── לקוח (מאגר חיצוני — מורחב, תהליך נשלט ע״י הארגון)
84
121
  └── חברת אישימוטו (מאגר ארגוני)
85
122
  ├── שירות לקוחות
86
123
  ├── שימור לקוחות
@@ -89,7 +126,7 @@ Show pools and lanes as a hierarchy:
89
126
 
90
127
  ### Section 2: זרימת העבודה (Workflow)
91
128
 
92
- For each pool and lane, show the task flow as a numbered list with gateway branches indented:
129
+ For each **expanded pool** (organization lanes + organization-controlled external pools), show the task flow as a numbered list with gateway branches indented. Do NOT show workflow for independent external pools (they are empty):
93
130
 
94
131
  ```
95
132
  שירות לקוחות:
@@ -114,7 +151,7 @@ Each data object with source task and target task.
114
151
 
115
152
  ### Section 6: זרימות הודעות (Message Flows)
116
153
 
117
- Between which pools, what's communicated, direction.
154
+ Between which pools, what's communicated, direction. For **independent external pools** (empty), the message flow connects to/from the **pool border**. For expanded pools (organization or organization-controlled external), specify which task sends/receives the message.
118
155
 
119
156
  ### Section 7: הנחות ושאלות פתוחות (Assumptions & Open Questions)
120
157
 
@@ -129,14 +166,19 @@ Output the complete structured model as a JSON code block. This is the machine-r
129
166
  "title": { "he": "שם התהליך", "en": "Process Name" },
130
167
  "pools": [
131
168
  {
132
- "id": "pool-id",
133
- "name": "שם המאגר",
134
- "type": "external",
135
- "reason": "why this is a separate pool",
136
- "lanes": []
169
+ "id": "pool-customer",
170
+ "name": "לקוח",
171
+ "type": "external-empty",
172
+ "reason": "acts independently empty pool, no internal elements"
173
+ },
174
+ {
175
+ "id": "pool-patient",
176
+ "name": "מטופל",
177
+ "type": "external-expanded",
178
+ "reason": "follows clinic's prescribed intake process"
137
179
  },
138
180
  {
139
- "id": "org-id",
181
+ "id": "pool-org",
140
182
  "name": "שם הארגון",
141
183
  "type": "organization",
142
184
  "reason": "main organization",
@@ -149,8 +191,8 @@ Output the complete structured model as a JSON code block. This is the machine-r
149
191
  {
150
192
  "id": "task-id",
151
193
  "name": "שם המשימה",
152
- "pool": "pool-id",
153
- "lane": "lane-id-or-null",
194
+ "pool": "pool-org",
195
+ "lane": "lane-id",
154
196
  "description": "optional details"
155
197
  }
156
198
  ],
@@ -160,8 +202,8 @@ Output the complete structured model as a JSON code block. This is the machine-r
160
202
  "type": "XOR",
161
203
  "role": "split",
162
204
  "question": "מה השאלה?",
163
- "pool": "pool-id",
164
- "lane": "lane-id-or-null",
205
+ "pool": "pool-org",
206
+ "lane": "lane-id",
165
207
  "branches": [
166
208
  { "label": "תיאור הענף", "target": "task-or-gw-id" }
167
209
  ]
@@ -187,8 +229,8 @@ Output the complete structured model as a JSON code block. This is the machine-r
187
229
  {
188
230
  "id": "event-id",
189
231
  "type": "start",
190
- "pool": "pool-id",
191
- "lane": "lane-id-or-null",
232
+ "pool": "pool-org",
233
+ "lane": "lane-id",
192
234
  "name": "תיאור האירוע"
193
235
  }
194
236
  ],
@@ -196,7 +238,7 @@ Output the complete structured model as a JSON code block. This is the machine-r
196
238
  { "from": "element-id", "to": "element-id", "label": "optional" }
197
239
  ],
198
240
  "messageFlows": [
199
- { "from": "pool-id", "to": "pool-id", "description": "מה מועבר" }
241
+ { "from": "pool-customer", "to": "pool-org", "fromTask": null, "toTask": "task-id", "description": "מה מועבר" }
200
242
  ],
201
243
  "assumptions": [
202
244
  "הנחה שנעשתה..."
@@ -207,6 +249,19 @@ Output the complete structured model as a JSON code block. This is the machine-r
207
249
  }
208
250
  ```
209
251
 
252
+ ## Final JSON Validation Checklist
253
+
254
+ Before outputting the JSON, scan every array and verify:
255
+
256
+ 1. **`tasks` array**: Every task has `"pool": "pool-org"` (or an `external-expanded` pool). NO task has `"pool"` pointing to an `external-empty` pool.
257
+ 2. **`events` array**: Every event has `"pool": "pool-org"` (or an `external-expanded` pool). NO event has `"pool"` pointing to an `external-empty` pool.
258
+ 3. **`gateways` array**: Every gateway has `"pool": "pool-org"` (or an `external-expanded` pool). NO gateway has `"pool"` pointing to an `external-empty` pool.
259
+ 4. **`sequenceFlows` array**: NO sequence flow references any element in an `external-empty` pool.
260
+ 5. **`messageFlows` array**: For `external-empty` pools, `fromTask` or `toTask` is `null` (connects to pool border). The other side points to a specific task in the org pool.
261
+ 6. **`pools` array**: Empty pools use `"type": "external-empty"`. NOT `"external"`.
262
+
263
+ If any violation is found, fix it — move the action to the org side and add a message flow instead.
264
+
210
265
  ## After the Analysis — STOP
211
266
 
212
267
  After outputting the analysis, you MUST stop and wait for user feedback. Do NOT proceed to create a diagram, HTML file, or any visual output. Do NOT call any other tools. End your response with exactly this text:
@@ -17,7 +17,7 @@ You have an approved structural model (the JSON below). Render it as a single se
17
17
 
18
18
  3. **EMPTY POOLS** (external participants with no internal tasks): Message flows connect to/from the **pool border itself** — NOT to any element inside. The pool is just a labeled rectangle. No start/end events inside empty pools.
19
19
 
20
- 4. **DATA STORES** appear as cylinders with data association lines to their tasks.
20
+ 4. **DATA STORES** appear as cylinders with data association lines to their tasks. **Duplicate data stores** when needed — if a data store is used by tasks in different lanes or distant parts of the diagram, draw multiple copies of the same cylinder, each placed close to its connected tasks. This avoids long crossing arrows. Each copy has the same label.
21
21
 
22
22
  5. **NO ELEMENTS ON LANE BOUNDARIES**: Every element fully inside one lane, centered vertically.
23
23