@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
@@ -11,13 +11,13 @@ triggers:
11
11
  "microservice",
12
12
  "archimate application"
13
13
  ]
14
- version: 0.8.1
14
+ version: 0.8.3
15
15
  ---
16
16
 
17
17
  # Application Layer Skill
18
18
 
19
19
  **Layer Number:** 04
20
- **Specification:** Metadata Model Spec v0.8.1
20
+ **Specification:** Metadata Model Spec v0.8.3
21
21
  **Purpose:** Describes application services, components, and interfaces that support business processes and bridge requirements with technical implementation.
22
22
 
23
23
  ---
@@ -43,7 +43,7 @@ This layer uses **ArchiMate 3.2 Application Layer** standard with optional prope
43
43
 
44
44
  | Entity Type | Description | Key Attributes |
45
45
  | ---------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------- |
46
- | **ApplicationComponent** | Modular, deployable, replaceable part of a system | Types: frontend, backend, mobile, desktop, service, library, batch, worker |
46
+ | **ApplicationComponent** | Modular, deployable, replaceable part of a system | Types: generic, external, internal, service-component |
47
47
  | **ApplicationCollaboration** | Aggregate of application components working together | Example: Microservices ecosystem, service mesh |
48
48
  | **ApplicationInterface** | Point of access where application service is available | Protocols: REST, GraphQL, SOAP, gRPC, WebSocket, Message Queue, Event Bus |
49
49
  | **ApplicationFunction** | Automated behavior performed by application component | Examples: Authentication, Data Validation, Caching, Logging |
@@ -55,6 +55,75 @@ This layer uses **ArchiMate 3.2 Application Layer** standard with optional prope
55
55
 
56
56
  ---
57
57
 
