@documentation-robotics/cli 0.2.0 → 0.4.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 (335) hide show
  1. package/README.md +46 -16
  2. package/dist/analysis/relationship-classifier.js +2 -9
  3. package/dist/analysis/relationship-classifier.js.map +2 -2
  4. package/dist/analyzers/active-analyzer.js +62 -0
  5. package/dist/analyzers/active-analyzer.js.map +7 -0
  6. package/dist/analyzers/call-graph-utils.js +2 -2
  7. package/dist/analyzers/call-graph-utils.js.map +2 -2
  8. package/dist/analyzers/cards/build.js +191 -0
  9. package/dist/analyzers/cards/build.js.map +7 -0
  10. package/dist/analyzers/cards/classify.js +42 -0
  11. package/dist/analyzers/cards/classify.js.map +7 -0
  12. package/dist/analyzers/cards/edge-index.js +44 -0
  13. package/dist/analyzers/cards/edge-index.js.map +7 -0
  14. package/dist/analyzers/cards/extract.js +138 -0
  15. package/dist/analyzers/cards/extract.js.map +7 -0
  16. package/dist/analyzers/cards/facts.js +46 -0
  17. package/dist/analyzers/cards/facts.js.map +7 -0
  18. package/dist/analyzers/cards/graph.js +42 -0
  19. package/dist/analyzers/cards/graph.js.map +7 -0
  20. package/dist/analyzers/cards/index.js +8 -0
  21. package/dist/analyzers/cards/index.js.map +7 -0
  22. package/dist/analyzers/cards/routes.js +96 -0
  23. package/dist/analyzers/cards/routes.js.map +7 -0
  24. package/dist/analyzers/cards/tier0.js +18 -0
  25. package/dist/analyzers/cards/tier0.js.map +7 -0
  26. package/dist/analyzers/cards/types.js +1 -0
  27. package/dist/analyzers/cards/types.js.map +7 -0
  28. package/dist/analyzers/cbm-analyzer.js +270 -174
  29. package/dist/analyzers/cbm-analyzer.js.map +2 -2
  30. package/dist/analyzers/cbm-responses.js +342 -0
  31. package/dist/analyzers/cbm-responses.js.map +7 -0
  32. package/dist/analyzers/code-changes.js +159 -0
  33. package/dist/analyzers/code-changes.js.map +7 -0
  34. package/dist/analyzers/edge-relationships.js +49 -0
  35. package/dist/analyzers/edge-relationships.js.map +7 -0
  36. package/dist/analyzers/extraction-plan.js +541 -0
  37. package/dist/analyzers/extraction-plan.js.map +7 -0
  38. package/dist/analyzers/index-job.js +229 -0
  39. package/dist/analyzers/index-job.js.map +7 -0
  40. package/dist/analyzers/mapping-loader.js +9 -0
  41. package/dist/analyzers/mapping-loader.js.map +2 -2
  42. package/dist/analyzers/tier0-rules.js +153 -0
  43. package/dist/analyzers/tier0-rules.js.map +7 -0
  44. package/dist/analyzers/types.js.map +1 -1
  45. package/dist/audit/relationships/ai/prompts.js +10 -10
  46. package/dist/audit/relationships/ai/prompts.js.map +2 -2
  47. package/dist/audit/relationships/analysis/layer-templates.js +52 -52
  48. package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
  49. package/dist/cli.js +23 -11
  50. package/dist/cli.js.map +2 -2
  51. package/dist/coding-agents/default-permissions.js +31 -1
  52. package/dist/coding-agents/default-permissions.js.map +2 -2
  53. package/dist/coding-agents/drbot-mcp.js +269 -0
  54. package/dist/coding-agents/drbot-mcp.js.map +7 -0
  55. package/dist/commands/add.js +7 -4
  56. package/dist/commands/add.js.map +2 -2
  57. package/dist/commands/analyzer.js +143 -40
  58. package/dist/commands/analyzer.js.map +2 -2
  59. package/dist/commands/changeset-verify.js +63 -0
  60. package/dist/commands/changeset-verify.js.map +7 -0
  61. package/dist/commands/changeset.js +80 -29
  62. package/dist/commands/changeset.js.map +2 -2
  63. package/dist/commands/delete.js +10 -4
  64. package/dist/commands/delete.js.map +2 -2
  65. package/dist/commands/farm.js +176 -60
  66. package/dist/commands/farm.js.map +2 -2
  67. package/dist/commands/init.js +9 -26
  68. package/dist/commands/init.js.map +2 -2
  69. package/dist/commands/mcp.js +40 -21
  70. package/dist/commands/mcp.js.map +3 -3
  71. package/dist/commands/relationship.js +208 -37
  72. package/dist/commands/relationship.js.map +2 -2
  73. package/dist/commands/reports.js +3 -3
  74. package/dist/commands/reports.js.map +2 -2
  75. package/dist/commands/update.js +52 -32
  76. package/dist/commands/update.js.map +2 -2
  77. package/dist/commands/upgrade.js +99 -103
  78. package/dist/commands/upgrade.js.map +3 -3
  79. package/dist/commands/validate.js +19 -3
  80. package/dist/commands/validate.js.map +2 -2
  81. package/dist/commands/version.js +1 -1
  82. package/dist/commands/visualize.js +34 -15
  83. package/dist/commands/visualize.js.map +2 -2
  84. package/dist/core/annotation-store.js +15 -5
  85. package/dist/core/annotation-store.js.map +2 -2
  86. package/dist/core/catalog-migration.js +34 -0
  87. package/dist/core/catalog-migration.js.map +7 -0
  88. package/dist/core/changeset-analysis.js +421 -0
  89. package/dist/core/changeset-analysis.js.map +7 -0
  90. package/dist/core/changeset-base-index.js +160 -0
  91. package/dist/core/changeset-base-index.js.map +7 -0
  92. package/dist/core/changeset-brief-compact.js +256 -0
  93. package/dist/core/changeset-brief-compact.js.map +7 -0
  94. package/dist/core/changeset-brief-delta.js +102 -0
  95. package/dist/core/changeset-brief-delta.js.map +7 -0
  96. package/dist/core/changeset-graph.js +281 -0
  97. package/dist/core/changeset-graph.js.map +7 -0
  98. package/dist/core/changeset-only-guard.js +32 -0
  99. package/dist/core/changeset-only-guard.js.map +7 -0
  100. package/dist/core/changeset-summary.js +68 -0
  101. package/dist/core/changeset-summary.js.map +7 -0
  102. package/dist/core/changeset-validator.js +66 -20
  103. package/dist/core/changeset-validator.js.map +2 -2
  104. package/dist/core/changeset-verify.js +848 -0
  105. package/dist/core/changeset-verify.js.map +7 -0
  106. package/dist/core/changeset.js +56 -9
  107. package/dist/core/changeset.js.map +2 -2
  108. package/dist/core/element-type-migration.js +145 -0
  109. package/dist/core/element-type-migration.js.map +7 -0
  110. package/dist/core/extraction-observability.js +161 -0
  111. package/dist/core/extraction-observability.js.map +7 -0
  112. package/dist/core/farm-manifest.js +12 -6
  113. package/dist/core/farm-manifest.js.map +2 -2
  114. package/dist/core/farm-sync-engine.js +1 -1
  115. package/dist/core/farm-sync-engine.js.map +2 -2
  116. package/dist/core/farm-sync-state.js +10 -2
  117. package/dist/core/farm-sync-state.js.map +2 -2
  118. package/dist/core/migration-registry.js +88 -47
  119. package/dist/core/migration-registry.js.map +2 -2
  120. package/dist/core/model-upgrade.js +102 -0
  121. package/dist/core/model-upgrade.js.map +7 -0
  122. package/dist/core/model.js +82 -30
  123. package/dist/core/model.js.map +2 -2
  124. package/dist/core/mutation-handler.js +71 -6
  125. package/dist/core/mutation-handler.js.map +2 -2
  126. package/dist/core/project-init.js +53 -0
  127. package/dist/core/project-init.js.map +7 -0
  128. package/dist/core/relationship-migration-table.js +6639 -0
  129. package/dist/core/relationship-migration-table.js.map +7 -0
  130. package/dist/core/relationship-migration.js +272 -0
  131. package/dist/core/relationship-migration.js.map +7 -0
  132. package/dist/core/relationship-prune.js +49 -0
  133. package/dist/core/relationship-prune.js.map +7 -0
  134. package/dist/core/relationship-staging.js +161 -0
  135. package/dist/core/relationship-staging.js.map +7 -0
  136. package/dist/core/relationships.js +26 -4
  137. package/dist/core/relationships.js.map +2 -2
  138. package/dist/core/report-data-model.js +7 -13
  139. package/dist/core/report-data-model.js.map +2 -2
  140. package/dist/core/staged-changeset-storage.js +145 -18
  141. package/dist/core/staged-changeset-storage.js.map +2 -2
  142. package/dist/core/staged-source-reference.js +28 -0
  143. package/dist/core/staged-source-reference.js.map +7 -0
  144. package/dist/core/staging-area.js +166 -24
  145. package/dist/core/staging-area.js.map +2 -2
  146. package/dist/core/upgrade-plan.js +117 -0
  147. package/dist/core/upgrade-plan.js.map +7 -0
  148. package/dist/core/virtual-projection.js +13 -5
  149. package/dist/core/virtual-projection.js.map +2 -2
  150. package/dist/export/archimate-exporter.js +1 -0
  151. package/dist/export/archimate-exporter.js.map +2 -2
  152. package/dist/generated/compiled-validators.js +2 -2
  153. package/dist/generated/compiled-validators.js.map +2 -2
  154. package/dist/generated/layer-registry.js +16 -16
  155. package/dist/generated/layer-registry.js.map +2 -2
  156. package/dist/generated/node-types.js +186 -168
  157. package/dist/generated/node-types.js.map +2 -2
  158. package/dist/generated/relationship-index.js +2468 -7913
  159. package/dist/generated/relationship-index.js.map +2 -2
  160. package/dist/integrations/claude_code/.claude-plugin/plugin.json +24 -0
  161. package/dist/integrations/claude_code/agents/dr-architect.md +30 -3
  162. package/dist/integrations/claude_code/agents/dr-extractor.md +8 -2
  163. package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
  164. package/dist/integrations/claude_code/commands/dr-changeset.md +2 -1
  165. package/dist/integrations/claude_code/commands/dr-map.md +20 -1
  166. package/dist/integrations/claude_code/commands/dr-plan.md +66 -0
  167. package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
  168. package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
  169. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
  170. package/dist/integrations/claude_code/docs/MCP_SERVER.md +47 -26
  171. package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
  172. package/dist/integrations/claude_code/docs/README.md +68 -2
  173. package/dist/integrations/claude_code/plugin-agents/dr-advisor.md +255 -0
  174. package/dist/integrations/claude_code/plugin-agents/dr-architect.md +306 -0
  175. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
  176. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
  177. package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
  178. package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
  179. package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
  180. package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
  181. package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
  182. package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
  183. package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
  184. package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
  185. package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
  186. package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
  187. package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +95 -15
  188. package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +178 -0
  189. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +8 -0
  190. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +6 -1
  191. package/dist/integrations/github_copilot/agents/dr-architect.md +3 -1
  192. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
  193. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
  194. package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
  195. package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
  196. package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
  197. package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
  198. package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
  199. package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
  200. package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
  201. package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
  202. package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
  203. package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
  204. package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +225 -102
  205. package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +177 -0
  206. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
  207. package/dist/integrations/hash-utils.js.map +2 -2
  208. package/dist/mcp/api-key-manager.js +14 -1
  209. package/dist/mcp/api-key-manager.js.map +2 -2
  210. package/dist/mcp/changeset-only.js +45 -0
  211. package/dist/mcp/changeset-only.js.map +7 -0
  212. package/dist/mcp/project-root.js +85 -0
  213. package/dist/mcp/project-root.js.map +7 -0
  214. package/dist/mcp/server-instructions.js +27 -0
  215. package/dist/mcp/server-instructions.js.map +7 -0
  216. package/dist/mcp/strict-schema.js +52 -0
  217. package/dist/mcp/strict-schema.js.map +7 -0
  218. package/dist/mcp/tool-registry.js +55 -5
  219. package/dist/mcp/tool-registry.js.map +2 -2
  220. package/dist/mcp/tools/changeset-analysis-tools.js +98 -0
  221. package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
  222. package/dist/mcp/tools/changeset-commit.js +224 -0
  223. package/dist/mcp/tools/changeset-commit.js.map +7 -0
  224. package/dist/mcp/tools/changeset-editing.js +260 -0
  225. package/dist/mcp/tools/changeset-editing.js.map +7 -0
  226. package/dist/mcp/tools/changeset-lifecycle.js +83 -0
  227. package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
  228. package/dist/mcp/tools/changeset-shared.js +31 -0
  229. package/dist/mcp/tools/changeset-shared.js.map +7 -0
  230. package/dist/mcp/tools/changeset-show.js +17 -1
  231. package/dist/mcp/tools/changeset-show.js.map +2 -2
  232. package/dist/mcp/tools/changeset-verify.js +49 -0
  233. package/dist/mcp/tools/changeset-verify.js.map +7 -0
  234. package/dist/mcp/tools/codebase-extract.js +836 -0
  235. package/dist/mcp/tools/codebase-extract.js.map +7 -0
  236. package/dist/mcp/tools/codebase-index.js +125 -0
  237. package/dist/mcp/tools/codebase-index.js.map +7 -0
  238. package/dist/mcp/tools/codebase-shared.js +265 -0
  239. package/dist/mcp/tools/codebase-shared.js.map +7 -0
  240. package/dist/mcp/tools/codebase-verify.js +48 -0
  241. package/dist/mcp/tools/codebase-verify.js.map +7 -0
  242. package/dist/mcp/tools/index.js +34 -1
  243. package/dist/mcp/tools/index.js.map +2 -2
  244. package/dist/mcp/tools/model-add.js +191 -74
  245. package/dist/mcp/tools/model-add.js.map +2 -2
  246. package/dist/mcp/tools/model-delete.js +2 -2
  247. package/dist/mcp/tools/model-delete.js.map +2 -2
  248. package/dist/mcp/tools/model-search.js +14 -0
  249. package/dist/mcp/tools/model-search.js.map +2 -2
  250. package/dist/mcp/tools/model-show.js +29 -2
  251. package/dist/mcp/tools/model-show.js.map +2 -2
  252. package/dist/mcp/tools/model-trace.js +93 -30
  253. package/dist/mcp/tools/model-trace.js.map +2 -2
  254. package/dist/mcp/tools/model-update.js +46 -26
  255. package/dist/mcp/tools/model-update.js.map +2 -2
  256. package/dist/mcp/tools/model-validate.js +46 -4
  257. package/dist/mcp/tools/model-validate.js.map +2 -2
  258. package/dist/mcp/tools/project-status-collectors.js +381 -0
  259. package/dist/mcp/tools/project-status-collectors.js.map +7 -0
  260. package/dist/mcp/tools/project-status.js +237 -0
  261. package/dist/mcp/tools/project-status.js.map +7 -0
  262. package/dist/mcp/tools/project-tools.js +505 -0
  263. package/dist/mcp/tools/project-tools.js.map +7 -0
  264. package/dist/mcp/tools/relationship-tools.js +167 -0
  265. package/dist/mcp/tools/relationship-tools.js.map +7 -0
  266. package/dist/mcp/tools/review-open.js +210 -0
  267. package/dist/mcp/tools/review-open.js.map +7 -0
  268. package/dist/mcp/tools/shared.js +35 -4
  269. package/dist/mcp/tools/shared.js.map +2 -2
  270. package/dist/mcp/tools/spec-type.js +90 -0
  271. package/dist/mcp/tools/spec-type.js.map +7 -0
  272. package/dist/reports/model-report-orchestrator.js +31 -2
  273. package/dist/reports/model-report-orchestrator.js.map +2 -2
  274. package/dist/schemas/bundled/analyzers/cbm.json +1200 -70
  275. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  276. package/dist/schemas/bundled/api.json +1029 -1658
  277. package/dist/schemas/bundled/apm.json +499 -734
  278. package/dist/schemas/bundled/application.json +735 -371
  279. package/dist/schemas/bundled/base.json +3 -220
  280. package/dist/schemas/bundled/business.json +452 -366
  281. package/dist/schemas/bundled/data-model.json +395 -411
  282. package/dist/schemas/bundled/data-store.json +334 -558
  283. package/dist/schemas/bundled/manifest.json +18 -18
  284. package/dist/schemas/bundled/motivation.json +349 -368
  285. package/dist/schemas/bundled/navigation.json +415 -731
  286. package/dist/schemas/bundled/product.json +325 -159
  287. package/dist/schemas/bundled/security.json +864 -1232
  288. package/dist/schemas/bundled/technology.json +574 -703
  289. package/dist/schemas/bundled/testing.json +865 -1646
  290. package/dist/schemas/bundled/ux.json +739 -1352
  291. package/dist/server/schemas.js +8 -0
  292. package/dist/server/schemas.js.map +2 -2
  293. package/dist/server/server.js +686 -231
  294. package/dist/server/server.js.map +3 -3
  295. package/dist/server/viewer-registry.js +264 -0
  296. package/dist/server/viewer-registry.js.map +7 -0
  297. package/dist/server-entry.js +2 -1
  298. package/dist/server-entry.js.map +2 -2
  299. package/dist/telemetry/index.js +1 -1
  300. package/dist/utils/ansi-suppressor.js +6 -8
  301. package/dist/utils/ansi-suppressor.js.map +2 -2
  302. package/dist/utils/attribute-patch.js +41 -0
  303. package/dist/utils/attribute-patch.js.map +7 -0
  304. package/dist/utils/error-hints.js +29 -0
  305. package/dist/utils/error-hints.js.map +7 -0
  306. package/dist/utils/errors.js +9 -3
  307. package/dist/utils/errors.js.map +2 -2
  308. package/dist/utils/id-generator.js +5 -2
  309. package/dist/utils/id-generator.js.map +2 -2
  310. package/dist/utils/project-paths.js +26 -1
  311. package/dist/utils/project-paths.js.map +2 -2
  312. package/dist/utils/source-reference.js +64 -31
  313. package/dist/utils/source-reference.js.map +2 -2
  314. package/dist/utils/spec-version.js +2 -2
  315. package/dist/utils/spec-version.js.map +1 -1
  316. package/dist/validators/composed-reference-validator.js +5 -27
  317. package/dist/validators/composed-reference-validator.js.map +2 -2
  318. package/dist/validators/model-warnings.js +28 -0
  319. package/dist/validators/model-warnings.js.map +7 -0
  320. package/dist/validators/reference-validator.js +0 -7
  321. package/dist/validators/reference-validator.js.map +2 -2
  322. package/dist/validators/relationship-schema-validator.js +3 -3
  323. package/dist/validators/relationship-schema-validator.js.map +2 -2
  324. package/dist/validators/schema-validator.js +27 -9
  325. package/dist/validators/schema-validator.js.map +2 -2
  326. package/dist/validators/types.js.map +1 -1
  327. package/dist/viewer/README.md +6 -6
  328. package/dist/viewer/assets/main-CUOQGGRA.css +1 -0
  329. package/dist/viewer/assets/main-DvH3gYrI.js +84 -0
  330. package/dist/viewer/index.html +2 -2
  331. package/dist/viewer/manifest.json +10 -10
  332. package/dist/viewer/version.json +1 -1
  333. package/package.json +2 -1
  334. package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
  335. package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
