@documentation-robotics/cli 0.1.13 → 0.3.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 (351) hide show
  1. package/README.md +74 -2
  2. package/dist/analysis/relationship-classifier.js +2 -9
  3. package/dist/analysis/relationship-classifier.js.map +2 -2
  4. package/dist/analyzers/call-graph-utils.js +2 -2
  5. package/dist/analyzers/call-graph-utils.js.map +2 -2
  6. package/dist/analyzers/cards/build.js +171 -0
  7. package/dist/analyzers/cards/build.js.map +7 -0
  8. package/dist/analyzers/cards/classify.js +42 -0
  9. package/dist/analyzers/cards/classify.js.map +7 -0
  10. package/dist/analyzers/cards/edge-index.js +44 -0
  11. package/dist/analyzers/cards/edge-index.js.map +7 -0
  12. package/dist/analyzers/cards/facts.js +46 -0
  13. package/dist/analyzers/cards/facts.js.map +7 -0
  14. package/dist/analyzers/cards/graph.js +42 -0
  15. package/dist/analyzers/cards/graph.js.map +7 -0
  16. package/dist/analyzers/cards/index.js +8 -0
  17. package/dist/analyzers/cards/index.js.map +7 -0
  18. package/dist/analyzers/cards/tier0.js +18 -0
  19. package/dist/analyzers/cards/tier0.js.map +7 -0
  20. package/dist/analyzers/cards/types.js +1 -0
  21. package/dist/analyzers/cards/types.js.map +7 -0
  22. package/dist/analyzers/cbm-analyzer.js +195 -171
  23. package/dist/analyzers/cbm-analyzer.js.map +2 -2
  24. package/dist/analyzers/cbm-responses.js +336 -0
  25. package/dist/analyzers/cbm-responses.js.map +7 -0
  26. package/dist/analyzers/edge-relationships.js +45 -0
  27. package/dist/analyzers/edge-relationships.js.map +7 -0
  28. package/dist/analyzers/mapping-loader.js +9 -0
  29. package/dist/analyzers/mapping-loader.js.map +2 -2
  30. package/dist/analyzers/tier0-rules.js +153 -0
  31. package/dist/analyzers/tier0-rules.js.map +7 -0
  32. package/dist/analyzers/types.js.map +1 -1
  33. package/dist/analyzers/verify-engine.js +22 -19
  34. package/dist/analyzers/verify-engine.js.map +2 -2
  35. package/dist/audit/relationships/ai/prompts.js +10 -10
  36. package/dist/audit/relationships/ai/prompts.js.map +2 -2
  37. package/dist/audit/relationships/analysis/layer-templates.js +52 -52
  38. package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
  39. package/dist/cli.js +112 -28
  40. package/dist/cli.js.map +3 -3
  41. package/dist/coding-agents/agents/claude-code.js +3 -1
  42. package/dist/coding-agents/agents/claude-code.js.map +2 -2
  43. package/dist/coding-agents/claude-code-client.js +2 -1
  44. package/dist/coding-agents/claude-code-client.js.map +2 -2
  45. package/dist/coding-agents/copilot-client.js +17 -12
  46. package/dist/coding-agents/copilot-client.js.map +2 -2
  47. package/dist/coding-agents/default-permissions.js +152 -0
  48. package/dist/coding-agents/default-permissions.js.map +7 -0
  49. package/dist/coding-agents/drbot-mcp.js +167 -0
  50. package/dist/coding-agents/drbot-mcp.js.map +7 -0
  51. package/dist/commands/add.js +12 -7
  52. package/dist/commands/add.js.map +2 -2
  53. package/dist/commands/analyzer.js +134 -23
  54. package/dist/commands/analyzer.js.map +2 -2
  55. package/dist/commands/audit.js +6 -6
  56. package/dist/commands/audit.js.map +2 -2
  57. package/dist/commands/changeset-verify.js +55 -0
  58. package/dist/commands/changeset-verify.js.map +7 -0
  59. package/dist/commands/changeset.js +261 -147
  60. package/dist/commands/changeset.js.map +2 -2
  61. package/dist/commands/delete.js +52 -19
  62. package/dist/commands/delete.js.map +3 -3
  63. package/dist/commands/element.js +3 -2
  64. package/dist/commands/element.js.map +2 -2
  65. package/dist/commands/farm.js +773 -0
  66. package/dist/commands/farm.js.map +7 -0
  67. package/dist/commands/init.js +11 -1
  68. package/dist/commands/init.js.map +2 -2
  69. package/dist/commands/mcp.js +122 -0
  70. package/dist/commands/mcp.js.map +7 -0
  71. package/dist/commands/relationship.js +251 -47
  72. package/dist/commands/relationship.js.map +2 -2
  73. package/dist/commands/reports.js +1 -1
  74. package/dist/commands/reports.js.map +2 -2
  75. package/dist/commands/update.js +56 -24
  76. package/dist/commands/update.js.map +2 -2
  77. package/dist/commands/upgrade.js +99 -11
  78. package/dist/commands/upgrade.js.map +3 -3
  79. package/dist/commands/validate.js +41 -3
  80. package/dist/commands/validate.js.map +2 -2
  81. package/dist/commands/version.js +2 -2
  82. package/dist/commands/version.js.map +2 -2
  83. package/dist/commands/visualize.js +4 -3
  84. package/dist/commands/visualize.js.map +2 -2
  85. package/dist/config.js +83 -0
  86. package/dist/config.js.map +7 -0
  87. package/dist/core/annotation-store.js +138 -0
  88. package/dist/core/annotation-store.js.map +7 -0
  89. package/dist/core/catalog-migration.js +33 -0
  90. package/dist/core/catalog-migration.js.map +7 -0
  91. package/dist/core/changeset-analysis.js +421 -0
  92. package/dist/core/changeset-analysis.js.map +7 -0
  93. package/dist/core/changeset-base-index.js +153 -0
  94. package/dist/core/changeset-base-index.js.map +7 -0
  95. package/dist/core/changeset-brief-delta.js +102 -0
  96. package/dist/core/changeset-brief-delta.js.map +7 -0
  97. package/dist/core/changeset-graph.js +281 -0
  98. package/dist/core/changeset-graph.js.map +7 -0
  99. package/dist/core/changeset-only-guard.js +32 -0
  100. package/dist/core/changeset-only-guard.js.map +7 -0
  101. package/dist/core/changeset-summary.js +68 -0
  102. package/dist/core/changeset-summary.js.map +7 -0
  103. package/dist/core/changeset-validator.js +66 -20
  104. package/dist/core/changeset-validator.js.map +2 -2
  105. package/dist/core/changeset-verify.js +518 -0
  106. package/dist/core/changeset-verify.js.map +7 -0
  107. package/dist/core/changeset.js +56 -9
  108. package/dist/core/changeset.js.map +2 -2
  109. package/dist/core/element-type-migration.js +145 -0
  110. package/dist/core/element-type-migration.js.map +7 -0
  111. package/dist/core/farm-manifest.js +140 -0
  112. package/dist/core/farm-manifest.js.map +7 -0
  113. package/dist/core/farm-sync-engine.js +346 -0
  114. package/dist/core/farm-sync-engine.js.map +7 -0
  115. package/dist/core/farm-sync-state.js +167 -0
  116. package/dist/core/farm-sync-state.js.map +7 -0
  117. package/dist/core/manifest.js +6 -3
  118. package/dist/core/manifest.js.map +2 -2
  119. package/dist/core/migration-registry.js +84 -1
  120. package/dist/core/migration-registry.js.map +2 -2
  121. package/dist/core/model-upgrade.js +102 -0
  122. package/dist/core/model-upgrade.js.map +7 -0
  123. package/dist/core/model.js +257 -44
  124. package/dist/core/model.js.map +3 -3
  125. package/dist/core/mutation-handler.js +71 -6
  126. package/dist/core/mutation-handler.js.map +2 -2
  127. package/dist/core/relationship-migration-table.js +6639 -0
  128. package/dist/core/relationship-migration-table.js.map +7 -0
  129. package/dist/core/relationship-migration.js +272 -0
  130. package/dist/core/relationship-migration.js.map +7 -0
  131. package/dist/core/relationship-prune.js +49 -0
  132. package/dist/core/relationship-prune.js.map +7 -0
  133. package/dist/core/relationship-staging.js +68 -0
  134. package/dist/core/relationship-staging.js.map +7 -0
  135. package/dist/core/relationships.js +26 -4
  136. package/dist/core/relationships.js.map +2 -2
  137. package/dist/core/report-data-model.js +7 -13
  138. package/dist/core/report-data-model.js.map +2 -2
  139. package/dist/core/staged-changeset-storage.js +64 -17
  140. package/dist/core/staged-changeset-storage.js.map +2 -2
  141. package/dist/core/staged-source-reference.js +28 -0
  142. package/dist/core/staged-source-reference.js.map +7 -0
  143. package/dist/core/staging-area.js +83 -18
  144. package/dist/core/staging-area.js.map +2 -2
  145. package/dist/core/virtual-projection.js +14 -5
  146. package/dist/core/virtual-projection.js.map +2 -2
  147. package/dist/export/archimate-exporter.js +1 -0
  148. package/dist/export/archimate-exporter.js.map +2 -2
  149. package/dist/generated/compiled-validators.js +2 -2
  150. package/dist/generated/compiled-validators.js.map +2 -2
  151. package/dist/generated/layer-registry.js +16 -16
  152. package/dist/generated/layer-registry.js.map +2 -2
  153. package/dist/generated/node-types.js +186 -168
  154. package/dist/generated/node-types.js.map +2 -2
  155. package/dist/generated/relationship-index.js +2209 -7727
  156. package/dist/generated/relationship-index.js.map +2 -2
  157. package/dist/integrations/claude_code/agents/dr-architect.md +16 -3
  158. package/dist/integrations/claude_code/agents/dr-extractor.md +1 -1
  159. package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
  160. package/dist/integrations/claude_code/commands/dr-map.md +13 -0
  161. package/dist/integrations/claude_code/commands/dr-plan.md +40 -0
  162. package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
  163. package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
  164. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
  165. package/dist/integrations/claude_code/docs/MCP_SERVER.md +79 -0
  166. package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
  167. package/dist/integrations/claude_code/docs/README.md +52 -1
  168. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
  169. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
  170. package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
  171. package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
  172. package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
  173. package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
  174. package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
  175. package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
  176. package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
  177. package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
  178. package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
  179. package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
  180. package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +92 -15
  181. package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +119 -0
  182. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +3 -0
  183. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +1 -1
  184. package/dist/integrations/github_copilot/agents/dr-architect.md +1 -1
  185. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
  186. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
  187. package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
  188. package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
  189. package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
  190. package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
  191. package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
  192. package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
  193. package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
  194. package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
  195. package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
  196. package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
  197. package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +222 -102
  198. package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +119 -0
  199. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
  200. package/dist/integrations/hash-utils.js.map +2 -2
  201. package/dist/mcp/api-key-manager.js +111 -0
  202. package/dist/mcp/api-key-manager.js.map +7 -0
  203. package/dist/mcp/changeset-only.js +34 -0
  204. package/dist/mcp/changeset-only.js.map +7 -0
  205. package/dist/mcp/http-transport.js +176 -0
  206. package/dist/mcp/http-transport.js.map +7 -0
  207. package/dist/mcp/resource-registry.js +97 -0
  208. package/dist/mcp/resource-registry.js.map +7 -0
  209. package/dist/mcp/tool-registry.js +60 -0
  210. package/dist/mcp/tool-registry.js.map +7 -0
  211. package/dist/mcp/tools/annotation-create.js +39 -0
  212. package/dist/mcp/tools/annotation-create.js.map +7 -0
  213. package/dist/mcp/tools/annotation-delete.js +29 -0
  214. package/dist/mcp/tools/annotation-delete.js.map +7 -0
  215. package/dist/mcp/tools/annotation-get.js +29 -0
  216. package/dist/mcp/tools/annotation-get.js.map +7 -0
  217. package/dist/mcp/tools/annotation-list.js +24 -0
  218. package/dist/mcp/tools/annotation-list.js.map +7 -0
  219. package/dist/mcp/tools/annotation-reply.js +34 -0
  220. package/dist/mcp/tools/annotation-reply.js.map +7 -0
  221. package/dist/mcp/tools/annotation-shared.js +10 -0
  222. package/dist/mcp/tools/annotation-shared.js.map +7 -0
  223. package/dist/mcp/tools/annotation-update.js +39 -0
  224. package/dist/mcp/tools/annotation-update.js.map +7 -0
  225. package/dist/mcp/tools/changeset-analysis-tools.js +78 -0
  226. package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
  227. package/dist/mcp/tools/changeset-editing.js +184 -0
  228. package/dist/mcp/tools/changeset-editing.js.map +7 -0
  229. package/dist/mcp/tools/changeset-lifecycle.js +83 -0
  230. package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
  231. package/dist/mcp/tools/changeset-list.js +33 -0
  232. package/dist/mcp/tools/changeset-list.js.map +7 -0
  233. package/dist/mcp/tools/changeset-shared.js +31 -0
  234. package/dist/mcp/tools/changeset-shared.js.map +7 -0
  235. package/dist/mcp/tools/changeset-show.js +55 -0
  236. package/dist/mcp/tools/changeset-show.js.map +7 -0
  237. package/dist/mcp/tools/changeset-verify.js +43 -0
  238. package/dist/mcp/tools/changeset-verify.js.map +7 -0
  239. package/dist/mcp/tools/chat-launch.js +50 -0
  240. package/dist/mcp/tools/chat-launch.js.map +7 -0
  241. package/dist/mcp/tools/chat-status.js +26 -0
  242. package/dist/mcp/tools/chat-status.js.map +7 -0
  243. package/dist/mcp/tools/index.js +65 -0
  244. package/dist/mcp/tools/index.js.map +7 -0
  245. package/dist/mcp/tools/model-add.js +107 -0
  246. package/dist/mcp/tools/model-add.js.map +7 -0
  247. package/dist/mcp/tools/model-delete.js +99 -0
  248. package/dist/mcp/tools/model-delete.js.map +7 -0
  249. package/dist/mcp/tools/model-export.js +72 -0
  250. package/dist/mcp/tools/model-export.js.map +7 -0
  251. package/dist/mcp/tools/model-info.js +51 -0
  252. package/dist/mcp/tools/model-info.js.map +7 -0
  253. package/dist/mcp/tools/model-list.js +53 -0
  254. package/dist/mcp/tools/model-list.js.map +7 -0
  255. package/dist/mcp/tools/model-reload.js +34 -0
  256. package/dist/mcp/tools/model-reload.js.map +7 -0
  257. package/dist/mcp/tools/model-search.js +102 -0
  258. package/dist/mcp/tools/model-search.js.map +7 -0
  259. package/dist/mcp/tools/model-show.js +68 -0
  260. package/dist/mcp/tools/model-show.js.map +7 -0
  261. package/dist/mcp/tools/model-stats.js +22 -0
  262. package/dist/mcp/tools/model-stats.js.map +7 -0
  263. package/dist/mcp/tools/model-trace.js +118 -0
  264. package/dist/mcp/tools/model-trace.js.map +7 -0
  265. package/dist/mcp/tools/model-update.js +121 -0
  266. package/dist/mcp/tools/model-update.js.map +7 -0
  267. package/dist/mcp/tools/model-validate.js +78 -0
  268. package/dist/mcp/tools/model-validate.js.map +7 -0
  269. package/dist/mcp/tools/relationship-tools.js +98 -0
  270. package/dist/mcp/tools/relationship-tools.js.map +7 -0
  271. package/dist/mcp/tools/shared.js +126 -0
  272. package/dist/mcp/tools/shared.js.map +7 -0
  273. package/dist/mcp/tools/spec-type.js +90 -0
  274. package/dist/mcp/tools/spec-type.js.map +7 -0
  275. package/dist/reports/model-layer-report-generator.js +5 -3
  276. package/dist/reports/model-layer-report-generator.js.map +2 -2
  277. package/dist/reports/model-readme-generator.js +116 -0
  278. package/dist/reports/model-readme-generator.js.map +7 -0
  279. package/dist/reports/model-report-data.js +37 -1
  280. package/dist/reports/model-report-data.js.map +2 -2
  281. package/dist/reports/model-report-orchestrator.js +29 -6
  282. package/dist/reports/model-report-orchestrator.js.map +2 -2
  283. package/dist/reports/model-report-utils.js +9 -0
  284. package/dist/reports/model-report-utils.js.map +7 -0
  285. package/dist/schemas/bundled/analyzers/cbm.json +1186 -68
  286. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  287. package/dist/schemas/bundled/api.json +1029 -1658
  288. package/dist/schemas/bundled/apm.json +499 -734
  289. package/dist/schemas/bundled/application.json +745 -370
  290. package/dist/schemas/bundled/base.json +3 -220
  291. package/dist/schemas/bundled/business.json +452 -366
  292. package/dist/schemas/bundled/data-model.json +403 -383
  293. package/dist/schemas/bundled/data-store.json +334 -558
  294. package/dist/schemas/bundled/manifest.json +18 -18
  295. package/dist/schemas/bundled/motivation.json +349 -368
  296. package/dist/schemas/bundled/navigation.json +415 -731
  297. package/dist/schemas/bundled/product.json +325 -159
  298. package/dist/schemas/bundled/security.json +864 -1232
  299. package/dist/schemas/bundled/technology.json +574 -703
  300. package/dist/schemas/bundled/testing.json +718 -1643
  301. package/dist/schemas/bundled/ux.json +739 -1352
  302. package/dist/server/schemas.js +8 -0
  303. package/dist/server/schemas.js.map +2 -2
  304. package/dist/server/server.js +234 -31
  305. package/dist/server/server.js.map +2 -2
  306. package/dist/server-entry.js +2 -1
  307. package/dist/server-entry.js.map +2 -2
  308. package/dist/telemetry/config.js +2 -40
  309. package/dist/telemetry/config.js.map +2 -2
  310. package/dist/telemetry/index.js +1 -1
  311. package/dist/types/index.js.map +2 -2
  312. package/dist/utils/ansi-suppressor.js +23 -0
  313. package/dist/utils/ansi-suppressor.js.map +7 -0
  314. package/dist/utils/attribute-patch.js +41 -0
  315. package/dist/utils/attribute-patch.js.map +7 -0
  316. package/dist/utils/color-utils.js +34 -0
  317. package/dist/utils/color-utils.js.map +7 -0
  318. package/dist/utils/element-reference-shape.js +15 -1
  319. package/dist/utils/element-reference-shape.js.map +3 -3
  320. package/dist/utils/error-hints.js +29 -0
  321. package/dist/utils/error-hints.js.map +7 -0
  322. package/dist/utils/errors.js +75 -10
  323. package/dist/utils/errors.js.map +2 -2
  324. package/dist/utils/globals.js +17 -1
  325. package/dist/utils/globals.js.map +2 -2
  326. package/dist/utils/project-paths.js +50 -3
  327. package/dist/utils/project-paths.js.map +2 -2
  328. package/dist/utils/reference-path-parser.js +49 -0
  329. package/dist/utils/reference-path-parser.js.map +7 -0
  330. package/dist/utils/source-reference.js +17 -10
  331. package/dist/utils/source-reference.js.map +2 -2
  332. package/dist/utils/spec-version.js +10 -2
  333. package/dist/utils/spec-version.js.map +2 -2
  334. package/dist/validators/composed-reference-validator.js +240 -0
  335. package/dist/validators/composed-reference-validator.js.map +7 -0
  336. package/dist/validators/reference-validator.js +57 -13
  337. package/dist/validators/reference-validator.js.map +3 -3
  338. package/dist/validators/relationship-schema-validator.js +33 -5
  339. package/dist/validators/relationship-schema-validator.js.map +3 -3
  340. package/dist/validators/schema-validator.js +27 -9
  341. package/dist/validators/schema-validator.js.map +2 -2
  342. package/dist/validators/types.js.map +1 -1
  343. package/dist/viewer/README.md +6 -6
  344. package/dist/viewer/assets/main-CxzcuU_o.js +84 -0
  345. package/dist/viewer/assets/main-j-7ULYpm.css +1 -0
  346. package/dist/viewer/index.html +2 -2
  347. package/dist/viewer/manifest.json +10 -10
  348. package/dist/viewer/version.json +1 -1
  349. package/package.json +7 -3
  350. package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
  351. package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