58
+ ## Type Decision Tree
59
+
60
+ Use this decision tree **before assigning a type** to any code pattern. Follow the first matching branch.
61
+
62
+ ```
63
+ IS this a deployed, executable unit (container, microservice, SPA app shell, module)?
64
+ → ApplicationComponent (type: generic/internal/external)
65
+
66
+ IS this a React component, UI widget, or view?
67
+ → ApplicationComponent (type: generic) — link to ux.component.* for UI detail
68
+
69
+ IS this a Zustand store, Redux slice, or other state container?
70
+ → ApplicationFunction (performs automated state management behavior)
71
+ NOT ApplicationComponent — stores are behavior, not deployable modules
72
+ Cross-reference: assign the function to the parent ApplicationComponent that owns it
73
+
74
+ IS this a class/function that provides a capability to other parts of the system
75
+ (business logic, data transformation, orchestration)?
76
+ → ApplicationService (serviceType: synchronous/asynchronous/event-driven/batch)
77
+
78
+ IS this a URL, port, protocol interface, or access point
79
+ (REST endpoint group, WebSocket endpoint, message queue, postMessage bridge)?
80
+ → ApplicationInterface (protocol: REST/WebSocket/AMQP/HTTP)
81
+
82
+ IS this a stateless, single-purpose algorithm or behavior
83
+ (parse, validate, transform, export, calculate, layout)?
84
+ → ApplicationFunction (NOT ApplicationService)
85
+
86
+ IS this a multi-step workflow, pipeline, or saga
87
+ (load → parse → validate → render)?
88
+ → ApplicationProcess
89
+ NOTE: Use ApplicationProcess for orchestration logic triggered by navigation
90
+ (data loading pipelines, guards that orchestrate multiple async operations).
91
+ Use navigation.route for route definitions that map URL patterns to views.
92
+ If a route component is purely declarative (no significant orchestration logic),
93
+ it belongs only in navigation.route — not ApplicationProcess.
94
+
95
+ IS this a state change notification or domain event
96
+ (model.updated, annotation.added)?
97
+ → ApplicationEvent (eventType: domain/integration/system)
98
+
99
+ IS this a data structure, DTO, or typed payload
100
+ (ModelData, Annotation, Changeset)?
101
+ → DataObject
102
+
103
+ IS this a collection of components that together form a subsystem
104
+ (all layout engines, all application services)?
105
+ → ApplicationCollaboration
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Common Misclassifications
111
+
112
+ Explicit DO NOT rules with rationale:
113
+
114
+ | Misclassification | Correct Classification | Why |
115
+ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
116
+ | Zustand store as `ApplicationService` | `ApplicationFunction` (performs automated state management behavior) | Stores are behavior, not deployable modules — assign to parent ApplicationComponent |
117
+ | Zustand store as `ApplicationComponent` | `ApplicationFunction` (performs automated state management behavior) | ArchiMate `ApplicationFunction` = "automated behavior performed by a component" — maps exactly to Zustand stores |
118
+ | WebSocket client as `ApplicationService` | `ApplicationInterface` (protocol: WebSocket) | A WebSocket connection is an interface/access point, not a service |
119
+ | Layout algorithm as `ApplicationService` | `ApplicationFunction` | Stateless algorithm = function, not a service with a contract |
120
+ | Layout engine CLASS as `ApplicationFunction` | `ApplicationComponent` (type: internal) | A class implementing an interface IS a deployable, replaceable module — not a stateless function |
121
+ | Export function as `ApplicationService` | `ApplicationFunction` if purely internal; `ApplicationService` only if it exposes an output contract | If purely internal algorithm: function. If it has an external contract (API, file): service |
122
+ | React UI component as `ApplicationService` | `ApplicationComponent` (type: generic) with UX cross-reference | UI components are components; link to UX layer for rendering details |
123
+ | Fetch interceptor / auth header injector | `ApplicationFunction` | Stateless function that wraps fetch — NOT a service; cross-reference `security.securitypolicy.*` |
124
+
125
+ ---
126
+
58
127
  ## Intra-Layer Relationships
59
128
 
60
129
  ### Structural Relationships
@@ -62,31 +131,43 @@ This layer uses **ArchiMate 3.2 Application Layer** standard with optional prope
62
131
  | Source Type | Predicate | Target Type | Example |
63
132
  | ------------------------ | ----------- | ---------------------- | ---------------------------------------------------------------------------------------- |
64
133
  | ApplicationCollaboration | aggregates | ApplicationComponent | "Payment Ecosystem" aggregates "PaymentService", "FraudDetection", "NotificationService" |
65
- | ApplicationComponent | composes | ApplicationInterface | Component exposes interface for external access |
66
- | ApplicationProcess | composes | ApplicationProcess | Workflow composed of sub-processes (saga pattern) |
67
- | ApplicationComponent | assigned-to | ApplicationFunction | Component performs specific function |
68
- | ApplicationCollaboration | assigned-to | ApplicationInteraction | Collaboration executes interaction pattern |
134
+ | ApplicationCollaboration | assigned-to | ApplicationInteraction | "Checkout Collaboration" assigned-to "Checkout Handshake" interaction |
135
+ | ApplicationCollaboration | realizes | ApplicationService | "Payment Ecosystem" realizes "Payment Service" |
136
+ | ApplicationComponent | provides | ApplicationInterface | "UserService" provides "User REST API" |
137
+ | ApplicationComponent | assigned-to | ApplicationFunction | "UserService" assigned-to "Token Validation" |
138
+ | ApplicationComponent | assigned-to | ApplicationProcess | "OrderOrchestrator" assigned-to "Order Fulfillment Saga" |
69
139
  | ApplicationComponent | realizes | ApplicationService | "UserManagementAPI" realizes "User Management Service" |
140
+ | ApplicationComponent | uses | ApplicationComponent | "OrderService" uses "InventoryService" |
70
141
  | ApplicationFunction | realizes | ApplicationService | "Authentication Function" realizes "Auth Service" |
71
142
  | ApplicationProcess | realizes | ApplicationService | "Order Processing Workflow" realizes "Order Service" |
72
- | ApplicationService | realizes | ApplicationInterface | Service exposes interface |
73
- | DataObject | specializes | DataObject | "CustomerOrder" specializes "Order" |
143
+ | ApplicationInterface | assigned-to | ApplicationService | "User REST API" assigned-to "User Management Service" (interface exposes the service) |
144
+ | DataObject | composes | DataObject | "Order" composes "OrderLineItem" |
145
+ | DataObject | aggregates | DataObject | "Cart" aggregates "Product" references |
74
146
 
75
147
  ### Behavioral Relationships
76
148
 
77
- | Source Type | Predicate | Target Type | Example |
78
- | ---------------------- | --------- | -------------------- | ----------------------------------------------- |
79
- | ApplicationEvent | triggers | ApplicationComponent | "OrderCreated" triggers "InventoryService" |
80
- | ApplicationEvent | triggers | ApplicationFunction | "UserLoggedIn" triggers "AuditLogging" function |
81
- | ApplicationEvent | triggers | ApplicationProcess | "PaymentFailed" triggers "RefundProcess" |
82
- | ApplicationProcess | triggers | ApplicationEvent | Workflow completion triggers event |
83
- | ApplicationService | flows-to | ApplicationService | Synchronous service-to-service call |
84
- | ApplicationProcess | flows-to | ApplicationProcess | Sequential process orchestration |
85
- | ApplicationService | accesses | DataObject | Service reads/writes data |
86
- | ApplicationFunction | accesses | DataObject | Function operates on data |
87
- | ApplicationProcess | accesses | DataObject | Workflow manipulates data |
88
- | ApplicationInteraction | accesses | DataObject | Interaction pattern involves data exchange |
89
- | ApplicationInterface | serves | ApplicationComponent | Interface provides access to component |
149
+ | Source Type | Predicate | Target Type | Example |
150
+ | ---------------------- | ---------- | ---------------------- | ---------------------------------------------------------------- |
151
+ | ApplicationEvent | triggers | ApplicationProcess | "PaymentFailed" triggers "Refund Process" |
152
+ | ApplicationEvent | triggers | ApplicationInteraction | "CheckoutStarted" triggers "Checkout Handshake" |
153
+ | ApplicationProcess | triggers | ApplicationEvent | "Place Order" triggers "OrderCreated" |
154
+ | ApplicationEvent | triggers | ApplicationFunction | "UserLoggedIn" triggers "Audit Logging" (event handler) |
155
+ | ApplicationFunction | triggers | ApplicationEvent | "Publish Order" triggers "OrderCreated" |
156
+ | ApplicationInteraction | triggers | ApplicationEvent | "Checkout Handshake" triggers "CheckoutCompleted" |
157
+ | ApplicationProcess | flows-to | ApplicationProcess | "Reserve Inventory" flows-to "Process Payment" |
158
+ | ApplicationFunction | flows-to | ApplicationFunction | "Parse Document" flows-to "Embed Chunks" |
159
+ | ApplicationService | flows-to | ApplicationService | "Checkout Service" flows-to "Payment Service" (synchronous call) |
160
+ | ApplicationService | depends-on | ApplicationService | "Order Service" depends-on "Inventory Service" |
161
+ | ApplicationService | serves | ApplicationComponent | "Auth Service" serves "WebApp" |
162
+ | ApplicationService | serves | ApplicationProcess | "Payment Service" serves "Order Fulfillment Saga" |
163
+ | ApplicationInterface | depends-on | ApplicationFunction | "API Gateway" depends-on "Rate Limiting" |
164
+ | ApplicationService | serves | ApplicationInteraction | "Payment Service" serves "Checkout Handshake" |
165
+ | ApplicationService | accesses | DataObject | "User Management Service" accesses "User" |
166
+ | ApplicationComponent | accesses | DataObject | "OrderService" accesses "Order" |
167
+ | ApplicationFunction | accesses | DataObject | "Data Validation" accesses "Order" |
168
+ | ApplicationProcess | accesses | DataObject | "Order Fulfillment Saga" accesses "Order" |
169
+ | ApplicationEvent | accesses | DataObject | "OrderCreated" accesses "Order" (event payload) |
170
+ | ApplicationInteraction | accesses | DataObject | "Checkout Handshake" accesses "PaymentIntent" |
90
171
 
91
172
  ---
92
173
 
@@ -94,31 +175,52 @@ This layer uses **ArchiMate 3.2 Application Layer** standard with optional prope
94
175
 
95
176
  ### Outgoing References (Application → Other Layers)
96
177
 
97
- | Target Layer | Reference Type | Example |
98
- | ------------------------ | ------------------------------------------------------- | ------------------------------------------ |
99
- | **Layer 1 (Motivation)** | ApplicationService supports **Goal** | Service achieves business goals |
100
- | **Layer 1 (Motivation)** | ApplicationService delivers **Value** | Service delivers business value |
101
- | **Layer 1 (Motivation)** | ApplicationService governed by **Principle** | Service follows architectural principles |
102
- | **Layer 1 (Motivation)** | ApplicationFunction fulfills **Requirement** | Function implements functional requirement |
103
- | **Layer 2 (Business)** | ApplicationService realizes **BusinessService** | Tech realizes business capability |
104
- | **Layer 2 (Business)** | ApplicationProcess supports **BusinessProcess** | Automates business workflow |
105
- | **Layer 2 (Business)** | DataObject represents **BusinessObject** | Technical data represents business concept |
106
- | **Layer 5 (Technology)** | ApplicationComponent deployed-on **Node** | Service deployed to Kubernetes cluster |
107
- | **Layer 5 (Technology)** | ApplicationService uses **TechnologyService** | Application uses database service |
108
- | **Layer 5 (Technology)** | DataObject stored-in **Artifact** | Data persisted in database |
109
- | **Layer 6 (API)** | ApplicationService defined-by **OpenAPI Specification** | Service has OpenAPI contract |
110
- | **Layer 7 (Data Model)** | DataObject defined-by **JSON Schema** | Data structure defined as schema |
111
- | **Layer 11 (APM)** | ApplicationService tracked-by **BusinessMetric** | Service performance monitored |
112
- | **Layer 11 (APM)** | ApplicationService has-sla **SLA Target** | Latency, availability targets |
113
- | **Layer 11 (APM)** | ApplicationService traced-by **APM** | Distributed tracing enabled |
114
-
115
- ### Incoming References (Lower Layers → Application)
116
-
117
- Lower layers reference Application layer to show:
118
-
119
- - **Technology supports Application** - Infrastructure hosts application components
120
- - **APIs implement Application Services** - OpenAPI specs define service contracts
121
- - **Data schemas define DataObjects** - JSON schemas provide data structure
178
+ | Source Type | Predicate | Target Type | Example |
179
+ | -------------------- | -------------- | ------------------------------- | -------------------------------------------------------------- |
180
+ | ApplicationService | realizes | `business.businessservice` | "Order API" realizes "Order Management" |
181
+ | ApplicationService | serves | `business.businessprocess` | "Payment Service" serves "Checkout" business process |
182
+ | ApplicationService | accesses | `business.businessobject` | "Order API" accesses "Customer Order" |
183
+ | ApplicationProcess | realizes | `business.businessprocess` | "Order Fulfillment Saga" realizes "Fulfill Order" |
184
+ | ApplicationFunction | realizes | `business.businessfunction` | "Credit Scoring" realizes "Risk Assessment" |
185
+ | ApplicationEvent | triggers | `business.businessprocess` | "PaymentFailed" triggers "Dunning" process |
186
+ | ApplicationInterface | serves | `business.businessrole` | "Admin Console" serves "Support Agent" |
187
+ | ApplicationService | realizes | `motivation.goal` | "User Management API" realizes "Improve User Experience" |
188
+ | ApplicationService | delivers | `motivation.value` | "Instant Checkout" delivers "Convenience" |
189
+ | ApplicationFunction | satisfies | `motivation.requirement` | "Token Validation" satisfies "Sessions Expire After 30 Min" |
190
+ | ApplicationService | realizes | `product.softwarecapability` | "Search Service" realizes "Product Discovery" |
191
+ | ApplicationService | realizes | `product.feature` | "Graph Layout Service" realizes "Interactive Graph View" |
192
+ | ApplicationService | requires | `security.authenticationconfig` | "Order API" requires "OAuth2 JWT Auth" |
193
+ | ApplicationService | constrained-by | `security.securitypolicy` | "Patient Records Service" constrained-by "HIPAA Access Policy" |
194
+ | ApplicationComponent | realizes | `security.countermeasure` | "Fetch Interceptor" realizes "Bearer Token Injection" |
195
+ | ApplicationComponent | accesses | `security.secureresource` | "OrderService" accesses "Order Records" |
196
+ | ApplicationComponent | accesses | `data-model.objectschema` | "OrderRepository" accesses the "Order" entity class |
197
+ | ApplicationFunction | accesses | `data-model.objectschema` | "saveOrder" accesses the "Order" entity class |
198
+ | ApplicationComponent | accesses | `data-model.schemadefinition` | "PayloadValidator" accesses the "Address" definition |
199
+ | ApplicationFunction | accesses | `data-model.schemadefinition` | "buildInvoice" accesses the "Invoice" definition |
200
+ | ApplicationEvent | accesses | `data-model.schemadefinition` | "OrderPlaced" accesses its "OrderPlacedPayload" definition |
201
+ | ApplicationComponent | accesses | `data-store.collection` | "OrderRepository" accesses the `orders` table |
202
+ | ApplicationFunction | accesses | `data-store.collection` | "findOrdersByCustomer" accesses `orders` |
203
+ | ApplicationFunction | accesses | `data-store.view` | "monthlyRevenueReport" accesses `monthly_revenue_mv` |
204
+ | ApplicationService | accesses | `data-store.collection` | "Order API" accesses `orders` |
205
+ | ApplicationService | accesses | `data-store.view` | "Reporting Service" accesses `monthly_revenue_mv` |
206
+ | ApplicationService | references | `apm.traceconfiguration` | "Order API" references "Order Service Tracing" |
207
+
208
+ ### Incoming References (Other Layers → Application)
209
+
210
+ | Source Type | Predicate | Target Type | Example |
211
+ | ------------------------------ | ---------- | -------------------- | --------------------------------------------------------- |
212
+ | `technology.node` | serves | ApplicationComponent | "K8s Cluster Prod" serves "UserService" (deployment host) |
213
+ | `technology.systemsoftware` | serves | ApplicationComponent | "React 18" serves "WebApp" |
214
+ | `technology.technologyservice` | serves | ApplicationService | "Managed PostgreSQL" serves "Order API" |
215
+ | `api.openapidocument` | realizes | ApplicationService | "user-api.yaml" realizes "User Management API" |
216
+ | `api.operation` | realizes | ApplicationFunction | "POST /auth/token" realizes "Token Issuance" |
217
+ | `data-model.objectschema` | realizes | DataObject | "User schema" realizes "User" |
218
+ | `business.businessobject` | references | DataObject | "Customer Order" references "Order" |
219
+ | `ux.actioncomponent` | triggers | ApplicationService | "Place Order" button triggers "Checkout Service" |
220
+ | `navigation.route` | lazy-loads | ApplicationComponent | "/settings" lazy-loads "SettingsPanel" |
221
+ | `apm.span` | monitors | ApplicationService | "checkout.process" span monitors "Checkout Service" |
222
+ | `apm.metricinstrument` | monitors | ApplicationService | "order_processing_latency" monitors "Order API" |
223
+ | `testing.testcasesketch` | tests | ApplicationService | "Checkout happy path" tests "Checkout Service" |
122
224
 
123
225
  ---
124
226
 
@@ -228,7 +330,7 @@ class OrderFulfillmentWorkflow:
228
330
 
229
331
  - ApplicationProcess: "OrderFulfillmentSaga" (pattern: saga)
230
332
  - Properties: orchestration-engine=temporal, compensation-enabled=true
231
- - Composes sub-processes (reserve, pay, ship)
333
+ - Sequences sub-processes (reserve, pay, ship) with `flows-to`
232
334
 
233
335
  ### Pattern 5: Data Transfer Object (DTO)
234
336
 
@@ -272,7 +374,49 @@ service UserService {
272
374
  - ApplicationService: "User Service"
273
375
  - ApplicationComponent: "UserService"
274
376
 
275
- ### Pattern 7: Message Queue Consumer
377
+ ### Pattern 7: AI / RAG Processing Pipeline
378
+
379
+ ```python
380
+ # Retrieval-Augmented Generation pipeline
381
+ class RAGPipeline:
382
+ """
383
+ Multi-stage AI document processing pipeline.
384
+ ApplicationProcess: RAGPipeline (pattern: pipeline)
385
+ """
386
+
387
+ def run(self, query: str) -> str:
388
+ chunks = self.chunker.chunk(documents) # ApplicationFunction: DocumentChunker
389
+ embeddings = self.embedder.embed(chunks) # ApplicationFunction: EmbeddingGenerator
390
+ results = self.retriever.retrieve( # ApplicationFunction: VectorRetriever
391
+ query_embedding, embeddings
392
+ )
393
+ return self.reranker.rerank(results, query) # ApplicationFunction: ResultReranker
394
+ ```
395
+
396
+ **Maps to:**
397
+
398
+ - ApplicationProcess: "RAGPipeline" (pattern: pipeline) — the orchestrating process
399
+ - ApplicationFunction: "DocumentChunker" — assigned-to the RAG component; `flows-to` EmbeddingGenerator
400
+ - ApplicationFunction: "EmbeddingGenerator" — `flows-to` VectorRetriever
401
+ - ApplicationFunction: "VectorRetriever" — `flows-to` ResultReranker
402
+ - ApplicationFunction: "ResultReranker" — terminal stage; delivers output to the calling service
403
+ - ApplicationComponent: "RAGService" — owns all four functions via `assigned-to`
404
+
405
+ **Key relationships:**
406
+
407
+ ```
408
+ ApplicationFunction: chunker → flows-to → ApplicationFunction: embedder
409
+ ApplicationFunction: embedder → flows-to → ApplicationFunction: retriever
410
+ ApplicationFunction: retriever → flows-to → ApplicationFunction: reranker
411
+ ApplicationComponent: rag-service → assigned-to → ApplicationFunction: chunker (×4)
412
+ ApplicationProcess: rag-pipeline → realizes → ApplicationService: rag-service
413
+ ```
414
+
415
+ > **Rule:** Each discrete pipeline stage is an `ApplicationFunction`, not a separate service — stages share the same component boundary and have no independent business contract. Use `ApplicationProcess` to model the orchestration. If a stage is independently deployable (e.g., a separate embedding microservice), elevate it to `ApplicationComponent` + `ApplicationService`.
416
+
417
+ ---
418
+
419
+ ### Pattern 8: Message Queue Consumer
276
420
 
277
421
  ```python