@@ -15,13 +15,13 @@ triggers:
15
15
  "actor objective",
16
16
  "STS-ml"
17
17
  ]
18
- version: 0.8.1
18
+ version: 0.8.3
19
19
  ---
20
20
 
21
21
  # Security Layer Skill
22
22
 
23
23
  **Layer Number:** 03
24
- **Specification:** Metadata Model Spec v0.8.1
24
+ **Specification:** Metadata Model Spec v0.8.3
25
25
  **Purpose:** Defines authentication, authorization, access control, data classification, and security policies including STS-ml concepts for goal-oriented security modeling.
26
26
 
27
27
  ---
@@ -92,51 +92,60 @@ This layer uses a **custom YAML specification** designed to cover authentication
92
92
 
93
93
  ## Intra-Layer Relationships
94
94
 
95
- Security layer uses **containment relationships** rather than explicit ArchiMate-style relationships:
95
+ Containment is recorded with `aggregates` / `composes`; behavior and access rules use the predicates below. Record each link with `dr relationship add`.
96
96
 
97
- ### Containment Hierarchy
97
+ Access follows one chain: actors are `assigned-to` roles, roles `aggregates` permissions, and
98
+ permissions `authorizes` resource operations. A policy `composes` its rules, and a rule `uses` its
99
+ conditions and `triggers` its actions. Policies `mandates` countermeasures, and only countermeasures
100
+ `mitigates` threats. Audit configs and rules `generates` evidence, which retention policies govern.
101
+ Other layers link to the individual duty rule (separation of duty, binding of duty, need to know),
102
+ not to the constraints container, and data elements `references` their classification.
98
103
 