@@ -143,20 +143,65 @@ Activate when the user:
143
143
 
144
144
  ---
145
145
 
146
- ## Cross-Layer Relationships
146
+ ## Intra-Layer Relationships
147
+
148
+ A resource aggregates the instrumentation scopes running in it, and a scope aggregates the spans,
149
+ metric instruments and log records emitted under it. Providers (trace, metric, log configurations)
150
+ depend on their resource and aggregate processors and exporters. Each signal flows through its own
151
+ processors to exporters; signals are correlated by `references`. Only signals and instrumentation
152
+ configurations `monitors` elements in other layers; alerts and dashboards monitor signals.
153
+
154
+ | Source Type | Predicate | Target Type | Example |
155
+ | --------------------- | ---------- | -------------------- | ---------------------------------------------------------------- |
156
+ | Span | composes | SpanEvent | "Process Order" composes "Payment Authorized" |
157
+ | Span | aggregates | SpanLink | "Process Order Batch" aggregates "Link To Enqueue Trace" |
158
+ | SpanLink | references | Span | "Link To Enqueue Trace" references "Enqueue Order" |
159
+ | Span | references | Span | "Charge Card" references "Process Order" (parent span) |
160
+ | Resource | aggregates | InstrumentationScope | "order-service Resource" aggregates "orders-tracer" |
161
+ | Span | flows-to | ExporterConfig | "Process Order" flows-to "OTLP Trace Exporter" |
162
+ | InstrumentationScope | aggregates | LogRecord | "orders-logger" aggregates "Payment Error Log" |
163
+ | MetricInstrument | flows-to | ExporterConfig | "order_rate" flows-to "Prometheus Exporter" |
164
+ | LogRecord | references | Span | "Payment Error Log" references "Charge Card" |
165
+ | LogRecord | flows-to | LogProcessor | "Payment Error Log" flows-to "PII Redaction Processor" |
166
+ | LogProcessor | flows-to | ExporterConfig | "PII Redaction Processor" flows-to "OTLP Log Exporter" |
167
+ | InstrumentationScope | aggregates | Span | "orders-tracer" aggregates "Process Order" |
168
+ | InstrumentationScope | aggregates | MetricInstrument | "orders-meter" aggregates "order_rate" |
169
+ | InstrumentationConfig | references | InstrumentationScope | "Node Auto-Instrumentation" references "express instrumentation" |
170
+ | TraceConfiguration | depends-on | Resource | "Order Service Tracing" depends-on "order-service Resource" |
171
+ | MetricConfiguration | aggregates | MetricInstrument | "Order Service Metrics" aggregates "order_rate" |
172
+ | LogConfiguration | aggregates | LogProcessor | "Order Service Logging" aggregates "PII Redaction Processor" |
173
+ | Alert | monitors | MetricInstrument | "High Order Error Rate" monitors "order_errors_total" |
174
+ | Dashboard | monitors | MetricInstrument | "Order Operations Dashboard" monitors "order_rate" |
175
+ | Dashboard | references | Alert | "Order Operations Dashboard" references "High Order Error Rate" |
147
176
 
