@rse/specbook 1.3.2 → 1.4.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 (50) hide show
  1. package/README.md +9 -2
  2. package/dst/specbook-api.d.ts +5 -1
  3. package/dst/specbook-api.js +23 -9
  4. package/dst/specbook-cli.js +8 -5
  5. package/dst/specbook-cmd-export.js +2 -2
  6. package/dst/specbook-cmd-init.js +16 -2
  7. package/dst/specbook-coverage.js +1 -1
  8. package/dst/specbook-diagram.d.ts +1 -1
  9. package/dst/specbook-diagram.js +12 -10
  10. package/dst/specbook-export-ast.d.ts +1 -1
  11. package/dst/specbook-export-ast.js +21 -4
  12. package/dst/specbook-export-code.d.ts +14 -0
  13. package/dst/specbook-export-code.js +155 -0
  14. package/dst/specbook-export-common.d.ts +8 -2
  15. package/dst/specbook-export-common.js +126 -6
  16. package/dst/specbook-export-diagram.d.ts +15 -0
  17. package/dst/specbook-export-diagram.js +211 -0
  18. package/dst/specbook-export-html-fold.d.ts +20 -0
  19. package/dst/specbook-export-html-fold.js +458 -0
  20. package/dst/specbook-export-html-render.d.ts +51 -0
  21. package/dst/specbook-export-html-render.js +748 -0
  22. package/dst/specbook-export-html-search.js +6 -5
  23. package/dst/specbook-export-html-template.d.ts +21 -0
  24. package/dst/specbook-export-html-template.js +282 -0
  25. package/dst/specbook-export-html-widget.d.ts +12 -0
  26. package/dst/specbook-export-html-widget.js +605 -0
  27. package/dst/specbook-export-html.css +325 -50
  28. package/dst/specbook-export-html.js +62 -1931
  29. package/dst/specbook-export-image.d.ts +2 -0
  30. package/dst/specbook-export-image.js +161 -9
  31. package/dst/specbook-export-md.js +60 -12
  32. package/dst/specbook-format-schema.d.ts +1 -1
  33. package/dst/specbook-format-schema.js +1 -1
  34. package/dst/specbook-format-spec.d.ts +1 -0
  35. package/dst/specbook-format-spec.js +1 -0
  36. package/dst/specbook-format.md +173 -19
  37. package/dst/specbook-format.yaml +265 -24
  38. package/dst/specbook-ignore.js +2 -0
  39. package/dst/specbook-link.js +21 -5
  40. package/dst/specbook-mcp.js +9 -5
  41. package/dst/specbook-parse-common.d.ts +24 -0
  42. package/dst/specbook-parse-common.js +137 -10
  43. package/dst/specbook-parse-semantic.js +2 -0
  44. package/dst/specbook-parse-syntax.js +81 -20
  45. package/dst/specbook-parse.js +1 -1
  46. package/dst/specbook-project.d.ts +1 -0
  47. package/dst/specbook-project.js +10 -1
  48. package/dst/specbook-theme.d.ts +1 -0
  49. package/dst/specbook-theme.js +2 -0
  50. package/package.json +18 -12
@@ -93,7 +93,9 @@
93
93
  #
94
94
  # - All artifacts are optional, so that the schema can back not only
95
95
  # a full specification but also the individual document types of
96
- # the modeling coverage matrix above on their own.
96
+ # the modeling coverage matrix above on their own. Likewise, the
97
+ # properties and child objects of all artifacts are optional, so
98
+ # that a freshly initialized specification already lints cleanly.
97
99
  #
98
100
  # - The traditional hard Software Requirements Specification (SRS)
99
101
  # vs. Architecture Description (AD) document split is
@@ -128,6 +130,7 @@
128
130
  optional: true
129
131
  - name: TITLE
130
132
  desc: The title of the specification.
133
+ optional: true
131
134
  - name: SUBTITLE
132
135
  desc: The subtitle of the specification.
133
136
  optional: true
@@ -182,17 +185,21 @@
182
185
  - name: PURPOSE
183
186
  desc: >
184
187
  Why the solution exists.
188
+ optional: true
185
189
  - name: TARGET-AUDIENCE
186
190
  desc: >
187
191
  Whom the solution serves.
192
+ optional: true
188
193
  - name: SOLUTION
189
194
  desc: >
190
195
  What the solution is, in a single sentence naming its kind or
191
196
  category (e.g. a self-hosted, browser-based streaming platform).
197
+ optional: true
192
198
  - name: VALUE-PROPOSITION
193
199
  desc: >
194
200
  The benefit the solution offers its target audience, stated in
195
201
  absolute terms without reference to alternatives.
202
+ optional: true
196
203
  - name: DIFFERENTIATORS
197
204
  desc: >
198
205
  How the solution stands apart from the alternatives, naming the
@@ -266,7 +273,9 @@
266
273
  enforces itself is a Domain Rule or a Non-Functional Requirement instead) and
267
274
  states a fact or event, not a decision (a deliberate exclusion is the `SCOPE` of
268
275
  the Solution Vision or a `WONT` requirement instead).
276
+ optional: true
269
277
  format:
278
+ type: compact
270
279
  maxTableColumns: 5
271
280
  props:
272
281
  - name: TYPE
@@ -340,7 +349,9 @@
340
349
  (the `BROADER` term where one exists) and adds the characteristics delimiting the
341
350
  term from its siblings (e.g. `A Message submitted by an Attendee as ...`), so that
342
351
  the hierarchy and the definitions cross-check each other.
352
+ optional: true
343
353
  format:
354
+ type: compact
344
355
  maxTableColumns: 5
345
356
  referenced:
346
357
  - "[[*]]"
@@ -352,8 +363,9 @@
352
363
  labeled: true
353
364
  qualified: true
354
365
  config:
355
- size-node-width-max: 440
366
+ size-node-width-max: 440
356
367
  size-node-height-scale: 1.75
368
+ hub-node-count-max: 3
357
369
  props:
358
370
  - name: TYPE
359
371
  desc: >
@@ -435,6 +447,7 @@
435
447
  exactly this part and hold exactly the rights the Authorization Model grants to it
436
448
  (plus those of the roles it `INHERITS`), while a persona holding several roles
437
449
  holds the union of them.
450
+ optional: true
438
451
  format:
439
452
  maxTableColumns: 5
440
453
  referenced:
@@ -479,6 +492,7 @@
479
492
  persona's own voice, like a "tagline", "mantra", or "defining statement" -- that
480
493
  captures their core attitude, motivation, frustration, or need in a single memorable
481
494
  line. Non-user stakeholders are modeled as personas of type `Stakeholder`.
495
+ optional: true
482
496
  format:
483
497
  maxTableColumns: 5
484
498
  props:
@@ -570,6 +584,7 @@
570
584
  desc: >
571
585
  The end-to-end journey of a single persona (or of multiple personas sharing the same
572
586
  experience as role variants), named with a 2-5 word summary of the pursued scenario.
587
+ optional: true
573
588
  props:
574
589
  - name: ACTORS
575
590
  desc: >
@@ -657,10 +672,22 @@
657
672
  event-driven (`When <trigger>, the system MUST ...`), state-driven (`While <state>,
658
673
  the system MUST ...`), optional-feature (`Where <feature>, the system MUST ...`), or
659
674
  unwanted-behavior (`If <condition>, then the system MUST ...`).
675
+ optional: true
660
676
  format:
661
677
  maxTableColumns: 6
662
678
  referenced:
663
679
  - "[[USE-CASE:*]]"
680
+ diagram:
681
+ type: hub
682
+ center: self
683
+ nodes: "[[FR.REQUIREMENT:*]], [[NR.REQUIREMENT:*]], [[PREMISE:*]], [[RULE:*]],
684
+ [[USE-CASE:*]], [[DM.ENTITY:*]], [[FV.COMPONENT:*]], [[TEST-CASE:*]]"
685
+ labeled: true
686
+ qualified: true
687
+ config:
688
+ size-node-width-max: 440
689
+ size-node-height-scale: 1.75
690
+ hub-node-count-max: 3
664
691
  props:
665
692
  - name: PRIORITY
666
693
  desc: >
@@ -720,6 +747,7 @@
720
747
  them (a `WONT` requirement, which the architecture rightly ignores, is the tolerated
721
748
  exception the lint warning cannot tell apart) and its hub diagram shows what
722
749
  answers it.
750
+ optional: true
723
751
  referenced:
724
752
  - "[[TACTIC:*]]"
725
753
  - "[[DECISION:*]]"
@@ -734,6 +762,7 @@
734
762
  config:
735
763
  size-node-width-max: 440
736
764
  size-node-height-scale: 1.75
765
+ hub-node-count-max: 3
737
766
  props:
738
767
  - name: PRIORITY
739
768
  desc: >