99
- ```
100
- SecurityModel
101
- ├── contains → AuthenticationConfig
102
- ├── contains → Actors []
103
- │ └── each Actor contains → ActorObjectives [], ActorDependencies []
104
- ├── contains → Roles []
105
- ├── contains → Permissions []
106
- ├── contains → SecureResources []
107
- │ └── each SecureResource contains → ResourceOperations []
108
- │ └── each ResourceOperation contains → AccessConditions [], FieldAccessControls []
109
- ├── contains → InformationEntities []
110
- │ └── each InformationEntity contains → InformationRights []
111
- ├── contains → Delegations []
112
- ├── contains → SecurityConstraints
113
- │ ├── contains → SeparationOfDuty []
114
- │ ├── contains → BindingOfDuty []
115
- │ └── contains → NeedToKnow []
116
- ├── contains → SecurityPolicies []
117
- │ └── each SecurityPolicy contains → PolicyRules []
118
- │ └── each PolicyRule contains → PolicyActions []
119
- ├── contains → DataClassification
120
- ├── contains → SocialDependencies []
121
- ├── contains → AccountabilityRequirements []
122
- │ └── each AccountabilityRequirement contains → Evidence []
123
- └── contains → Threats []
124
- └── each Threat contains → Countermeasures []
125
- ```
104
+ ### Containment
105
+
106
+ | Source Type | Predicate | Target Type | Example |
107
+ | ------------------- | ---------- | -------------------- | ---------------------------------------------------------- |
108
+ | SecurityModel | composes | AuthenticationConfig | "Application Security" composes "OAuth2 Google" |
109
+ | SecurityModel | composes | SecurityPolicy | "Application Security" composes "Data Access Policy" |
110
+ | SecurityModel | aggregates | Role | "Application Security" aggregates "Admin", "User", "Guest" |
111
+ | SecurityModel | aggregates | Threat | "Application Security" aggregates "SQL Injection" |
112
+ | SecureResource | composes | ResourceOperation | "User API" composes "List Users", "Create User" |
113
+ | SecureResource | composes | FieldAccessControl | "Customer Record" composes "Mask SSN For Support" |
114
+ | SecurityPolicy | composes | PolicyRule | "Data Access Policy" composes "Owner Can Write" |
115
+ | SecurityConstraints | aggregates | SeparationOfDuty | "Payment Controls" aggregates "Approve Payment SoD" |
126
116
 