148
- **Outgoing (APM → Other Layers):**
149
-
150
- - `instrumented-service` → Application Layer (which service is being monitored?)
151
- - `business-metrics` → Business Layer (business KPIs)
152
-
153
- **Incoming (Other Layers → APM):**
177
+ ---
154
178
 
155
- - Application Layer → APM (services reference metrics)
156
- - API Layer → APM (operations set SLA targets)
157
- - Business Layer → APM (processes reference business metrics)
158
- - Data Model Layer → APM (metric instruments tracking data quality KPIs)
159
- - Data Store Layer → APM (query performance metrics)
179
+ ## Cross-Layer References
180
+
181
+ ### Outgoing References (APM → Other Layers)
182
+
183
+ | Source Type | Predicate | Target Type | Example |
184
+ | --------------------- | ---------------- | ---------------------------------- | -------------------------------------------------------------- |
185
+ | Span | monitors | `application.applicationservice` | "Process Order" monitors "Order Service" |
186
+ | Span | monitors | `api.operation` | "POST /orders" span monitors "Create Order" |
187
+ | Span | monitors | `navigation.route` | "Route Change" monitors "Checkout Route" |
188
+ | Span | monitors | `data-store.collection` | "Insert Order" monitors "orders table" |
189
+ | MetricInstrument | monitors | `api.operation` | "http_server_duration" monitors "Create Order" |
190
+ | MetricInstrument | monitors | `business.businessprocess` | "order_rate" monitors "Order Fulfillment" |
191
+ | MetricInstrument | monitors | `data-store.database` | "db_pool_connections" monitors "Orders Database" |
192
+ | MetricInstrument | measures-outcome | `motivation.outcome` | "order_rate" measures "Higher Order Throughput" |
193
+ | MetricInstrument | satisfies | `motivation.requirement` | "http_server_duration" satisfies "p95 Latency Under 300ms" |
194
+ | Resource | maps-to | `application.applicationcomponent` | "order-service Resource" maps-to "Order Service Component" |
195
+ | Resource | references | `technology.node` | "order-service Resource" references "EKS Production Cluster" |
196
+ | InstrumentationConfig | monitors | `application.applicationcomponent` | "Node Auto-Instrumentation" monitors "Order Service Component" |
197
+ | LogConfiguration | satisfies | `security.auditconfig` | "Order Service Logging" satisfies "Order Audit Logging" |
198
+
199
+ ### Incoming References (Other Layers → APM)
200
+
201
+ | Source Type | Predicate | Target Type | Example |
202
+ | -------------------------------- | ---------- | ------------------ | -------------------------------------------------- |
203
+ | `application.applicationservice` | references | TraceConfiguration | "Order Service" references "Order Service Tracing" |
204
+ | `testing.testcasesketch` | tests | MetricInstrument | "Order Counter Increments" tests "order_rate" |
160
205
 