278
422
  # RabbitMQ consumer
@@ -312,21 +456,17 @@ class OrderEventConsumer:
312
456
  ```bash
313
457
  # Frontend component
314
458
  dr add application component "web-app" \
315
- --properties type=frontend,technology=react,repository=github.com/org/web-app \
316
459
  --description "Customer-facing web application"
317
460
 
318
461
  # Backend microservices
319
462
  dr add application component "user-service" \
320
- --properties type=backend,subtype=microservice,language=python \
321
463
  --description "User management microservice"
322
464
 
323
465
  dr add application component "order-service" \
324
- --properties type=backend,subtype=microservice,language=typescript \
325
466
  --description "Order processing microservice"
326
467
 
327
468
  # Worker component
328
469
  dr add application component "email-worker" \
329
- --properties type=worker,runtime=nodejs \
330
470
  --description "Background worker for email notifications"
331
471
  ```
332
472
 
@@ -335,17 +475,15 @@ dr add application component "email-worker" \
335
475
  ```bash
336
476
  # Synchronous service
337
477
  dr add application service "user-management-api" \
338
- --properties type=synchronous,protocol=REST,openapi-spec=specs/user-api.yaml \
339
478
  --description "User management REST API"
340
479
 
341
480
  # Asynchronous service
342
481
  dr add application service "notification-service" \
343
- --properties type=asynchronous,pattern=publish-subscribe \
344
482
  --description "Asynchronous notification delivery"
345
483
 
346
484
  # Link component to service
347
- dr relationship add "application/component/user-service" \
348
- realizes "application/service/user-management-api"
485
+ dr relationship add application.applicationcomponent.user-service \
486
+ application.applicationservice.user-management-api --predicate realizes
349
487
  ```