127
117
  ### Key Relationship Patterns
128
118
 
129
- | Source | Relationship | Target | Example |
130
- | ---------------- | ------------- | ------------------- | -------------------------------------------------------- |
131
- | Actor | has-objective | ActorObjective | "Support Agent" has objective "Resolve Customer Issues" |
132
- | Actor | depends-on | InformationEntity | Actor depends on information to achieve objectives |
133
- | Actor | delegates-to | Actor | "Manager" delegates "Approval Permission" to "Team Lead" |
134
- | Role | inherits-from | Role | "Admin" inherits from "User" |
135
- | Permission | applies-to | SecureResource | "users.read" applies to "UserData" resource |
136
- | PolicyRule | evaluates | AccessCondition | Rule evaluates ABAC conditions |
137
- | Threat | mitigated-by | Countermeasure | "SQL Injection" mitigated by "Input Validation" |
138
- | ActorObjective | references | Goal (Layer 1) | Security objective links to business goal |
139
- | SocialDependency | defines | Actor → Actor trust | "Vendor" depends on "Company" for payment |
119
+ | Source Type | Predicate | Target Type | Example |
120
+ | ------------------------- | -------------- | ------------------------- | ------------------------------------------------------------- |
121
+ | Actor | assigned-to | Role | "Support Agent" assigned-to "Support" |
122
+ | AuthenticationConfig | authenticates | Actor | "mTLS Client Certificate" authenticates "Service Account" |
123
+ | Role | aggregates | Permission | "Admin" aggregates "users.write" |
124
+ | Role | specializes | Role | "Admin" specializes "User" |
125
+ | Permission | authorizes | ResourceOperation | "users.read" authorizes "List Users" |
126
+ | ResourceOperation | constrained-by | AccessCondition | "Update Invoice" constrained-by "Is Owner" |
127
+ | ResourceOperation | references | AuditConfig | "Delete User" references "Admin Action Audit" |
128
+ | AuthenticationConfig | uses | PasswordPolicy | "Internal JWT Login" uses "Corporate Password Policy" |
129
+ | AuthenticationConfig | protects | SecureResource | "OAuth2 Google" protects "User API" |
130
+ | FieldAccessControl | requires | Permission | "SSN Field Read" requires "pii.read" |
131
+ | PolicyRule | uses | AccessCondition | "Owner Can Write" uses "Is Owner" |
132
+ | PolicyRule | triggers | PolicyAction | "Block After 5 Failures" triggers "Lock Account" |
133
+ | PolicyRule | authorizes | Permission | "Business Hours Only" authorizes "payments.approve" |
134
+ | Delegation | authorizes | Role | "Budget Approval Delegation" authorizes "Approver" |
135
+ | Delegation | requires | Actor | "Budget Approval Delegation" requires "CFO" (delegatee) |
136
+ | InformationRight | assigned-to | Actor | "Read Customer PII" assigned-to "Support Agent" |
137
+ | InformationRight | accesses | InformationEntity | "Read Customer PII" accesses "Customer PII" |
138
+ | NeedToKnow | protects | InformationEntity | "Support Needs Ticket Context" protects "Customer PII" |
139
+ | SeparationOfDuty | constrains | Role | "Approve Payment SoD" constrains "Payment Creator" |
140
+ | BindingOfDuty | governs | ResourceOperation | "Refund Same Handler" governs "Complete Refund" |
141
+ | DataClassification | governs | SecureResource | "Confidential" governs "Customer Record" |
142
+ | Threat | targets | SecureResource | "SQL Injection" targets "Orders Database" |
143
+ | Countermeasure | mitigates | Threat | "Parameterized Queries" mitigates "SQL Injection" |
144
+ | Countermeasure | protects | SecureResource | "WAF Rules" protects "Public API" |
145
+ | AuditConfig | monitors | SecureResource | "Admin Action Audit" monitors "User API" |
146
+ | AuditConfig | satisfies | AccountabilityRequirement | "Admin Action Audit" satisfies "Non-Repudiation Of Admin Ops" |
147
+ | AccountabilityRequirement | requires | Evidence | "Non-Repudiation Of Admin Ops" requires "Signed Audit Entry" |
148
+ | RetentionPolicy | governs | AuditConfig | "7-Year Audit Retention" governs "Admin Action Audit" |
140
149
 