161
206
  ---
162
207
 
@@ -139,22 +139,85 @@ Activate when the user:
139
139
 
140
140
  ---
141
141
 
142
- ## Cross-Layer Relationships
142
+ ## Intra-Layer Relationships
143
+
144
+ Each testing type has one composing parent. The model composes targets, partitions, context
145
+ variations, environment factors, exclusions and the summary; a target composes its input fields,
146
+ outcome categories, coverage requirements and test case sketches. A sketch `validates` the one
147
+ requirement it exercises and `references` its context variation and outcome category. Only target
148
+ input fields reference the field under test, so partitions stay reusable. Summaries report with
149
+ `references` and `aggregates`; they never `validates`.
150
+
151
+ | Source Type | Predicate | Target Type | Example |
152
+ | ----------------------- | ---------- | ----------------------- | ------------------------------------------------------------------------- |
153
+ | TestCoverageModel | composes | TestCoverageTarget | "Login API Coverage Model" composes "Login Endpoint Coverage" |
154
+ | TestCoverageModel | composes | ContextVariation | "Login API Coverage Model" composes "Security Testing" |
155
+ | TestCoverageModel | composes | EnvironmentFactor | "Login API Coverage Model" composes "Rate Limiter Enabled" |
156
+ | TestCoverageModel | composes | InputSpacePartition | "Login API Coverage Model" composes "Email Format Partition" |
157
+ | TestCoverageModel | composes | CoverageExclusion | "Login API Coverage Model" composes "SSO Login Out Of Scope" |
158
+ | TestCoverageModel | composes | CoverageSummary | "Login API Coverage Model" composes "Login Coverage Summary" |
159
+ | TestCoverageTarget | composes | TargetInputField | "Login Endpoint Coverage" composes "email field" |
160
+ | TestCoverageTarget | composes | OutcomeCategory | "Login Endpoint Coverage" composes "Invalid Credentials (401)" |
161
+ | TestCoverageTarget | composes | CoverageRequirement | "Login Endpoint Coverage" composes "Pairwise Credentials" |
162
+ | TestCoverageTarget | composes | TestCaseSketch | "Login Endpoint Coverage" composes "Valid Login Test Case" |
163
+ | TargetInputField | references | InputSpacePartition | "email field" references "Email Format Partition" |
164
+ | InputSpacePartition | composes | PartitionValue | "Email Format Partition" composes "Malformed Email" |
165
+ | PartitionDependency | references | PartitionValue | "Locked Account Requires Valid Email" references "Locked Account" |
166
+ | PartitionDependency | references | InputSpacePartition | "Locked Account Requires Valid Email" references "Email Format Partition" |
167
+ | CoverageRequirement | composes | InputPartitionSelection | "Pairwise Credentials" composes "Email x Password Selection" |
168
+ | CoverageRequirement | references | OutcomeCategory | "Pairwise Credentials" references "Invalid Credentials (401)" |
169
+ | CoverageRequirement | references | ContextVariation | "Pairwise Credentials" references "Security Testing" |
170
+ | InputPartitionSelection | references | PartitionValue | "Email x Password Selection" references "Malformed Email" |
171
+ | TestCaseSketch | validates | CoverageRequirement | "Valid Login Test Case" validates "Pairwise Credentials" |
172
+ | TestCaseSketch | composes | InputSelection | "Valid Login Test Case" composes "Valid Email + Valid Password" |
173
+ | InputSelection | references | PartitionValue | "Valid Email + Valid Password" references "Well-Formed Email" |
174
+ | TestCaseSketch | references | OutcomeCategory | "Valid Login Test Case" references "Success (200 + JWT)" |
175
+ | TestCaseSketch | references | ContextVariation | "Brute Force Lockout Test" references "Security Testing" |
176
+ | ContextVariation | references | EnvironmentFactor | "Security Testing" references "Rate Limiter Enabled" |
177
+ | CoverageGap | references | CoverageRequirement | "No MFA Cases" references "Pairwise Credentials" |
178
+ | CoverageExclusion | references | TestCoverageTarget | "SSO Login Out Of Scope" references "Login Endpoint Coverage" |
179
+ | CoverageExclusion | references | CoverageGap | "SSO Login Out Of Scope" references "No SSO Cases" |
180
+ | TargetCoverageSummary | references | TestCoverageTarget | "Login Endpoint Rollup" references "Login Endpoint Coverage" |
181
+ | TargetCoverageSummary | references | CoverageGap | "Login Endpoint Rollup" references "No MFA Cases" |
182
+ | CoverageSummary | aggregates | TargetCoverageSummary | "Login Coverage Summary" aggregates "Login Endpoint Rollup" |
143
183
 