@@ -823,10 +852,23 @@
823
852
  <outcome>` item per case, applied in order with the first matching case winning,
824
853
  and a closing sentence stating the outcome of the remaining cases ("otherwise")
825
854
  and carrying the rationale.
855
+ optional: true
826
856
  format:
827
857
  maxTableColumns: 5
828
858
  referenced:
829
859
  - "[[TEST-CASE:*]]"
860
+ diagram:
861
+ type: hub
862
+ center: self
863
+ nodes: "[[RULE:*]], [[TERM:*]], [[FR.REQUIREMENT:*]], [[NR.REQUIREMENT:*]],
864
+ [[PREMISE:*]], [[WORKFLOW:*]], [[HANDOFF:*]], [[USE-CASE:*]], [[TRANSITION:*]],
865
+ [[PERMISSION:*]], [[TEST-CASE:*]]"
866
+ labeled: true
867
+ qualified: true
868
+ config:
869
+ size-node-width-max: 440
870
+ size-node-height-scale: 1.75
871
+ hub-node-count-max: 3
830
872
  props:
831
873
  - name: CATEGORY
832
874
  desc: >
@@ -923,6 +965,7 @@
923
965
  cases, a use case spans several activities, and an activity performed outside the
924
966
  solution is covered by none at all -- so the workflow is no mere sequence of use
925
967
  cases and cannot be assembled from them.
968
+ optional: true
926
969
  automaton:
927
970
  nodes: ACTIVITY
928
971
  edges: HANDOFF
@@ -1096,6 +1139,7 @@
1096
1139
  relate it n:m to the Domain Workflow activities -- a use case spans several
1097
1140
  activities and an activity is covered by several use cases -- so the two decompose
1098
1141
  the same domain independently instead of nesting into each other.
1142
+ optional: true
1099
1143
  diagram:
1100
1144
  type: hub
1101
1145
  center: self
@@ -1268,6 +1312,7 @@
1268
1312
  A named entity of the data model, carrying a Pascal-cased, 1-3 word long,
1269
1313
  per-artifact unique name, and described by a 1-sentence description ("what") plus a
1270
1314
  1-sentence rationale ("why").
1315
+ optional: true
1271
1316
  diagram:
1272
1317
  type: hub
1273
1318
  center: self
@@ -1435,6 +1480,7 @@
1435
1480
  state machine: exactly one initial state, at least one final state, every state
1436
1481
  reachable from the initial state, and some final state reachable from every state
1437
1482
  (a state from which no final state can be reached anymore is a livelock).
1483
+ optional: true
1438
1484
  automaton:
1439
1485
  nodes: STATE
1440
1486
  edges: TRANSITION
@@ -1598,8 +1644,21 @@
1598
1644
  they are granted, so that the permissions of all roles form the access matrix of
1599
1645
  roles against entities. Any operation, state, or condition not covered by a
1600
1646
  permission of the role (or of a role it `INHERITS`) is forbidden.
1647
+ optional: true
1601
1648
  format:
1649
+ type: compact
1602
1650
  maxTableColumns: 8
1651
+ diagram:
1652
+ type: hub
1653
+ center: self
1654
+ nodes: "[[PERMISSION:*]], [[ROLE:*]], [[DM.ENTITY:*]], [[STATE:*]], [[TRANSITION:*]],
1655
+ [[RULE:*]], [[USE-CASE:*]], [[SCENARIO:*]], [[ENDPOINT:*]], [[TEST-CASE:*]]"
1656
+ labeled: true
1657
+ qualified: true
1658
+ config:
1659
+ size-node-width-max: 440
1660
+ size-node-height-scale: 1.75
1661
+ hub-node-count-max: 3
1603
1662
  props:
1604
1663
  - name: ROLE
1605
1664
  desc: >
@@ -1699,6 +1758,7 @@
1699
1758
  belongs to, where the kind-specific parts (HTTP method, GraphQL operation, topic
1700
1759
  direction, command) are carried by the `OPERATION` and `LOCATOR` properties of the
1701
1760
  endpoints only.
1761
+ optional: true
1702
1762
  diagram:
1703
1763
  type: hub
1704
1764
  center: self
@@ -1954,6 +2014,7 @@
1954
2014
  Endpoints form a flat list: a hierarchy of sub-commands or sub-resources
1955
2015
  is expressed by a path-style `LOCATOR` (e.g. `remote add`,
1956
2016
  `/events/{eventId}/chat`) only.
2017
+ optional: true
1957
2018
  diagram:
1958
2019
  type: hub
1959
2020
  center: self
@@ -2187,13 +2248,16 @@
2187
2248
  is a Dialog Pattern instead), decides between design alternatives (the alternative
2188
2249
  it rejects is its `TRADE-OFF`), and is not verifiable by a metric (a measurable
2189
2250
  quality bound is a Non-Functional Requirement instead).
2251
+ optional: true
2190
2252
  referenced:
2191
- - "[[PATTERN:*]]"
2253
+ - "[[DIALOG-PATTERN:*]]"
2254
+ format:
2255
+ type: compact
2192
2256
  diagram:
2193
2257
  type: hub
2194
2258
  center: self
2195
2259
  nodes: "[[PRINCIPLE:*]], [[PERSONA:*]], [[STEP:*]], [[USE-CASE:*]], [[CONVENTION:*]],
2196
- [[PATTERN:*]], [[ELEMENT:*]], [[DECISION:*]]"
2260
+ [[DIALOG-PATTERN:*]], [[ELEMENT:*]], [[DECISION:*]]"
2197
2261
  labeled: true
2198
2262
  qualified: true
2199
2263
  config:
@@ -2284,6 +2348,19 @@
2284
2348
  solution phrases what it says, not what it does (a behavior is an Interaction
2285
2349
  Concept principle instead) and not what a term means (a definition is a Domain
2286
2350
  Glossary term instead).
2351
+ optional: true
2352
+ format:
2353
+ type: compact
2354
+ diagram:
2355
+ type: hub
2356
+ center: self
2357
+ nodes: "[[CONVENTION:*]], [[PERSONA:*]], [[PRINCIPLE:*]], [[TERM:*]], [[DECISION:*]]"
2358
+ labeled: true
2359
+ qualified: true
2360
+ config:
2361
+ size-node-width-max: 440
2362
+ size-node-height-scale: 1.75
2363
+ hub-node-count-max: 3
2287
2364
  props:
2288
2365
  - name: CATEGORY
2289
2366
  desc: >
@@ -2338,7 +2415,7 @@
2338
2415
  optional: true
2339
2416
  diagram:
2340
2417
  type: grid
2341
- nodes: "[[PATTERN:*]]"
2418
+ nodes: "[[DIALOG-PATTERN:*]]"
2342
2419
  properties:
2343
2420
  - CATEGORY
2344
2421
  config:
@@ -2346,7 +2423,7 @@
2346
2423
  size-node-height-scale: 2
2347
2424
  grid-columns-max: 4
2348
2425
  children:
2349
- - kind: PATTERN
2426
+ - kind: DIALOG-PATTERN
2350
2427
  desc: >
2351
2428
  A single reusable dialog pattern, named with a short (2-5 word) summary (e.g.
2352
2429
  `Master-Detail`, `Wizard`, `Inline Edit`) and described in a concise (1-3 sentence)
@@ -2357,10 +2434,11 @@
2357
2434
  occurring in a single flow is a Dialog Storyboard frame instead) and is bound to a
2358
2435
  particular kind of screen or flow (a solution-wide rule independent of any screen
2359
2436
  is an Interaction Concept principle instead).
2437
+ optional: true
2360
2438
  diagram:
2361
2439
  type: hub
2362
2440
  center: self
2363
- nodes: "[[PATTERN:*]], [[PRINCIPLE:*]], [[STORYBOARD:*]], [[DECISION:*]]"
2441
+ nodes: "[[DIALOG-PATTERN:*]], [[PRINCIPLE:*]], [[STORYBOARD:*]], [[DECISION:*]]"
2364
2442
  deep: true
2365
2443
  labeled: true
2366
2444
  qualified: true
@@ -2405,7 +2483,7 @@
2405
2483
  pattern is composed of (e.g. a `Master-Detail` using an `Inline Edit` in
2406
2484
  its detail), so that the patterns form a language of related structures
2407
2485
  rather than a flat catalogue.
2408
- value: list([[PATTERN:*]])
2486
+ value: list([[DIALOG-PATTERN:*]])
2409
2487
  optional: true
2410
2488
  - name: TRADE-OFF
2411
2489
  desc: >
@@ -2447,10 +2525,11 @@
2447
2525
  one flow, as seen by its actors (the intent and the information exchanged are a Use
2448
2526
  Cases scenario instead, and a structure recurring across flows is a Dialog Pattern
2449
2527
  instead).
2528
+ optional: true
2450
2529
  diagram:
2451
2530
  type: hub
2452
2531
  center: self
2453
- nodes: "[[STORYBOARD:*]], [[PERSONA:*]], [[SCENARIO:*]], [[PATTERN:*]], [[MOCKUP:*]]"
2532
+ nodes: "[[STORYBOARD:*]], [[PERSONA:*]], [[SCENARIO:*]], [[DIALOG-PATTERN:*]], [[MOCKUP:*]]"
2454
2533
  deep: true
2455
2534
  labeled: true
2456
2535
  qualified: true
@@ -2502,7 +2581,7 @@
2502
2581
  Comma-separated references to the DIALOG-PATTERNS objects the frame
2503
2582
  instantiates, so that a pattern is shown to recur across the
2504
2583
  concrete flows rather than merely being catalogued.
2505
- value: list([[PATTERN:*]])
2584
+ value: list([[DIALOG-PATTERN:*]])
2506
2585
  optional: true
2507
2586
  - name: SKETCH
2508
2587
  desc: >
@@ -2558,7 +2637,9 @@
2558
2637
  `MOCKUP` or a Dialog Storyboard frame instead), and is a decision rather than a
2559
2638
  list of token values (the values are in the design system) or a measurable bound
2560
2639
  (a bound is a Non-Functional Requirement instead).
2640
+ optional: true
2561
2641
  format:
2642
+ type: compact
2562
2643
  maxTableColumns: 5
2563
2644
  diagram:
2564
2645
  type: hub
@@ -2568,6 +2649,7 @@
2568
2649
  qualified: true
2569
2650
  config:
2570
2651
  size-node-width-max: 440
2652
+ hub-node-count-max: 3
2571
2653
  props:
2572
2654
  - name: CATEGORY
2573
2655
  desc: >
@@ -2615,8 +2697,18 @@
2615
2697
  is a reference rendering of the final look of one screen (a low-fidelity sketch of
2616
2698
  a screen within its flow is a Dialog Storyboard frame instead) and shows rules
2617
2699
  applied rather than stating them (a rule is an `ELEMENT` instead).
2700
+ optional: true
2618
2701
  format:
2619
2702
  type: complex
2703
+ diagram:
2704
+ type: hub
2705
+ center: self
2706
+ nodes: "[[MOCKUP:*]], [[PERSONA:*]], [[STORYBOARD:*]], [[ELEMENT:*]]"
2707
+ labeled: true
2708
+ qualified: true
2709
+ config:
2710
+ size-node-width-max: 440
2711
+ hub-node-count-max: 3
2620
2712
  props:
2621
2713
  - name: ACTORS
2622
2714
  desc: >
@@ -2690,7 +2782,9 @@
2690
2782
  solution deploys and operates itself (e.g. a managed database of its own) is a
2691
2783
  Deployment View node instead -- only a party or system the solution merely consumes
2692
2784
  or serves belongs to the system context.
2785
+ optional: true
2693
2786
  format:
2787
+ type: compact
2694
2788
  maxTableColumns: 5
2695
2789
  props:
2696
2790
  - name: KIND
@@ -2807,13 +2901,16 @@
2807
2901
  otherwise) and which elaborates how the component fulfills it and collaborates
2808
2902
  with the components it depends on, plus a 1-sentence rationale ("why") for the
2809
2903
  component's existence and boundary.
2904
+ optional: true
2810
2905
  format:
2906
+ type: compact
2811
2907
  maxTableColumns: 5
2812
2908
  diagram:
2813
2909
  type: hub
2814
2910
  center: self
2815
2911
  nodes: "[[FV.COMPONENT:*]], [[FR.REQUIREMENT:*]], [[INTERFACE:*]], [[DM.ENTITY:*]],
2816
- [[UNIT:*]], [[NODE:*]], [[CONCERN:*]], [[TACTIC:*]], [[DECISION:*]]"
2912
+ [[UNIT:*]], [[NODE:*]], [[CONCERN:*]], [[TACTIC:*]], [[DECISION:*]],
2913
+ [[CODE-PATTERN:*]]"
2817
2914
  labeled: true
2818
2915
  qualified: true
2819
2916
  properties:
@@ -2821,6 +2918,7 @@
2821
2918
  config:
2822
2919
  size-node-width-max: 440
2823
2920
  size-node-height-scale: 1.75
2921
+ hub-node-count-max: 3
2824
2922
  props:
2825
2923
  - name: KIND
2826
2924
  desc: |
@@ -2925,6 +3023,7 @@
2925
3023
  or a shared module used by client and server), so a product
2926
3024
  used on several tiers is a single component here instead of
2927
3025
  one per tier; referenced by no Deployment View tier.
3026
+ optional: true
2928
3027
  diagram:
2929
3028
  type: hub
2930
3029
  center: self
@@ -2950,11 +3049,13 @@
2950
3049
  carrying trade-off behind the choice is a Design Decisions decision
2951
3050
  referencing the component through `DECIDES`, and the functional components
2952
3051
  depending on the product reference it through `USED-BY`.
3052
+ format:
3053
+ type: compact
2953
3054
  diagram:
2954
3055
  type: hub
2955
3056
  center: self
2956
3057
  nodes: "[[TS.TIER:*.COMPONENT:*]], [[FV.COMPONENT:*]], [[CONCERN:*]],
2957
- [[TACTIC:*]], [[DECISION:*]]"
3058
+ [[TACTIC:*]], [[DECISION:*]], [[CODE-PATTERN:*]]"
2958
3059
  labeled: true
2959
3060
  qualified: true
2960
3061
  properties:
@@ -2963,6 +3064,7 @@
2963
3064
  config:
2964
3065
  size-node-width-max: 440
2965
3066
  size-node-height-scale: 1.75
3067
+ hub-node-count-max: 3
2966
3068
  props:
2967
3069
  - name: PRODUCT
2968
3070
  desc: >
@@ -3276,12 +3378,15 @@
3276
3378
  process: it names no concrete products (a Technology Stack `Build-Time` component
3277
3379
  states the product choice), does not restate the runtime structure (a Functionality
3278
3380
  View `Module` or `Subsystem` groups the logic), does not cover production
3279
- procedures (an Operations View concern does), and the trade-off that produced a
3280
- rule is a Design Decisions decision referencing the aspect through `AFFECTS`,
3281
- while the quality the rule protects (usually a `Maintainability` requirement) is
3381
+ procedures (an Operations View concern does), does not prescribe how a concern is
3382
+ coded (a Code Patterns pattern shows that as a listing), and the trade-off that
3383
+ produced a rule is a Design Decisions decision referencing the aspect through
3384
+ `AFFECTS`, while the quality the rule protects (usually a `Maintainability`
3385
+ requirement) is
3282
3386
  addressed by a Quality Perspectives tactic referencing the aspect through
3283
3387
  `AFFECTS`, too, so the hub diagram of an aspect shows the decision and the tactic
3284
3388
  behind it.
3389
+ optional: true
3285
3390
  diagram:
3286
3391
  type: hub
3287
3392
  center: self
@@ -3342,6 +3447,7 @@
3342
3447
  Model interface (e.g. of kind `MQTT` or `WebSocket`), and the platform element
3343
3448
  hosting a managed broker a Deployment View `Managed` node -- only the executing
3344
3449
  structure itself belongs to the Concurrency View.
3450
+ optional: true
3345
3451
  diagram:
3346
3452
  type: hub
3347
3453
  center: self
@@ -3353,6 +3459,7 @@
3353
3459
  config:
3354
3460
  size-node-width-max: 440
3355
3461
  size-node-height-scale: 1.75
3462
+ hub-node-count-max: 3
3356
3463
  props:
3357
3464
  - name: KIND
3358
3465
  desc: |
@@ -3441,6 +3548,7 @@
3441
3548
  `TIER`, a location-level tier (e.g. a data center) groups the tiers referencing it
3442
3549
  via `PART-OF`, and a single deployment unit within a tier is a `NODE` -- only the
3443
3550
  partition itself belongs here.
3551
+ optional: true
3444
3552
  format:
3445
3553
  type: concise
3446
3554
  diagram:
@@ -3455,6 +3563,7 @@
3455
3563
  config:
3456
3564
  size-node-width-max: 440
3457
3565
  size-node-height-scale: 1.75
3566
+ hub-node-count-max: 3
3458
3567
  props:
3459
3568
  - name: PART-OF
3460
3569
  desc: >
@@ -3519,6 +3628,7 @@
3519
3628
  itself belongs to the Deployment View, with the tier and area the node belongs to
3520
3629
  and the network segments it is attached to as its `TIER`, `AREA`, and `NETWORK`
3521
3630
  siblings.
3631
+ optional: true
3522
3632
  diagram:
3523
3633
  type: hub
3524
3634
  center: self
@@ -3534,6 +3644,7 @@
3534
3644
  config:
3535
3645
  size-node-width-max: 440
3536
3646
  size-node-height-scale: 1.75
3647
+ hub-node-count-max: 3
3537
3648
  props:
3538
3649
  - name: KIND
3539
3650
  desc: |
@@ -3629,6 +3740,7 @@
3629
3740
  config:
3630
3741
  size-node-width-max: 440
3631
3742
  size-node-height-scale: 1.75
3743
+ hub-node-count-max: 3
3632
3744
  props:
3633
3745
  - name: SCOPE
3634
3746
  desc: |
@@ -3687,6 +3799,7 @@
3687
3799
  deployable artifact is a `Build` aspect of the Development Aspects, and the products
3688
3800
  used are Technology Stack `Operate-Time` components referenced through `TOOLS` --
3689
3801
  only the procedure itself, its trigger, and its responsible operator belong here.
3802
+ optional: true
3690
3803
  diagram:
3691
3804
  type: hub
3692
3805
  center: self
@@ -3700,6 +3813,7 @@
3700
3813
  config:
3701
3814
  size-node-width-max: 440
3702
3815
  size-node-height-scale: 1.75
3816
+ hub-node-count-max: 3
3703
3817
  props:
3704
3818
  - name: CATEGORY
3705
3819
  desc: |
@@ -3801,16 +3915,21 @@
3801
3915
  Design Decisions decision referencing the tactic through `DECIDES`, the product
3802
3916
  realizing the mechanism is a Technology Stack component referenced through
3803
3917
  `TOOLS`, the developer-facing rule about the source structure is an aspect of the
3804
- Development Aspects, and a mechanism driven solely by a `Constraint` requirement
3918
+ Development Aspects, the coded form of the mechanism is a Code Patterns pattern
3919
+ referencing the tactic through `REALIZES`, and a mechanism driven solely by a
3920
+ `Constraint` requirement
3805
3921
  (e.g. a hosting or budget mandate) protects no quality and is a Design Decisions
3806
3922
  decision alone -- only the mechanism, the quality it achieves, and the elements it
3807
3923
  shapes belong here.
3924
+ optional: true
3925
+ format:
3926
+ type: compact
3808
3927
  diagram:
3809
3928
  type: hub
3810
3929
  center: self
3811
3930
  nodes: "[[TACTIC:*]], [[NR.REQUIREMENT:*]], [[FV.COMPONENT:*]], [[UNIT:*]],
3812
3931
  [[ASPECT:*]], [[NODE:*]], [[DM.ENTITY:*]], [[CONCERN:*]], [[DECISION:*]],
3813
- [[TS.TIER:*.COMPONENT:*]], [[TEST-CASE:*]]"
3932
+ [[TS.TIER:*.COMPONENT:*]], [[CODE-PATTERN:*]], [[TEST-CASE:*]]"
3814
3933
  labeled: true
3815
3934
  qualified: true
3816
3935
  properties:
@@ -3885,9 +4004,10 @@
3885
4004
  file: 30-ARCH-DD-Design-Decisions.md
3886
4005
  desc: >
3887
4006
  The major decisions related to the solution design, each recording the forces at play, the
3888
- chosen response, and the reasoning that justifies it. The artifact is the last one of the
3889
- architecture, as a decision references the requirements forcing it, the elements it
3890
- shapes, and the tactics and products it chose, all of which precede it.
4007
+ chosen response, and the reasoning that justifies it. The artifact is the last
4008
+ decision-level one of the architecture, as a decision references the requirements forcing
4009
+ it, the elements it shapes, and the tactics and products it chose, all of which precede
4010
+ it, while the Code Patterns following it reference the decisions they implement.
3891
4011
  optional: true
3892
4012
  refs: >
3893
4013
  - Nygard: Documenting Architecture Decisions (2011),
@@ -3963,15 +4083,18 @@
3963
4083
  decision is under-justified. The rationale should make the decision feel earned,
3964
4084
  not asserted - if you delete the rationale and the decision suddenly looks
3965
4085
  arbitrary, the rationale was doing its job.
4086
+ optional: true
4087
+ format:
4088
+ type: complex
3966
4089
  diagram:
3967
4090
  type: hub
3968
4091
  center: self
3969
4092
  nodes: "[[DECISION:*]], [[NR.REQUIREMENT:*]], [[PREMISE:*]], [[DM.ENTITY:*]],
3970
4093
  [[LIFECYCLE:*]], [[ROLE:*]], [[INTERFACE:*]], [[TYPE:*]], [[ENDPOINT:*]],
3971
- [[PRINCIPLE:*]], [[CONVENTION:*]], [[PATTERN:*]], [[STORYBOARD:*]],
4094
+ [[PRINCIPLE:*]], [[CONVENTION:*]], [[DIALOG-PATTERN:*]], [[STORYBOARD:*]],
3972
4095
  [[ELEMENT:*]], [[CV.ENTITY:*]], [[FV.COMPONENT:*]], [[UNIT:*]], [[ASPECT:*]],
3973
4096
  [[DV.TIER:*]], [[AREA:*]], [[NODE:*]], [[NETWORK:*]], [[TACTIC:*]],
3974
- [[TS.TIER:*.COMPONENT:*]]"
4097
+ [[TS.TIER:*.COMPONENT:*]], [[CODE-PATTERN:*]]"
3975
4098
  labeled: true
3976
4099
  qualified: true
3977
4100
  properties:
@@ -4019,7 +4142,7 @@
4019
4142
  integrated); omitted for a decision shaping no modeled element.
4020
4143
  value: list([[DM.ENTITY:*]], [[LIFECYCLE:*]], [[ROLE:*]], [[INTERFACE:*]],
4021
4144
  [[TYPE:*]], [[ENDPOINT:*]], [[PRINCIPLE:*]], [[CONVENTION:*]],
4022
- [[PATTERN:*]], [[STORYBOARD:*]], [[ELEMENT:*]], [[CV.ENTITY:*]],
4145
+ [[DIALOG-PATTERN:*]], [[STORYBOARD:*]], [[ELEMENT:*]], [[CV.ENTITY:*]],
4023
4146
  [[FV.COMPONENT:*]], [[UNIT:*]], [[ASPECT:*]], [[DV.TIER:*]], [[AREA:*]],
4024
4147
  [[NODE:*]], [[NETWORK:*]])
4025
4148
  optional: true
@@ -4115,10 +4238,124 @@
4115
4238
  matrix of considered alternatives); and
4116
4239
  - links to strongly related decisions.
4117
4240
  optional: true
4241
+
4242
+ - kind: ARCH
4243
+ name: Code Patterns
4244
+ id: CP
4245
+ file: 31-ARCH-CP-Code-Patterns.md
4246
+ desc: >
4247
+ The implementation patterns the source code of the solution follows, each prescribing how
4248
+ one recurring concern (e.g. authorization enforcement, entity persistence, error
4249
+ propagation) is coded and showing it as a code listing. The artifact follows the Design
4250
+ Decisions, as a pattern is the coded form of the tactics and decisions preceding it, and
4251
+ is absent when the coding conventions are governed outside the specification (e.g. by
4252
+ repository-level contributor instructions).
4253
+ optional: true
4254
+ refs: >
4255
+ - Starke/Hruschka: arc42 Template: Crosscutting Concepts (2005),
4256
+ https://arc42.org/overview
4257
+ - Fowler: Patterns of Enterprise Application Architecture (2002),
4258
+ https://martinfowler.com/books/eaa.html
4259
+ - Beck: Implementation Patterns (2007),
4260
+ https://www.informit.com/store/implementation-patterns-9780321413093
4261
+ diagram:
4262
+ type: grid
4263
+ nodes: "[[CODE-PATTERN:*]]"
4264
+ config:
4265
+ size-node-width-max: 440
4266
+ grid-columns-max: 4
4267
+ children:
4268
+ - kind: CODE-PATTERN
4269
+ desc: >
4270
+ A single code pattern, named with a short (2-5 word) summary of the concern it
4271
+ codes (e.g. `Endpoint Authorization`, `Entity Persistence`, `Error Propagation`)
4272
+ and described in a concise (1-3 sentence) paragraph by the rule the code follows
4273
+ whenever the concern arises, plus a 1-sentence rationale ("why") for the rule.
4274
+
4275
+ The listing showing the pattern follows the description and its rationale as the
4276
+ elaboration of the pattern: either a fenced code block in the language of the
4277
+ pattern (e.g. ` ```ts start=10 mark=3-5 `, the parameters numbering the lines
4278
+ from `start` and marking the essential ones) or an embedded excerpt of an existing
4279
+ source file (e.g. `![Entity Persistence](src/persistence.ts#lines=10-30&mark=3-5)`,
4280
+ the fragment selecting and marking the lines), the latter preferred once the code
4281
+ exists, as the specification then never drifts from it. The listing is the
4282
+ canonical, idealized form of the pattern, not an exhaustive example, so it is kept
4283
+ short (typically 10-30 lines) and the prose names what the listing cannot: the
4284
+ places the pattern applies and the deviation it rules out (`AVOID`).
4285
+
4286
+ A pattern states how a concern is coded, and nothing else: the quality mechanism
4287
+ it implements is a Quality Perspectives tactic referenced through `REALIZES`, the
4288
+ trade-off that chose its approach over alternatives is a Design Decisions decision
4289
+ referenced through `DECIDED-BY` (a pattern weighs no alternatives itself), the
4290
+ product it codes against is a Technology Stack component referenced through
4291
+ `TOOLS`, and the rule about the source layout, build, or process it lives in is a
4292
+ Development Aspects aspect -- only the recurring code shape, the elements written
4293
+ that way, and the deviation ruled out belong here.
4294
+ optional: true
4295
+ format:
4296
+ type: complex
4297
+ diagram:
4298
+ type: hub
4299
+ center: self
4300
+ nodes: "[[CODE-PATTERN:*]], [[FV.COMPONENT:*]], [[UNIT:*]], [[DM.ENTITY:*]],
4301
+ [[ROLE:*]], [[INTERFACE:*]], [[ENDPOINT:*]], [[TS.TIER:*.COMPONENT:*]],
4302
+ [[TACTIC:*]], [[DECISION:*]]"
4303
+ labeled: true
4304
+ qualified: true
4305
+ config:
4306
+ size-node-width-max: 440
4307
+ props:
4308
+ - name: APPLIES-TO
4309
+ desc: >
4310
+ Comma-separated references to the FUNCTIONALITY-VIEW, CONCURRENCY-VIEW,
4311
+ DATA-MODEL, AUTHORIZATION-MODEL, INTERFACE-MODEL, or INTERFACE-ENDPOINTS
4312
+ objects whose code follows the pattern (e.g. the components persisting
4313
+ their entities this way, the roles and endpoints guarded by the check);
4314
+ omitted for a pattern applied throughout the code base.
4315
+ value: list([[FV.COMPONENT:*]], [[UNIT:*]], [[DM.ENTITY:*]], [[ROLE:*]],
4316
+ [[INTERFACE:*]], [[ENDPOINT:*]])
4317
+ optional: true
4318
+ - name: REALIZES
4319
+ desc: >
4320
+ Comma-separated references to the QUALITY-PERSPECTIVES tactics the pattern
4321
+ is the coded form of (e.g. the token check implementing the access
4322
+ security tactic); omitted for a pattern serving no modeled tactic.
4323
+ value: list([[TACTIC:*]])
4324
+ optional: true
4325
+ - name: DECIDED-BY
4326
+ desc: >
4327
+ Comma-separated references to the DESIGN-DECISIONS objects the pattern
4328
+ implements (e.g. the query builder usage following the decision against an
4329
+ ORM); omitted for a pattern behind which no recorded decision stands.
4330
+ value: list([[DECISION:*]])
4331
+ optional: true
4332
+ - name: TOOLS
4333
+ desc: >
4334
+ Comma-separated references to the TECHNOLOGY-STACK components the pattern
4335
+ codes against (e.g. the query builder, the logging library); omitted for a
4336
+ pattern using the language alone.
4337
+ value: list([[TS.TIER:*.COMPONENT:*]])
4338
+ optional: true
4339
+ - name: USES
4340
+ desc: >
4341
+ Comma-separated references to the smaller CODE-PATTERNS objects the pattern
4342
+ is composed of (e.g. an `Endpoint Authorization` using the `Error
4343
+ Propagation` for its rejections), so that the patterns form a language of
4344
+ related shapes rather than a flat catalogue.
4345
+ value: list([[CODE-PATTERN:*]])
4346
+ optional: true
4347
+ acyclic: true
4348
+ - name: AVOID
4349
+ desc: >
4350
+ The deviation the pattern rules out, stated as the concrete shape a
4351
+ developer would otherwise reach for (e.g. `SQL strings assembled in the
4352
+ request handlers`, `role checks in the client alone`); omitted when the
4353
+ rule has no tempting alternative.
4354
+ optional: true
4118
4355
  - kind: TEST
4119
4356
  name: Test Cases
4120
4357
  id: TC
4121
- file: 31-TEST-TC-Test-Cases.md
4358
+ file: 32-TEST-TC-Test-Cases.md
4122
4359
  desc: >
4123
4360
  The verifiable conditions and steps used to confirm that requirements, domain rules, use
4124
4361
  case scenarios, state transitions, and the mechanisms, procedures, and decisions of the
@@ -4182,6 +4419,9 @@
4182
4419
  concurrency unit when its collaboration or contention is exercised, an aspect of
4183
4420
  the Development Aspects or a Design Decisions decision when its rule is checked by
4184
4421
  an architectural fitness function (e.g. no dependency edge against the layering).
4422
+ optional: true
4423
+ format:
4424
+ type: compact
4185
4425
  diagram:
4186
4426
  type: hub
4187
4427
  center: self
@@ -4195,6 +4435,7 @@
4195
4435
  config:
4196
4436
  size-node-width-max: 440
4197
4437
  size-node-height-scale: 1.75
4438
+ hub-node-count-max: 3
4198
4439
  props:
4199
4440
  - name: VERIFIES
4200
4441
  desc: >