141
150
  ---
142
151
 
@@ -144,31 +153,41 @@ SecurityModel
144
153
 
145
154
  ### Outgoing References (Security → Other Layers)
146
155
 
147
- | Target Layer | Reference Type | Example |
148
- | ------------------------- | ------------------------------------------------ | --------------------------------------------------------- |
149
- | **Layer 1 (Motivation)** | Actor references **Stakeholder** | Security actor maps to business stakeholder |
150
- | **Layer 1 (Motivation)** | ActorObjective references **Goal** | "Protect Customer Data" objective links to "Privacy Goal" |
151
- | **Layer 1 (Motivation)** | Threat references **Assessment** | Threat is a risk assessment |
152
- | **Layer 1 (Motivation)** | Countermeasure implements **Requirement** | Security control fulfills security requirement |
153
- | **Layer 1 (Motivation)** | SocialDependency references **Constraint** | Trust commitments are constraints |
154
- | **Layer 2 (Business)** | Actor references **BusinessActor** | Security actor maps to business role |
155
- | **Layer 2 (Business)** | SecurityConstraints apply to **BusinessProcess** | Separation of duty applies to business tasks |
156
- | **Layer 4 (Application)** | SecureResource references **ApplicationService** | Protects application components |
157
- | **Layer 4 (Application)** | SecureResource references **DataObject** | Protects application data |
158
- | **Layer 6 (API)** | SecureResource references **API Operations** | API endpoint security |
159
- | **Layer 6 (API)** | SecurityScheme maps to **API SecurityScheme** | OAuth2 config maps to OpenAPI security |
160
- | **Layer 5 (Technology)** | Artifact **encryption** property | Data-at-rest encryption |
161
- | **Layer 5 (Technology)** | Artifact **classification** property | Data classification levels |
162
- | **Layer 11 (APM)** | AuditConfig **retention** | Audit log retention policies |
163
- | **Layer 11 (APM)** | AuditConfig **monitoring** | Security event monitoring |
164
-
165
- ### Incoming References (Lower Layers → Security)
166
-
167
- Lower layers reference Security layer to:
168
-
169
- - Apply authentication/authorization to services and APIs
170
- - Enforce data classification on artifacts and data objects
171
- - Implement security policies and access controls
156
+ | Source Type | Predicate | Target Type | Example |
157
+ | ------------------------- | ---------- | -------------------------- | --------------------------------------------------------------- |
158
+ | Countermeasure | satisfies | `motivation.requirement` | "Parameterized Queries" satisfies "Prevent Injection Attacks" |
159
+ | Countermeasure | realizes | `motivation.goal` | "Encrypt PII At Rest" realizes "Protect Customer Privacy" |
160
+ | SecurityPolicy | satisfies | `motivation.requirement` | "Data Access Policy" satisfies "GDPR Article 32" |
161
+ | SecurityPolicy | satisfies | `motivation.principle` | "Default Deny Policy" satisfies "Least Privilege" |
162
+ | SecurityConstraints | satisfies | `motivation.constraint` | "Payment Controls" satisfies "SOX Dual Control" |
163
+ | AccountabilityRequirement | satisfies | `motivation.requirement` | "Non-Repudiation Of Admin Ops" satisfies "Audit Trail Required" |
164
+ | Threat | references | `motivation.driver` | "Credential Stuffing" references "Account Takeover Risk" |
165
+ | Role | references | `business.businessrole` | "Admin" references "System Administrator" |
166
+ | SeparationOfDuty | constrains | `business.businessrole` | "Approve Payment SoD" constrains "Accounts Payable Clerk" |
167
+ | SecurityPolicy | governs | `business.businessprocess` | "Refund Approval Policy" governs "Process Refund" |
168
+ | SecurityPolicy | governs | `business.businessservice` | "PCI Policy" governs "Card Payments" |
169
+ | Countermeasure | protects | `business.businessprocess` | "Fraud Scoring" protects "Checkout" |
170
+ | SecureResource | references | `business.businessobject` | "Customer Record" references "Customer" |
171
+ | Threat | targets | `business.businessservice` | "Card Testing Attack" targets "Card Payments" |
172
+
173
+ ### Incoming References (Other Layers → Security)
174
+
175
+ | Source Type | Predicate | Target Type | Example |
176
+ | ---------------------------------- | -------------- | -------------------- | ------------------------------------------------------- |
177
+ | `application.applicationinterface` | exposes | SecureResource | "User REST API" exposes "User API" resource |
178
+ | `application.applicationcomponent` | realizes | Countermeasure | "Fetch Interceptor" realizes "Bearer Token Injection" |
179
+ | `application.applicationservice` | requires | AuthenticationConfig | "Order API" requires "Internal JWT" |
180
+ | `application.applicationservice` | constrained-by | SecurityPolicy | "Patient Records Service" constrained-by "HIPAA Policy" |
181
+ | `api.operation` | requires | Permission | "GET /users" requires "users.read" |
182
+ | `api.securityscheme` | realizes | SecurityPolicy | "bearerAuth" realizes "API Authentication Policy" |
183
+ | `api.ratelimit` | realizes | Countermeasure | "100 req/min per key" realizes "Rate Limiting" |
184
+ | `business.businessprocess` | constrained-by | SeparationOfDuty | "Approve Payment" constrained-by "Approve Payment SoD" |
185
+ | `data-model.schemaproperty` | satisfies | FieldAccessControl | "Customer.ssn" satisfies "Mask SSN For Support" |
186
+ | `data-store.field` | references | DataClassification | "customers.ssn" references "Restricted" |
187
+ | `navigation.navigationguard` | requires | Role | "AdminGuard" requires "Admin" |
188
+ | `ux.view` | requires | Permission | "User Admin Screen" requires "users.write" |
189
+ | `apm.logconfiguration` | satisfies | AuditConfig | "Audit Log Pipeline" satisfies "Admin Action Audit" |
190
+ | `testing.testcasesketch` | tests | Threat | "Injection payloads on search" tests "SQL Injection" |
172
191
 