350
488
 
351
489
  ### Step 3: Model Application Interfaces
@@ -353,22 +491,22 @@ dr relationship add "application/component/user-service" \
353
491
  ```bash
354
492
  # REST API interface
355
493
  dr add application interface "user-api-rest" \
356
- --properties protocol=REST,base-url=/api/v1/users,authentication=JWT \
357
494
  --description "REST interface for user service"
358
495
 
359
496
  # gRPC interface
360
497
  dr add application interface "order-grpc" \
361
- --properties protocol=gRPC,port=50051 \
362
498
  --description "gRPC interface for order service"
363
499
 
364
500
  # Message queue interface
365
501
  dr add application interface "event-bus" \
366
- --properties protocol=AMQP,broker=rabbitmq \
367
502
  --description "Event bus for async communication"
368
503
 
369
- # Link service to interface
370
- dr relationship add "application/service/user-management-api" \
371
- realizes "application/interface/user-api-rest"
504
+ # Link interface to the service it exposes, and component to interface
505
+ dr relationship add application.applicationinterface.user-api-rest \
506
+ application.applicationservice.user-management-api --predicate assigned-to
507
+
508
+ dr relationship add application.applicationcomponent.user-service \
509
+ application.applicationinterface.user-api-rest --predicate provides
372
510
  ```