144
- **Outgoing (Testing → Other Layers):**
145
-
146
- - `motivation.supports-goals` → Motivation Layer (quality goals)
147
- - `motivation.fulfills-requirements` → Motivation Layer (test requirements)
148
- - `business.covers-process` → Business Layer (process coverage)
149
- - `api.tests-operation` → API Layer (API endpoint testing)
150
- - `data.validates-schema` → Data Model Layer (data validation)
151
- - `ux.tests-view` → UX Layer (UI testing)
152
-
153
- **Incoming (Other Layers → Testing):**
184
+ ---
154
185
 
155
- - Motivation Layer → Testing (requirements drive coverage)
156
- - API Layer → Testing (operations need test coverage)
157
- - Business Layer → Testing (processes need testing)
186
+ ## Cross-Layer References
187
+
188
+ ### Outgoing References (Testing → Other Layers)
189
+
190
+ A target `covers` the production artifact it names; a sketch `tests` what it exercises. The model
191
+ covers only the application component, UX application or API document it is for. Requirements and
192
+ summaries reach no other layer. Only the model and test case sketches link to motivation.
193
+
194
+ | Source Type | Predicate | Target Type | Example |
195
+ | ------------------ | ---------------- | ---------------------------------- | --------------------------------------------------------------------- |
196
+ | TestCoverageModel | covers | `application.applicationcomponent` | "Login API Coverage Model" covers "Auth Service" |
197
+ | TestCoverageModel | covers | `api.openapidocument` | "Login API Coverage Model" covers "Auth API" |
198
+ | TestCoverageModel | supports | `motivation.goal` | "Login API Coverage Model" supports "Secure Customer Access" |
199
+ | TestCoverageModel | satisfies | `motivation.requirement` | "Login API Coverage Model" satisfies "Auth Must Be Regression Tested" |
200
+ | TestCoverageModel | measures-outcome | `motivation.outcome` | "Login API Coverage Model" measures-outcome "Fewer Auth Incidents" |
201
+ | TestCoverageTarget | covers | `api.operation` | "Login Endpoint Coverage" covers "POST /auth/login" |
202
+ | TestCoverageTarget | covers | `product.feature` | "Password Reset Coverage" covers "Self-Service Password Reset" |
203
+ | TestCoverageTarget | covers | `ux.view` | "Login Screen Coverage" covers "Login View" |
204
+ | TestCoverageTarget | covers | `data-store.storedlogic` | "Order Total Trigger Coverage" covers "recalc_order_total" |
205
+ | TestCaseSketch | tests | `api.operation` | "Valid Login Test Case" tests "POST /auth/login" |
206
+ | TestCaseSketch | tests | `api.response` | "Invalid Password Test" tests "401 Unauthorized" |
207
+ | TestCaseSketch | tests | `business.businessprocess` | "Complete Checkout E2E" tests "Order Checkout" |
208
+ | TestCaseSketch | tests | `ux.view` | "Login Form Renders Errors" tests "Login View" |
209
+ | TestCaseSketch | tests | `navigation.route` | "Deep Link To Profile" tests "User Profile Route" |
210
+ | TestCaseSketch | tests | `security.threat` | "Brute Force Lockout Test" tests "Credential Stuffing" |
211
+ | TestCaseSketch | tests | `data-model.schemadefinition` | "Reject Unknown Order Fields" tests "Order Schema" |
212
+ | TestCaseSketch | satisfies | `motivation.requirement` | "Brute Force Lockout Test" satisfies "Lock After 5 Failures" |
213
+ | TestCaseSketch | accesses | `data-store.collection` | "Order History Test" accesses `orders` |
214
+ | TargetInputField | references | `api.parameter` | "email field" references "email parameter" |
215
+ | TargetInputField | references | `data-model.schemaproperty` | "email field" references "User.email" |
216
+ | EnvironmentFactor | references | `technology.systemsoftware` | "PostgreSQL 16" references "PostgreSQL" |
217
+
218
+ ### Incoming References (Other Layers → Testing)
219
+
220
+ None. Testing is a leaf layer: other layers do not hold relationships pointing into it. Record traceability from the testing side (e.g. `TestCaseSketch tests api.operation`).
158
221
 