173
192
  ---
174
193
 
@@ -310,7 +329,7 @@ def get_user_by_email(email: str):
310
329
 
311
330
  - Threat: "SQL Injection" (likelihood: high, impact: critical)
312
331
  - Countermeasure: "Parameterized Queries"
313
- - Threat mitigated-by Countermeasure
332
+ - Countermeasure mitigates Threat
314
333
 
315
334
  ---
316
335
 
@@ -325,11 +344,9 @@ dr add security model "application-security" \
325
344
 
326
345
  # Add authentication providers
327
346
  dr add security authentication-config "oauth2-google" \
328
- --properties provider=oauth2,name=google,scopes=openid:email:profile \
329
347
  --description "Google OAuth2 authentication"
330
348
 
331
349
  dr add security authentication-config "jwt-internal" \
332
- --properties provider=jwt,expiration=3600 \
333
350
  --description "Internal JWT authentication"
334
351
  ```
335
352
 
@@ -338,28 +355,22 @@ dr add security authentication-config "jwt-internal" \
338
355
  ```bash
339
356
  # Add roles
340
357
  dr add security role "admin" \
341
- --properties hierarchy=1 \
342
358
  --description "System administrator with full access"
343
359
 
344
360
  dr add security role "user" \
345
- --properties hierarchy=2,inherits-from=guest \
346
361
  --description "Regular authenticated user"
347
362
 
348
363
  dr add security role "guest" \
349
- --properties hierarchy=3 \
350
364
  --description "Unauthenticated visitor"
351
365
 
352
366
  # Add permissions
353
367
  dr add security permission "users.read" \
354
- --properties scope=resource,resource=users,action=read \
355
368
  --description "Read access to user data"
356
369
 
357
370
  dr add security permission "users.write" \
358
- --properties scope=resource,resource=users,action=write \
359
371
  --description "Write access to user data"
360
372
 
361
373
  dr add security permission "admin.all" \
362
- --properties scope=global \
363
374
  --description "Full administrative access"
364
375
  ```
365
376
 
@@ -368,40 +379,29 @@ dr add security permission "admin.all" \
368
379
  ```bash
369
380
  # Protected API endpoint
370
381
  dr add security secure-resource "user-api" \
371
- --properties type=api,path=/api/users \
372
382
  --description "User management API endpoints"
373
383
 
374
384
  # Add resource operation
375
385
  dr add security resource-operation "list-users" \
376
- --properties resource=user-api,method=GET,allowed-roles=admin:manager \
377
386
  --description "List all users operation"
378
387
 
379
388
  dr add security resource-operation "create-user" \
380
- --properties resource=user-api,method=POST,required-permissions=users.write \
381
389
  --description "Create new user operation"
382
390
  ```
383
391
 
384
- ### Step 4: Define Security Actors and Objectives (STS-ml)
392
+ ### Step 4: Define Security Actors (STS-ml)
385
393
 
386
394
  ```bash
387
395
  # Security actors
388
396
  dr add security actor "support-agent" \
389
- --properties type=role \
390
397
  --description "Customer support team member"
391
398
 
392
- # Actor objectives (link to motivation goals)
393
- dr add security actor-objective "resolve-customer-issues" \
394
- --properties actor=support-agent \
395
- --description "Provide timely customer support"
399
+ # Assign the actor to a role and the authentication it must use
400
+ dr relationship add security.actor.support-agent \
401
+ security.role.user --predicate assigned-to
396
402
 
397
- # Link objective to motivation layer
398
- dr relationship add "security/actor-objective/resolve-customer-issues" \
399
- supports "motivation/goal/customer-satisfaction"
400
-
401
- # Actor dependencies
402
- dr add security actor-dependency "support-needs-customer-data" \
403
- --properties depender=support-agent,dependee=system,resource=customer-information \
404
- --description "Support agent requires customer data to resolve issues"
403
+ dr relationship add security.authenticationconfig.oauth2-google \
404
+ security.actor.support-agent --predicate authenticates
405
405
  ```
406
406
 
407
407
  ### Step 5: Define Information Entities and Rights
@@ -409,16 +409,13 @@ dr add security actor-dependency "support-needs-customer-data" \
409
409
  ```bash
410
410
  # Information entity (STS-ml)
411
411
  dr add security information-entity "customer-pii" \
412
- --properties classification=confidential \
413
412
  --description "Customer personally identifiable information"
414
413
 
415
414
  # Information rights (produce, read, modify, distribute)
416
415
  dr add security information-right "support-read-pii" \
417
- --properties entity=customer-pii,actor=support-agent,rights=read \
418
416
  --description "Support can read customer PII"
419
417
 
420
418
  dr add security information-right "admin-full-pii" \
421
- --properties entity=customer-pii,actor=admin,rights=produce:read:modify:distribute \
422
419
  --description "Admin has full rights to customer PII"
423
420
  ```
424
421
 
@@ -427,17 +424,14 @@ dr add security information-right "admin-full-pii" \
427
424
  ```bash