373
511
 
374
512
  ### Step 4: Define Application Functions
@@ -376,20 +514,17 @@ dr relationship add "application/service/user-management-api" \
376
514
  ```bash
377
515
  # Core functions
378
516
  dr add application function "authentication" \
379
- --properties type=security \
380
517
  --description "Validates user credentials and issues tokens"
381
518
 
382
519
  dr add application function "data-validation" \
383
- --properties type=business-logic \
384
520
  --description "Validates input data against business rules"
385
521
 
386
522
  dr add application function "caching" \
387
- --properties type=performance,strategy=redis \
388
523
  --description "Caches frequently accessed data"
389
524
 
390
525
  # Assign function to component
391
- dr relationship add "application/component/user-service" \
392
- assigned-to "application/function/authentication"
526
+ dr relationship add application.applicationcomponent.user-service \
527
+ application.applicationfunction.authentication --predicate assigned-to
393
528
  ```
394
529
 
395
530
  ### Step 5: Model Application Events
@@ -397,19 +532,17 @@ dr relationship add "application/component/user-service" \
397
532
  ```bash
398
533
  # Domain events
399
534
  dr add application event "order-created" \
400
- --properties type=domain-event,topic=orders.created,schema=schemas/order-created.json \
401
535
  --description "Published when new order is created"
402
536
 
403
537
  dr add application event "payment-processed" \
404
- --properties type=domain-event,topic=payments.processed,schema=schemas/payment-processed.json \
405
538
  --description "Published when payment completes"
406
539
 
407
- # Event triggering
408
- dr relationship add "application/event/order-created" \
409
- triggers "application/component/inventory-service"
540
+ # Event triggering (processes are defined in Step 7)
541
+ dr relationship add application.applicationevent.order-created \
542
+ application.applicationprocess.order-fulfillment-saga --predicate triggers
410
543
 
411
- dr relationship add "application/event/order-created" \
412
- triggers "application/component/email-worker"
544
+ dr relationship add application.applicationprocess.process-payment \
545
+ application.applicationevent.payment-processed --predicate triggers
413
546
  ```
414
547
 
415
548
  ### Step 6: Define Data Objects
@@ -417,19 +550,17 @@ dr relationship add "application/event/order-created" \
417
550
  ```bash
418
551
  # Core data objects
419
552
  dr add application data-object "user" \
420
- --properties schema-ref=schemas/user.schema.json,pii=true,retention-period=7y \
421
553
  --description "User account information"
422
554
 
423
555
  dr add application data-object "order" \
424
- --properties schema-ref=schemas/order.schema.json,pii=false,retention-period=10y \
425
556
  --description "Customer order data"
426
557
 
427
558
  # Service access to data
428
- dr relationship add "application/service/user-management-api" \
429
- accesses "application/data-object/user"
559
+ dr relationship add application.applicationservice.user-management-api \
560
+ application.dataobject.user --predicate accesses
430
561
 
431
- dr relationship add "application/service/order-api" \
432
- accesses "application/data-object/order"
562
+ dr relationship add application.applicationservice.order-api \
563
+ application.dataobject.order --predicate accesses
433
564
  ```
434
565
 
