sad-mcp 2.1.0 → 2.1.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.
@@ -318,6 +318,15 @@ export function validateModel(model) {
318
318
  // Wireframe safety pre-check (regex-only; defense in depth — the HTML runtime
319
319
  // also re-checks via wireframeSafe()).
320
320
  const wf = uc.wireframe;
321
+ // §WF — a UC initiated by a human actor must have a wireframe.
322
+ if (primaryActor && actorIds.has(primaryActor)) {
323
+ const pa = actors.find((a) => String(a.id) === primaryActor);
324
+ const isHuman = !pa || pa.actorType !== "system";
325
+ const wfMissing = typeof wf !== "string" || wf.trim() === "";
326
+ if (isHuman && wfMissing) {
327
+ err("wireframe-missing", `${path}.wireframe`, `UC "${id}" has a human primary actor ("${primaryActor}") but no wireframe. Every human-initiated UC requires a wireframe per §WF. Add one, or explicitly use a placeholder describing what info is missing.`);
328
+ }
329
+ }
321
330
  if (typeof wf === "string" && wf.length > 0) {
322
331
  const forbidden = [
323
332
  /<script\b/i,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sad-mcp",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "MCP server for Software Analysis and Design course materials at BGU",
5
5
  "type": "module",
6
6
  "bin": {
@@ -789,9 +789,15 @@ The `connections` entry for a timed link looks like:
789
789
 
790
790
  ---
791
791
 
792
- ## §WF. Wireframe Authoring (Per-UC, Optional)
792
+ ## §WF. Wireframe Authoring (Mandatory for Human-Initiated UCs)
793
793
 
794
- Where a UC benefits from a visual mock of the UI the user sees, emit a wireframe as an inline HTML fragment and attach it to `useCaseDocs[ucId].wireframe`. The modal renderer 8a) injects the fragment after passing a safety check (see `wireframeSafe()` in §8a).
794
+ **A wireframe is required for every UC whose `primaryActor.actorType === 'human'`.** The user sees a screen; a use case without a visual mock of that screen is incomplete documentation. The validator12) errors on any human-initiated UC missing a wireframe.
795
+
796
+ Wireframe is **optional** (and usually omitted) only for:
797
+ - UCs whose primary actor is a system or cron (`actorType: 'system'`) — no human sees a screen.
798
+ - Pure include-target UCs (sub-behaviors with no actor association).
799
+
800
+ For every other UC, emit a wireframe as an inline HTML fragment and attach it to `useCaseDocs[ucId].wireframe`. The modal renderer (§8a) injects the fragment after passing a safety check (see `wireframeSafe()` in §8a).
795
801
 
796
802
  Claude authors the wireframe using its own UI-generation judgment — there is no DSL. But the skill enforces a consistent look and safe sandbox via a scoped CSS theme and a set of forbidden patterns.
797
803
 
@@ -860,9 +866,10 @@ The `wireframeSafe()` regex rejects any of the following. A failing wireframe re
860
866
 
861
867
  ### When NOT to include a wireframe
862
868
 
863
- - The UC has no user-facing screen (e.g., a back-end cron job, an automated reconciliation).
864
- - The UI is trivial (e.g., a single "Approve" confirmation prompt) prose in the scenario flow is enough.
865
- - You cannot author the wireframe without making up details the spec does not support — put those in `diagramModel.openQuestions` instead.
869
+ - Primary actor is a system / cron (`actorType: 'system'`) — e.g., a back-end reconciliation triggered by the clock.
870
+ - The UC is purely an `«include»` target (a sub-behavior, not a user-visible goal).
871
+
872
+ **"The UI is trivial" is not a valid reason to skip.** A single approval prompt still deserves a mock — it shows the reader what the button says, what data is visible on the screen, and what confirmation text appears. If you genuinely cannot author the wireframe because the spec is silent, record the gap in `diagramModel.openQuestions` AND still emit a placeholder wireframe with the questions visible inside it.
866
873
 
867
874
  ---
868
875
 
@@ -1188,7 +1195,8 @@ Briefly report: actor count, use case count, include/extend count, whether split
1188
1195
  - [ ] Every `primaryActor` id exists in `actors[]` AND has an association with `role: 'initiator'` on that UC (aligning §4.1 with §4.4).
1189
1196
  - [ ] Every flow step of `kind: 'actor'` references a real actor id; every `kind: 'include'` references a real UC id; every `extension.at` references a valid step number in its scenario's flow.
1190
1197
  - [ ] Clicking a UC on the diagram opens the full-screen modal (§8a); Esc / backdrop click closes it. Step actor/UC references are clickable. Actor popup + association popup (§8b) still work for non-UC clicks.
1191
- - [ ] Any `wireframe` HTML passes `wireframeSafe()` (no `<script>`, no `on*=`, no `<iframe>`, no external URLs, no `@import`, no inline `<style>`); all classes are `wf-*` only.
1198
+ - [ ] Every UC whose primary actor is human has a wireframe (§WF). System/cron-initiated UCs and pure include-targets may omit.
1199
+ - [ ] Any `wireframe` HTML passes `wireframeSafe()` (no `<script>`, no `on*=`, no `<iframe>`, no external URLs, no `@import`, no inline `<style>`); all classes are `wf-*` only; visible text is in Hebrew.
1192
1200
  - [ ] Every actor-UC association has a written §4.1 justification block (role, initiates? one-line "why"); every UC has ≥1 association with `initiates = yes`.
1193
1201
  - [ ] Every association line carries a transparent click-hitbox (stroke-width ≥12, `data-conn-id`) wired to `showDesc(id,'assoc',event)`; `assocDescriptions` entry exists for each id.
1194
1202
  - [ ] `assumptions` and `openQuestions` arrays are present in `diagramModel`; the HTML renders the bottom panel whenever either is non-empty.