428
425
  # Separation of duty
429
426
  dr add security separation-of-duty "approve-payment-sod" \
430
- --properties tasks=create-payment:approve-payment \
431
427
  --description "Payment creation and approval must be done by different actors"
432
428
 
433
429
  # Binding of duty
434
430
  dr add security binding-of-duty "handle-refund-bod" \
435
- --properties tasks=initiate-refund:complete-refund \
436
431
  --description "Same actor must initiate and complete refund process"
437
432
 
438
433
  # Need to know
439
434
  dr add security need-to-know "customer-data-ntk" \
440
- --properties information=customer-pii,objective=resolve-customer-issues \
441
435
  --description "Access to customer PII only when resolving customer issues"
442
436
  ```
443
437
 
@@ -446,17 +440,18 @@ dr add security need-to-know "customer-data-ntk" \
446
440
  ```bash
447
441
  # Identify threats
448
442
  dr add security threat "sql-injection" \
449
- --properties likelihood=high,impact=critical,category=injection \
450
443
  --description "SQL injection via user input fields"
451
444
 
452
445
  # Add countermeasures
453
446
  dr add security countermeasure "parameterized-queries" \
454
- --properties threat=sql-injection,status=implemented \
455
447
  --description "Use parameterized queries for all database operations"
456
448
 
457
- # Link threat to motivation layer
458
- dr relationship add "security/threat/sql-injection" \
459
- references "motivation/assessment/security-vulnerability-risk"
449
+ # Link countermeasure to threat, and to the requirement it satisfies
450
+ dr relationship add security.countermeasure.parameterized-queries \
451
+ security.threat.sql-injection --predicate mitigates
452
+
453
+ dr relationship add security.countermeasure.parameterized-queries \
454
+ motivation.requirement.prevent-injection-attacks --predicate satisfies
460
455
  ```
461
456
 
462
457
  ### Step 8: Define Policies (ABAC)
@@ -464,41 +459,42 @@ dr relationship add "security/threat/sql-injection" \
464
459
  ```bash
465
460
  # Declarative security policy
466
461
  dr add security policy "data-access-policy" \
467
- --properties priority=100,enabled=true \
468
462
  --description "Attribute-based data access control"
469
463
 
470
464
  # Policy rule
471
465
  dr add security policy-rule "owner-can-write" \
472
- --properties policy=data-access-policy,effect=allow \
473
466
  --description "Resource owner can write to their own resources"
474
467
 
475
468
  # Access condition (ABAC expression)
476
469
  dr add security access-condition "is-owner" \
477
- --properties field=resource.owner_id,operator=equals,value=user.id \
478
470
  --description "User is the resource owner"
479
471
  ```
480
472
 
481
473
  ### Step 9: Cross-Layer Integration
482
474
 
483
475
  ```bash
484
- # Link to application layer
485
- dr relationship add "security/secure-resource/user-api" \
486
- protects "application/service/user-management-api"
476
+ # Application interface exposes the secure resource
477
+ dr relationship add application.applicationinterface.user-api-rest \
478
+ security.secureresource.user-api --predicate exposes
479
+
480
+ # API operation requires a permission
481
+ dr relationship add api.operation.get-users \
482
+ security.permission.users-read --predicate requires
487
483
 
488
- # Link to API layer
489
- dr relationship add "security/resource-operation/list-users" \
490
- protects "api/operation/get-users"
484
+ # Security role references a business role
485
+ dr relationship add security.role.admin \
486
+ business.businessrole.system-administrator --predicate references
491
487
 
492
- # Link to motivation layer
493
- dr relationship add "security/actor/support-agent" \
494
- references "motivation/stakeholder/customer-support-team"
488
+ # Security policy satisfies a motivation requirement
489
+ dr relationship add security.securitypolicy.data-access-policy \
490
+ motivation.requirement.gdpr-article-32 --predicate satisfies
495
491
  ```
496
492
 
497
493
  ### Step 10: Validate
498
494
 
499
495
  ```bash
500
- dr validate --layer security
501
- dr validate --validate-relationships
496
+ dr validate --layers security
497
+ dr validate --relationships
502
498
  ```
503
499
 
504
500
  ---
@@ -509,36 +505,37 @@ dr validate --validate-relationships
509
505
 
510
506
  ```
511
507
  Role: "Admin" (hierarchy: 1)
512
- ├── inherits-from → Role: "Manager" (hierarchy: 2)
513
- │ ├── inherits-from → Role: "User" (hierarchy: 3)
514
- │ │ └── inherits-from → Role: "Guest" (hierarchy: 4)
515
- │ └── has-permission → Permission: "users.write"
516
- ├── has-permission → Permission: "admin.all"
517
- └── allowed-on → ResourceOperation: "delete-user"
508
+ ├── specializes → Role: "Manager" (hierarchy: 2)
509
+ │ ├── specializes → Role: "User" (hierarchy: 3)
510
+ │ │ └── specializes → Role: "Guest" (hierarchy: 4)
511
+ │ └── aggregates → Permission: "users.write"
512
+ └── aggregates → Permission: "admin.all"
513
+ └── authorizes → ResourceOperation: "delete-user"
518
514
  ```
519
515
 
520
516
  ### Pattern 2: Goal-Oriented Security (STS-ml)
521
517
 
522
518
  ```
523
519
  Actor: "Data Analyst"
524
- ├── has-objective → ActorObjective: "Generate Business Reports"
525
- │ └── supports → Goal: "Data-Driven Decisions" (Layer 1)
526
- ├── depends-on → InformationEntity: "Sales Data"
527
- │ ├── has-right → InformationRight: "read" (Data Analyst)
528
- │ └── classification: "internal"
529
- └── subject-to → NeedToKnow: "Access sales data only for reporting objectives"
520
+ ├── assigned-to → Role: "Analyst"
521
+ └── ← assigned-to — InformationRight: "Read Sales Data"
522
+ └── governs → InformationEntity: "Sales Data"
523
+ ├── constrained-by → DataClassification: "Internal"
524
+ └── ← protects — NeedToKnow: "Access sales data only for reporting"
525
+ Countermeasure: "Row-Level Security On Sales Data"
526
+ └── realizes → motivation.goal: "Data-Driven Decisions"
530
527
  ```
531
528
 
532
529
  ### Pattern 3: Delegation Chain
533
530
 
534
531
  ```
535
532
  Actor: "CEO"