435
566
  ### Step 7: Model Application Processes (Orchestration)
@@ -437,7 +568,6 @@ dr relationship add "application/service/order-api" \
437
568
  ```bash
438
569
  # Saga workflow
439
570
  dr add application process "order-fulfillment-saga" \
440
- --properties pattern=saga,orchestration-engine=temporal,compensation=true \
441
571
  --description "End-to-end order fulfillment orchestration"
442
572
 
443
573
  # Sub-processes
@@ -450,57 +580,50 @@ dr add application process "process-payment" \
450
580
  dr add application process "ship-order" \
451
581
  --description "Initiate shipping workflow"
452
582
 
453
- # Process composition
454
- dr relationship add "application/process/order-fulfillment-saga" \
455
- composes "application/process/reserve-inventory"
583
+ # Process flows (the catalog has no process-composes-process; model saga steps as a flows-to chain)
584
+ dr relationship add application.applicationprocess.order-fulfillment-saga \
585
+ application.applicationprocess.reserve-inventory --predicate flows-to
456
586
 
457
- dr relationship add "application/process/order-fulfillment-saga" \
458
- composes "application/process/process-payment"
587
+ dr relationship add application.applicationprocess.reserve-inventory \
588
+ application.applicationprocess.process-payment --predicate flows-to
459
589
 
460
- dr relationship add "application/process/order-fulfillment-saga" \
461
- composes "application/process/ship-order"
462
-
463
- # Process flows
464
- dr relationship add "application/process/reserve-inventory" \
465
- flows-to "application/process/process-payment"
466
-
467
- dr relationship add "application/process/process-payment" \
468
- flows-to "application/process/ship-order"
590
+ dr relationship add application.applicationprocess.process-payment \
591
+ application.applicationprocess.ship-order --predicate flows-to
469
592
  ```
470
593
 
471
594
  ### Step 8: Cross-Layer Integration
472
595
 
473
596
  ```bash
474
597
  # Link to business layer
475
- dr relationship add "application/service/order-api" \
476
- realizes "business/service/order-management"
598
+ dr relationship add application.applicationservice.order-api \
599
+ business.businessservice.order-management --predicate realizes
477
600
 
478
601
  # Link to motivation layer
479
- dr relationship add "application/service/user-management-api" \
480
- supports "motivation/goal/improve-user-experience"
602
+ dr relationship add application.applicationservice.user-management-api \
603
+ motivation.goal.improve-user-experience --predicate realizes
481
604
 
482
- # Link to technology layer
483
- dr relationship add "application/component/user-service" \
484
- deployed-on "technology/node/k8s-cluster-prod"
605
+ # Link from technology layer (the node hosting the component serves it)
606
+ dr relationship add technology.node.k8s-cluster-prod \
607
+ application.applicationcomponent.user-service --predicate serves
485
608
 
486
- # Link to API layer
487
- dr relationship add "application/service/user-management-api" \
488
- defined-by "api/openapi-document/user-api"
609
+ # Link from API layer (the OpenAPI document realizes the service contract)
610
+ dr relationship add api.openapidocument.user-api \
611
+ application.applicationservice.user-management-api --predicate realizes
489
612
 
490
- # Link to data model layer
491
- dr relationship add "application/data-object/user" \
492
- defined-by "data-model/schema/user"
613
+ # Link from data model layer (the schema realizes the data object)
614
+ dr relationship add data-model.objectschema.user \
615
+ application.dataobject.user --predicate realizes
493
616
 
494
- # Link to APM layer
495
- dr relationship add "application/service/order-api" \
496
- tracked-by "apm/metric/order-processing-latency"
617
+ # Link from APM layer
618
+ dr relationship add apm.metricinstrument.order-processing-latency \
619
+ application.applicationservice.order-api --predicate monitors
497
620
  ```
498
621
 
499
622
  ### Step 9: Validate
500
623
 
501
624
  ```bash
502
- dr validate --layer application
503
- dr validate --validate-relationships
625
+ dr validate --layers application
626
+ dr validate --relationships
504
627
  ```
505
628
 
506
629
  ---
@@ -513,36 +636,36 @@ dr validate --validate-relationships
513
636
  ApplicationCollaboration: "E-commerce Platform"
514
637
  ├── aggregates → ApplicationComponent: "UserService"
515
638
  │ ├── realizes → ApplicationService: "User API"
516
- │ └── deployed-on → Node: "K8s Cluster"
639
+ │ └── ← serves — technology.node: "K8s Cluster"
517
640
  ├── aggregates → ApplicationComponent: "OrderService"
518
641
  │ ├── realizes → ApplicationService: "Order API"
519
- │ └── deployed-on → Node: "K8s Cluster"
642
+ │ └── ← serves — technology.node: "K8s Cluster"
520
643
  ├── aggregates → ApplicationComponent: "PaymentService"
521
644
  │ └── realizes → ApplicationService: "Payment API"
522
- └── uses → ApplicationInterface: "API Gateway"
645
+ └── provides → ApplicationInterface: "API Gateway"
523
646
  ```
524
647
 
525
648
  ### Pattern 2: Event-Driven Architecture
526
649
 
527
650
  ```
528
651
  ApplicationEvent: "OrderCreated"
529
- ├── triggers → ApplicationComponent: "InventoryService"
530
- ├── triggers → ApplicationComponent: "EmailWorker"
531
- ├── triggers → ApplicationComponent: "AnalyticsService"
532
- └── published-by → ApplicationComponent: "OrderService"
533
- └── uses → ApplicationInterface: "EventBus" (protocol: AMQP)
652
+ ├── triggers → ApplicationProcess: "Reserve Inventory" (assigned to "InventoryService")
653
+ ├── triggers → ApplicationProcess: "Send Confirmation Email" (assigned to "EmailWorker")
654
+ ├── ← depends-on — ApplicationFunction: "Analytics Ingest" (handler in "AnalyticsService")
655
+ └── ← triggers — ApplicationProcess: "Place Order" (assigned to "OrderService")
656
+ └── "OrderService" provides → ApplicationInterface: "EventBus" (protocol: AMQP)
534
657
  ```
535
658
 
536
659
  ### Pattern 3: Saga Orchestration
537
660
 
538
661
  ```