159
222
  ---
160
223
 
@@ -202,10 +265,13 @@ name: "Login API Coverage Model"
202
265
  type: testcoveragemodel
203
266
  properties:
204
267
  version: "1.0"
205
- application: application.service.auth-service
206
268
  description: "ISP coverage model for the Login API"
207
269
  ```
208
270
 
271
+ ```bash
272
+ dr relationship add testing.testcoveragemodel.login-api application.applicationcomponent.auth-service --predicate covers
273
+ ```
274
+
209
275
  ---
210
276
 
211
277
  ## Example: Login Test Coverage Target
@@ -220,6 +286,11 @@ properties:
220
286
  priority: critical
221
287
  ```
222
288
 
289
+ ```bash
290
+ dr relationship add testing.testcoveragemodel.login-api testing.testcoveragetarget.login-endpoint --predicate composes
291
+ dr relationship add testing.testcoveragetarget.login-endpoint api.operation.login --predicate covers
292
+ ```
293
+
223
294
  ---
224
295
 
225
296
  ## Example: Test Case Sketch
@@ -234,6 +305,12 @@ properties:
234
305
  implementationFormat: automated
235
306
  ```
236
307
 
308
+ ```bash
309
+ dr relationship add testing.testcoveragetarget.login-endpoint testing.testcasesketch.valid-login --predicate composes
310
+ dr relationship add testing.testcasesketch.valid-login testing.coveragerequirement.pairwise-credentials --predicate validates
311
+ dr relationship add testing.testcasesketch.valid-login api.operation.login --predicate tests
312
+ ```
313
+
237
314
  ---
238
315
 
239
316
  ## Coverage Completeness Checklist
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: dr_change_planning
3
+ description: Plan a code change as a staged DR changeset through the dr MCP server, pressure-test it against the model, build from its brief, and verify the build against it. Use when asked to plan, design or scope a change in a project with a DR model.
4
+ triggers:
5
+ [
6
+ "plan this change",
7
+ "plan the change",
8
+ "plan a change",
9
+ "plan this feature",
10
+ "how should we build",
11
+ "scope this change",
12
+ "design this change",
13
+ "draft a changeset",
14
+ "changeset brief"
15
+ ]
16
+ ---
17
+
18
+ # Plan a change as a DR changeset
19
+
20
+ In a project with a DR model (`documentation-robotics/model/`), a plan is a staged changeset, not a
21
+ prose document. The changeset says what the change will build. The model says what is built. The
22
+ graph checks the plan for you. The full design is `docs/CHANGE_MODELING.md` in the DR repository.
23
+
24
+ ## Before you start
25
+
26
+ - You need the `dr` MCP server. Its tools show up as `mcp__dr__<tool>` (the prefix is whatever name
27
+ the server has in `.mcp.json`). If they are missing, tell the user to register `dr mcp` (see
28
+ `integrations/claude_code/docs/MCP_SERVER.md`) and stop. Don't fall back to prose.
29
+ - Staging writes files under `documentation-robotics/changesets/`. If the session is in plan mode,
30
+ say that the plan will be a changeset and leave plan mode before staging.
31
+ - You never commit, apply or discard the plan. Those are the human's steps, and commit and apply are
32
+ not MCP tools.
33
+
34
+ ## The loop
35
+
36
+ 1. **Frame.** `changeset_list` first: if a changeset for this change exists, `changeset_activate` it
37
+ and continue. Otherwise `changeset_create` with a short kebab-case `name` and a `description`
38
+ that states the intent: what the change is for and what done looks like. Find the goal,
39
+ requirement or feature it serves (`model_search` in motivation, business, product). If there is
40
+ none, stage one, or ask the human what the change is for.
41
+ 2. **Orient.** `model_search` / `model_show` / `model_trace` for the elements the change touches.
42
+ Inside a changeset these read the plan as it stands (each result carries a change status).
43
+ `spec_type` for a type you will add: its required attributes, enums, and the relationships the
44
+ catalog allows to and from it. Within reason, every connection the spec models for a type is
45
+ expected, though not every one will exist: treat the catalog's list as the checklist for each
46
+ element the change adds or alters.
47
+ 3. **Draft.** Stage the change in every layer it reaches: `model_add`, `model_update`,
48
+ `model_delete`, `relationship_add`, `relationship_delete`. Relationships may join elements that
49
+ exist only in the changeset. Pass `sourceFile`, `sourceProvenance` (`manual` for a planned location) and `sourceSymbol` when you know where the code goes.
50
+ Change one attribute with `model_update` `attributePatch`, not by repeating every attribute. Fix a
51
+ mistake with `changeset_unstage` (one element, one relationship, or `source` or `target` alone for
52
+ every staged connection at that end), not by staging the reverse.
53
+ 4. **Pressure-test.** `changeset_brief`, then `changeset_impact` for anything the brief questions.
54
+ Steps 3 and 4 are a loop: a plan comes into focus over many passes. Each pass, stage a little,
55
+ then:
56
+ - Pass the last brief's `revisionToken` as `since`; read the `delta` first. It covers unstages
57
+ too (`unstaged`). If it warns (a hand-edited `changes.yaml`, or a reach back past the last 200
58
+ unstages), read the brief itself.
59
+ - Work through `unwired` for each element you added or changed. Where `existingCount` is above
60
+ 0, link an existing element; otherwise decide whether the change needs a new one. Use
61
+ `unwiredLayers` to see one layer in full, and `unwired: "none"` when you only need the gaps.
62
+ - Walk `changeset_impact` with `from` set to what you just added, not the whole changeset.
63
+ - Read the plan with `changeset_show` `detail: "summary"`, not the full snapshots.
64
+
65
+ Read the brief's gaps:
66
+ - `peer-pattern`: most elements like this one have a connection it lacks.
67
+ - `unconnected`: an added element with no relationships.
68
+ - Intent: a change that reaches no motivation, business or product element.
69
+ - Layers not reached: a new API operation with nothing in data model, testing or APM is a small
70
+ change or an unfinished plan. Decide which.
71
+ - Connections the brief can't flag: for each changed element, compare what `spec_type` says its
72
+ type can connect to with what the plan has. Stage the ones the change needs; leave the ones it
73
+ doesn't, but don't skip the comparison.
74
+
75
+ For each gap, either stage what is missing or accept it. Record an accepted gap where the human
76
+ will see it: an `annotation_create` on the element, or a line in the description
77
+ (`changeset_update`). `model_validate` should pass on the projected model.
78
+
79
+ 5. **Review.** Stop and show the human the brief: changes by layer, gaps fixed and gaps accepted,
80
+ impact, code touched. Ask them to look at it in `dr visualize` and comment on elements there.
81
+ Read their comments with `annotation_list`, answer with `annotation_reply`, revise, and run the
82
+ brief again. Don't start building until they agree.
83
+ 6. **Build.** Build from the brief. Its "code touched" list is what you will edit or must not
84
+ break. Keep the changeset staged and commit only the plan's own directory
85
+ (`documentation-robotics/changesets/<id>/`, with the id `changeset_show` reports) on the branch
86
+ with the code. Don't add the whole `changesets/` directory: the `.active` marker and any
87
+ `<name>-as-built` changeset stay out of the commit. If the build has to differ from the plan,
88
+ change the plan to match and say why.
89
+ 7. **Verify.** Write down what was built, separately from the plan: `changeset_create`
90
+ `<name>-as-built`, stage what the diff actually contains (read the code, not the plan), then
91
+ `changeset_verify` with `planned: <name>` and `against: {"changesetId": "<name>-as-built"}`.
92
+ Fix each missing, unplanned or divergent item in the code or in the plan. Look for missing
93
+ connections in the as-built too: for each element, compare what the spec models for its type
94
+ with what was staged, and look for evidence of each absent one in the code (and the analyzer's
95
+ graph, `dr analyzer callers` / `callees`, when it is indexed). Confirm or reject
96
+ every `probable` match. `changeset_activate` the plan again afterwards. Tell the human the
97
+ as-built changeset can be discarded; discard it (`changeset_discard`, `confirm: true`) only when
98
+ they agree. Until then it stays out of git: when you commit fixes, add only the plan's
99
+ directory again. If the as-built changes are committed to the model instead of kept as a changeset,
100
+ `against: {"base": true}` compares the plan with the model.
101
+ 8. **Land.** Hand over: the PR carries the code and the staged changeset. The human commits it,
102
+ in the viewer or with `dr changeset commit`.
103
+
104
+ ## Tolerance
105
+
106
+ Tools report odd input and carry on instead of failing. Read the report each time:
107
+
108
+ - `relationship_add` reports a duplicate, or restores a relationship the plan had deleted.
109
+ - `changeset_unstage` reports `not-staged` when there was nothing to drop.
110
+ - In a changeset-only session (DrBot with `--with-changesets`), a write with no active changeset is
111
+ refused. Call `changeset_create` or `changeset_activate` and retry.
112
+ - DrBot cannot write annotations (`annotation_create` and `annotation_reply` are not among its
113
+ tools). There, record accepted gaps in the description with `changeset_update` and answer the
114
+ human's comments in the chat.
115
+
116
+ ## Keep it short
117
+
118
+ Model at the grain of the change. One function, one operation and one test sketch beat a
119
+ speculative tree. Add detail as the build firms up.
@@ -134,6 +134,9 @@ For each addition, check:
134
134
  - [ ] Layer-appropriate properties used
135
135
  - [ ] References point to existing elements
136
136
  - [ ] Status is valid for the element type
137
+ - [ ] Connections the spec models for its type (`dr schema relationship <layer>.<type>`) are present
138
+ where the change needs them; within reason every modeled connection is expected, though not
139
+ every one will exist
137
140
 
138
141
  For each modification, check:
139
142
 
@@ -57,7 +57,7 @@ Map the proposed change to the 13-layer model:
57
57
 
58
58
  **2. Layer Hierarchy Check**
59
59
 
60
- - Does the proposal respect the "higher layers reference lower layers" rule?
60
+ - Do the proposed relationships use predicates whose direction matches their meaning (an application function `realizes` an API operation; a service `serves` a process), and do implementation elements trace to a motivation element through `realizes`, `satisfies` or `supports`?
61
61
  - Example red flag: "A data-store change that has no corresponding data-model change"
62
62
  - Example red flag: "An API endpoint that doesn't map to any application service"
63
63
 
@@ -105,7 +105,7 @@ x-supports-goals: [motivation.goal.revenue]
105
105
 
106
106
  ```yaml
107
107
  motivation:
108
- supports-goals: [motivation.goal.revenue]
108
+ supports: [motivation.goal.revenue]
109
109
  business:
110
110
  realizes-services: [business.service.orders]
111
111
  ```