536
- └── delegates-to → Delegation: "Budget Approval"
537
- ├── delegatee → Actor: "CFO"
538
- ├── type: "approval"
539
- ├── retain-oversight: true
540
- └── delegates-to → Delegation: "Department Budget"
541
- ├── delegatee → Actor: "Department Head"
533
+ └── associated-with → Delegation: "Budget Approval"
534
+ ├── requires → Actor: "CFO" (delegatee)
535
+ ├── authorizes → Role: "Budget Approver"
536
+ ├── type: "approval", retain-oversight: true
537
+ └── (CFO) associated-with → Delegation: "Department Budget"
538
+ ├── requires → Actor: "Department Head" (delegatee)
542
539
  └── retain-oversight: true
543
540
  ```
544
541
 
@@ -549,12 +546,10 @@ Threat: "Unauthorized API Access"
549
546
  ├── likelihood: "high"
550
547
  ├── impact: "critical"
551
548
  ├── category: "broken-authentication"
552
- └── mitigated-by → Countermeasure: "JWT Authentication"
553
- ├── status: "implemented"
554
- └── mitigated-by → Countermeasure: "Rate Limiting"
555
- ├── status: "implemented"
556
- └── mitigated-by → Countermeasure: "API Key Rotation"
557
- └── status: "planned"
549
+ ├── aggregates → Countermeasure: "JWT Authentication" (status: implemented)
550
+ ├── aggregates → Countermeasure: "Rate Limiting" (status: implemented)
551
+ └── aggregates → Countermeasure: "API Key Rotation" (status: planned)
552
+ (each Countermeasure also mitigates → Threat: "Unauthorized API Access")
558
553
  ```
559
554
 
560
555
  ---
@@ -565,7 +560,7 @@ The Security Layer integrates **STS-ml 2.0** (Socio-Technical Security Modeling
565
560
 
566
561
  ### 1. Goal-Oriented Security
567
562
 
568
- - **Actor Objectives** link to Motivation Layer goals
563
+ - **Countermeasures and policies** link to Motivation Layer goals, principles and requirements (`realizes`, `satisfies`)
569
564
  - Security is justified by business goals
570
565
  - Traceability: Why do we need this security control?
571
566
 
@@ -619,15 +614,15 @@ The Security Layer integrates **STS-ml 2.0** (Socio-Technical Security Modeling
619
614
 
620
615
  ## Validation Tips
621
616
 
622
- | Issue | Cause | Fix |
623
- | ---------------------------- | ---------------------------------------------- | ------------------------------------ |
624
- | Orphaned Actor | Actor has no objectives or dependencies | Add actor objectives or remove actor |
625
- | Unmapped Threat | Threat has no countermeasures | Add countermeasures or accept risk |
626
- | Unused Permission | Permission not assigned to roles or operations | Assign to roles or remove |
627
- | Missing Field-Level Security | Sensitive data lacks FieldAccessControl | Add field-level access rules |
628
- | Unlinked Objective | ActorObjective doesn't link to motivation goal | Add cross-layer link |
629
- | No Evidence | AccountabilityRequirement lacks evidence | Define required evidence types |
630
- | Incomplete Delegation | Delegation chain missing delegatee | Complete delegation or remove |
617
+ | Issue | Cause | Fix |
618
+ | ---------------------------- | ---------------------------------------------- | ---------------------------------- |
619
+ | Orphaned Actor | Actor not assigned to any role | Assign to a Role or remove actor |
620
+ | Unmapped Threat | Threat has no countermeasures | Add countermeasures or accept risk |
621
+ | Unused Permission | Permission not assigned to roles or operations | Assign to roles or remove |
622
+ | Missing Field-Level Security | Sensitive data lacks FieldAccessControl | Add field-level access rules |
623
+ | Unlinked Countermeasure | Countermeasure doesn't satisfy a requirement | Add cross-layer link |
624
+ | No Evidence | AccountabilityRequirement lacks evidence | Define required evidence types |
625
+ | Incomplete Delegation | Delegation chain missing delegatee | Complete delegation or remove |
631
626
 
632
627
  ---
633
628
 
@@ -637,31 +632,31 @@ The Security Layer integrates **STS-ml 2.0** (Socio-Technical Security Modeling
637
632
 
638
633
  ```bash
639
634
  dr add security model <name>
640
- dr add security authentication-config <name> --properties provider=<type>
641
- dr add security role <name> --properties hierarchy=<number>
642
- dr add security permission <name> --properties scope=<scope>
643
- dr add security secure-resource <name> --properties type=<type>
644
- dr add security actor <name> --properties type=<type>
645
- dr add security actor-objective <name> --properties actor=<actor-id>
646
- dr add security information-entity <name> --properties classification=<level>
647
- dr add security threat <name> --properties likelihood=<value>,impact=<value>
648
- dr add security countermeasure <name> --properties threat=<threat-id>
649
- dr add security delegation <name> --properties delegator=<actor>,delegatee=<actor>
635
+ dr add security authentication-config <name> --description <description>
636
+ dr add security role <name> --description <description>
637
+ dr add security permission <name> --description <description>
638
+ dr add security secure-resource <name> --description <description>
639
+ dr add security actor <name> --description <description>
640
+ dr add security information-entity <name> --description <description>
641
+ dr add security threat <name> --description <description>
642
+ dr add security countermeasure <name> --description <description>
643
+ dr add security delegation <name> --description <description>
650
644
  ```
651
645
 
652
646
  **Relationship Commands:**
653
647
 
654
648
  ```bash
655
- dr relationship add <actor> has-objective <objective>
656
- dr relationship add <threat> mitigated-by <countermeasure>
657
- dr relationship add <secure-resource> protects <application-service>
658
- dr relationship add <actor-objective> supports <motivation-goal>
649
+ dr relationship add <actor> <role> --predicate assigned-to
650
+ dr relationship add <role> <permission> --predicate aggregates
651
+ dr relationship add <permission> <resource-operation> --predicate authorizes
652
+ dr relationship add <countermeasure> <threat> --predicate mitigates
659
653
  ```
660
654
 
661
655
  **Cross-Layer Commands:**
662
656
 
663
657
  ```bash
664
- dr relationship add security/<actor> references motivation/<stakeholder>
665
- dr relationship add security/<secure-resource> protects application/<service>
666
- dr relationship add security/<resource-operation> protects api/<operation>
658
+ dr relationship add <countermeasure> <motivation-requirement> --predicate satisfies
659
+ dr relationship add <security-role> <business-role> --predicate maps-to
660
+ dr relationship add <application-interface> <secure-resource> --predicate exposes
661
+ dr relationship add <api-operation> <permission> --predicate requires
667
662
  ```