539
662
  ApplicationProcess: "Order Fulfillment Saga"
540
- ├── composes → ApplicationProcess: "Reserve Inventory"
663
+ ├── flows-to → ApplicationProcess: "Reserve Inventory"
541
664
  │ ├── flows-to → ApplicationProcess: "Process Payment"
542
- │ └── compensation → ApplicationProcess: "Release Inventory"
543
- ├── composes → ApplicationProcess: "Process Payment"
665
+ │ └── flows-to (on failure) → ApplicationProcess: "Release Inventory"
666
+ ├── ApplicationProcess: "Process Payment"
544
667
  │ ├── flows-to → ApplicationProcess: "Ship Order"
545
- │ └── compensation → ApplicationProcess: "Refund Payment"
668
+ │ └── flows-to (on failure) → ApplicationProcess: "Refund Payment"
546
669
  └── properties: orchestration-engine=temporal, pattern=saga
547
670
  ```
548
671
 
@@ -551,12 +674,12 @@ ApplicationProcess: "Order Fulfillment Saga"
551
674
  ```
552
675
  ApplicationInterface: "API Gateway"
553
676
  ├── protocol: REST
554
- ├── routes-to → ApplicationService: "User API"
555
- ├── routes-to → ApplicationService: "Order API"
556
- ├── routes-to → ApplicationService: "Payment API"
557
- ├── applies → ApplicationFunction: "Authentication"
558
- ├── applies → ApplicationFunction: "Rate Limiting"
559
- └── applies → ApplicationFunction: "Request Logging"
677
+ ├── assigned-to → ApplicationService: "User API"
678
+ ├── assigned-to → ApplicationService: "Order API"
679
+ ├── assigned-to → ApplicationService: "Payment API"
680
+ ├── depends-on → ApplicationFunction: "Authentication"
681
+ ├── depends-on → ApplicationFunction: "Rate Limiting"
682
+ └── depends-on → ApplicationFunction: "Request Logging"
560
683
  ```
561
684
 
562
685
  ---
@@ -576,6 +699,153 @@ ApplicationInterface: "API Gateway"
576
699
 
577
700
  ---
578
701
 
702
+ ## React / SPA Codebase Detection Patterns
703
+
704
+ These patterns cover the actual structure of React/TypeScript single-page applications. Apply the Type Decision Tree to each pattern.
705
+
706
+ ### Pattern: React Component
707
+
708
+ ```tsx
709
+ // src/core/components/GraphViewer.tsx
710
+ export function GraphViewer({ nodes, edges }: GraphViewerProps) {
711
+ return <ReactFlow nodes={nodes} edges={edges} />;
712
+ }
713
+ ```
714
+
715
+ → `ApplicationComponent` (type: generic)
716
+ → Cross-reference: `technology.systemsoftware.react` serves this component (a `technology.systemsoftware` → `serves` → `ApplicationComponent` relationship)
717
+ → Also add `ux.component.graph-viewer` in the UX layer for rendering detail
718
+
719
+ ### Pattern: Zustand Store
720
+
721
+ ```typescript
722
+ // src/core/stores/modelStore.ts
723
+ export const useModelStore = create<ModelStoreState>((set) => ({
724
+ layers: {}, elements: {},
725
+ loadModel: (data) => set({ ... })
726
+ }));
727
+ ```
728
+
729
+ → `ApplicationFunction` (performs automated state management behavior)
730
+ → NOT `ApplicationComponent` — stores are behavior, not deployable modules
731
+ → Cross-reference: assign to the parent `ApplicationComponent` that owns the store
732
+
733
+ ### Pattern: Stateless Service / Utility (parser, transformer)
734
+
735
+ ```typescript
736
+ // src/core/services/yamlParser.ts
737
+ export function parseYAMLModel(yaml: string): ModelData { ... }
738
+ ```
739
+
740
+ → `ApplicationService` (serviceType: synchronous) if it orchestrates other services
741
+ → OR `ApplicationFunction` if it is a purely stateless computation with no external contract
742
+
743
+ ### Pattern: WebSocket Client
744
+
745
+ ```typescript
746
+ // src/apps/embedded/services/websocketClient.ts
747
+ const ws = new WebSocket("ws://localhost:3000/ws");
748
+ ws.on("model.updated", handler);
749
+ ```
750
+
751
+ → `ApplicationInterface` (protocol: WebSocket) — the ws connection is the interface
752
+ → `ApplicationEvent` for each event type: `model.updated`, `annotation.added`, `changeset.created`
753
+
754
+ ### Pattern: Layout Engine Class (implements interface)
755
+
756
+ ```typescript
757
+ // src/core/layout/engines/DagreLayoutEngine.ts
758
+ export class DagreLayoutEngine implements LayoutEngine {
759
+ async layout(nodes: Node[], edges: Edge[]): Promise<PositionedGraph> { ... }
760
+ }
761
+ ```
762
+
763
+ → `ApplicationComponent` (type: internal) — it IS a deployable, replaceable module
764
+ → NOT `ApplicationFunction` — it has class structure, implements an interface, has state
765
+
766
+ ### Pattern: Layout Utility (pure function)
767
+
768
+ ```typescript
769
+ // src/core/layout/verticalLayerLayout.ts
770
+ export function computeVerticalLayout(layers: Layer[]): LayoutResult { ... }
771
+ ```
772
+
773
+ → `ApplicationFunction` — stateless algorithm, no interface
774
+ → Capture even if standalone (not in an engines/ directory)
775
+
776
+ ### Pattern: Multi-step Loading Pipeline
777
+
778
+ ```typescript
779
+ // src/core/services/dataLoader.ts
780
+ async function loadModel(source: DataSource): Promise<void> {
781
+ const raw = await fetch(source.url);
782
+ const parsed = parseYAMLModel(raw);
783
+ const validated = validateSchema(parsed);
784
+ const transformed = transformToReactFlow(validated);
785
+ modelStore.setModel(transformed);
786
+ }
787
+ ```
788
+
789
+ → `ApplicationProcess` (orchestration pipeline: fetch → parse → validate → transform → store)
790
+
791
+ ### Pattern: Fetch Interceptor
792
+
793
+ ```typescript
794
+ // src/apps/embedded/utils/fetchInterceptor.ts
795
+ export function interceptFetch(token: string) {
796
+ window.fetch = async (url, options = {}) => {
797
+ return originalFetch(url, {
798
+ ...options,
799
+ headers: { ...options.headers, Authorization: `Bearer ${token}` }
800
+ });
801
+ };
802
+ }
803
+ ```
804
+
805
+ → `ApplicationFunction`
806
+ → source-provenance: extracted
807
+ → Relationship: `security.securitypolicy.bearer-token-policy` (governed-by)
808
+
809
+ ### Pattern: Data Transfer Object / Interface
810
+
811
+ ```typescript
812
+ // src/core/types/model.ts
813
+ export interface ModelData {
814
+ layers: Layer[];
815
+ elements: Element[];
816
+ }
817
+ export interface Annotation {
818
+ id: string;
819
+ elementId: string;
820
+ content: string;
821
+ }
822
+ ```
823
+
824
+ → `DataObject` for each significant data structure (`ModelData`, `Annotation`, `Changeset`, etc.)
825
+
826
+ ---
827
+
828
+ ## Coverage Completeness Checklist
829
+
830
+ Before declaring application layer extraction complete, verify ALL 9 entity types have been considered:
831
+
832
+ ```
833
+ □ ApplicationComponent — deployable units, UI components, layout engine classes (NOT Zustand stores — those are ApplicationFunction)
834
+ □ ApplicationService — capabilities with a business contract (data loader, parser service)
835
+ □ ApplicationInterface — access points: WebSocket endpoint, REST interface, postMessage bridge
836
+ □ ApplicationFunction — stateless algorithms: parse, validate, transform, export, layout; Zustand/Redux stores (state management behavior); fetch interceptors
837
+ □ ApplicationProcess — multi-step pipelines: loading pipeline, export pipeline
838
+ □ ApplicationEvent — state change notifications: model.updated, annotation.added, user events
839
+ □ DataObject — key data structures: ModelData, Annotation, Changeset, GraphNode, LayoutPreset
840
+ □ ApplicationCollaboration — component groupings: layout engine suite (groups of deployable ApplicationComponents)
841
+ □ ApplicationInteraction — collective behaviors across multiple components (if applicable)
842
+
843
+ If any type has ZERO elements, explicitly decide:
844
+ "This type doesn't apply to this codebase" with reasoning.
845
+ ```
846
+
847
+ ---
848
+
579
849
  ## Framework-Specific Patterns
580
850
 
581
851
  ### FastAPI / Flask (Python)
@@ -639,32 +909,32 @@ public class ProductController {
639
909
  **Add Commands:**
640
910
 
641
911
  ```bash
642
- dr add application component <name> --properties type=<type>
643
- dr add application service <name> --properties type=<type>,protocol=<protocol>
644
- dr add application interface <name> --properties protocol=<protocol>
645
- dr add application function <name> --properties type=<type>
646
- dr add application event <name> --properties type=<type>,topic=<topic>
647
- dr add application data-object <name> --properties schema-ref=<path>,pii=<bool>
648
- dr add application process <name> --properties pattern=<pattern>
912
+ dr add application component <name>
913
+ dr add application service <name>
914
+ dr add application interface <name>
915
+ dr add application function <name>
916
+ dr add application event <name>
917
+ dr add application data-object <name>
918
+ dr add application process <name>
649
919
  ```
650
920
 
651
921
  **Relationship Commands:**
652
922
 
653
923
  ```bash
654
- dr relationship add <component> realizes <service>
655
- dr relationship add <service> realizes <interface>
656
- dr relationship add <component> assigned-to <function>
657
- dr relationship add <event> triggers <component>
658
- dr relationship add <service> accesses <data-object>
659
- dr relationship add <process> composes <sub-process>
660
- dr relationship add <process-a> flows-to <process-b>
924
+ dr relationship add <component> <service> --predicate realizes
925
+ dr relationship add <interface> <service> --predicate assigned-to
926
+ dr relationship add <component> <interface> --predicate provides
927
+ dr relationship add <component> <function> --predicate assigned-to
928
+ dr relationship add <event> <process> --predicate triggers
929
+ dr relationship add <service> <data-object> --predicate accesses
930
+ dr relationship add <process-a> <process-b> --predicate flows-to
661
931
  ```
662
932
 
663
933
  **Cross-Layer Commands:**
664
934
 
665
935
  ```bash
666
- dr relationship add application/<service> realizes business/<service>
667
- dr relationship add application/<component> deployed-on technology/<node>
668
- dr relationship add application/<service> defined-by api/<openapi-doc>
669
- dr relationship add application/<data-object> defined-by data-model/<schema>
936
+ dr relationship add application.<service> business.<service> --predicate realizes
937
+ dr relationship add technology.<node> application.<component> --predicate serves
938
+ dr relationship add api.<openapi-doc> application.<service> --predicate realizes
939
+ dr relationship add data-model.<object-schema> application.<data-object> --predicate realizes
670
940
  ```