@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
@@ -13,13 +13,13 @@ triggers:
13
13
  "OpenTelemetry",
14
14
  "telemetry"
15
15
  ]
16
- version: 0.8.1
16
+ version: 0.8.3
17
17
  ---
18
18
 
19
19
  # APM Layer Skill
20
20
 
21
21
  **Layer Number:** 11
22
- **Specification:** Metadata Model Spec v0.8.1
22
+ **Specification:** Metadata Model Spec v0.8.3
23
23
  **Purpose:** Defines observability using OpenTelemetry 1.0+, specifying traces, metrics, logs, and instrumentation.
24
24
 
25
25
  ---
@@ -33,7 +33,7 @@ The APM Layer captures **application performance monitoring**:
33
33
  - **LOGS** - Structured logging
34
34
  - **INSTRUMENTATION** - Code instrumentation configuration
35
35
  - **RESOURCES** - Telemetry resource attributes
36
- - **SLOs/SLAs** - Service level objectives and agreements
36
+ - **ALERTING** - Alert rules and monitoring dashboards
37
37
 
38
38
  This layer uses **OpenTelemetry 1.0+** (industry standard for observability).
39
39
 
@@ -41,29 +41,93 @@ This layer uses **OpenTelemetry 1.0+** (industry standard for observability).
41
41
 
42
42
  ---
43
43
 
44
+ ## Pre-Extraction Verification
45
+
46
+ Before extracting APM elements, verify what level of observability the codebase ACTUALLY implements. Do not model aspirational instrumentation.
47
+
48
+ ### Step 1: Check for OTel SDK
49
+
50
+ ```bash
51
+ grep "@opentelemetry" package.json
52
+ ```
53
+
54
+ **If NO OTel SDK found:**
55
+
56
+ - Do NOT add `MetricInstrument`, `Span`, `TraceConfiguration`, or `ExporterConfig` elements as if they are implemented
57
+ - ONLY model what exists: browser console logging (`LogConfiguration`), UI-displayed metrics (describe in element description that export is absent)
58
+ - Mark all elements `provenance: inferred` and add a note in the description: "Metric concept identified; no OTel export implemented."
59
+
60
+ **If OTel SDK IS found:**
61
+
62
+ - Proceed with full extraction of all APM types
63
+
64
+ ### Step 2: Identify what observability actually exists
65
+
66
+ Even without OTel, codebases may have:
67
+
68
+ - Browser console error logging → `apm.logconfiguration`
69
+ - UI-visible token/usage counters → `apm.metricinstrument` (with note: display-only, not exported)
70
+ - Error tracking utilities → `apm.instrumentationconfig` (type: manual)
71
+ - In-memory state tracking → `apm.metricinstrument` (inferred, note: in-memory only)
72
+
73
+ ### In-UI Observability vs. OTel Instrumentation
74
+
75
+ | Pattern | Model as | provenance |
76
+ | ------------------------------- | ----------------------------------------- | ---------- |
77
+ | `console.error()` logging | `logconfiguration` | extracted |
78
+ | UI badge showing token count | `metricinstrument` (note: display-only) | inferred |
79
+ | Store tracks reconnection count | `metricinstrument` (note: in-memory only) | inferred |
80
+ | `opentelemetry.createCounter()` | `metricinstrument` | extracted |
81
+ | Prometheus export endpoint | `exporterconfig` | extracted |
82
+
83
+ ---
84
+
44
85
  ## Entity Types
45
86
 
46
87
  > **CLI Introspection:** Run `dr schema types apm` for the authoritative, always-current list of node types.
47
88
  > Run `dr schema node <type-id>` for full attribute details on any type.
48
89
 
49
- ### Core APM Entities (14 entities)
50
-
51
- | Entity Type | Description |
52
- | ------------------------ | --------------------------------------------- |
53
- | **APMConfiguration** | Root configuration for observability |
54
- | **TraceConfiguration** | Distributed tracing configuration |
55
- | **Span** | Unit of work in distributed trace |
56
- | **SpanEvent** | Timestamped event within span |
57
- | **MetricConfiguration** | Metrics collection configuration |
58
- | **MeterConfig** | Meter for metric instruments |
59
- | **InstrumentConfig** | Metric instrument (counter, gauge, histogram) |
60
- | **LogConfiguration** | Structured logging configuration |
61
- | **LogRecord** | Individual log record |
62
- | **Resource** | Telemetry resource attributes |
63
- | **Attribute** | Key-value telemetry attribute |
64
- | **InstrumentationScope** | Scope of instrumentation |
65
- | **DataQualityMetric** | Data quality metrics |
66
- | **DataQualityMetrics** | Collection of data quality metrics |
90
+ ### Core APM Entities (15 entities)
91
+
92
+ | Entity Type | Description |
93
+ | ------------------------- | ----------------------------------------------------------------- |
94
+ | **TraceConfiguration** | Distributed tracing configuration |
95
+ | **Span** | Unit of work in distributed trace |
96
+ | **SpanEvent** | Timestamped event within span |
97
+ | **SpanLink** | Link between spans from different traces |
98
+ | **MetricConfiguration** | Metrics collection configuration |
99
+ | **MetricInstrument** | Specific metric instrument (Counter, Gauge, Histogram, etc.) |
100
+ | **LogConfiguration** | Structured logging configuration |
101
+ | **LogRecord** | Individual log record |
102
+ | **LogProcessor** | Log processing pipeline step (simple, batch, custom) |
103
+ | **Resource** | Telemetry resource attributes |
104
+ | **InstrumentationScope** | Scope of instrumentation |
105
+ | **InstrumentationConfig** | Code instrumentation configuration (library, auto/manual type) |
106
+ | **ExporterConfig** | Telemetry exporter configuration (OTLP, Jaeger, Prometheus, etc.) |
107
+ | **Alert** | Alert rule with severity, condition, and notification channels |
108
+ | **Dashboard** | Monitoring dashboard definition (Grafana, Datadog, etc.) |
109
+
110
+ ---
111
+
112
+ ## Type Decision Tree
113
+
114
+ Use this decision tree **before assigning a type** to any APM element.
115
+
116
+ - Is this an alert rule with severity and condition? → `apm.alert`
117
+ - Is this a monitoring dashboard definition (Grafana, Datadog, etc.)? → `apm.dashboard`
118
+ - Is this an exporter configuration (OTLP, Jaeger, Prometheus endpoint)? → `apm.exporterconfig`
119
+ - Is this a code instrumentation configuration (library name, auto/manual)? → `apm.instrumentationconfig`
120
+ - Is this the instrumentation scope (library version, schema URL)? → `apm.instrumentationscope`
121
+ - Is this logging pipeline configuration (service name, minimum severity)? → `apm.logconfiguration`
122
+ - Is this a log processor step (batch, simple, custom)? → `apm.logprocessor`
123
+ - Is this an individual structured log record with body and severity? → `apm.logrecord`
124
+ - Is this a metrics collection configuration (export interval, cardinality limit)? → `apm.metricconfiguration`
125
+ - Is this a specific metric instrument (counter, gauge, histogram, observable)? → `apm.metricinstrument`
126
+ - Is this a telemetry resource (service name, deployment environment attributes)? → `apm.resource`
127
+ - Is this a unit of work/operation in a distributed trace? → `apm.span`
128
+ - Is this an event that occurred within a span? → `apm.spanevent`
129
+ - Is this a link between spans from different traces? → `apm.spanlink`
130
+ - Is this distributed tracing configuration (sampler type, propagators)? → `apm.traceconfiguration`
67
131
 
68
132
  ---
69
133
 
@@ -79,20 +143,65 @@ Activate when the user:
79
143
 
80
144
  ---
81
145
 
82
- ## Cross-Layer Relationships
83
-
84
- **Outgoing (APM → Other Layers):**
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" |
85
176
 
86
- - `instrumented-service` → Application Layer (which service is being monitored?)
87
- - `business-metrics` → Business Layer (business KPIs)
88
-
89
- **Incoming (Other Layers → APM):**
177
+ ---
90
178
 
91
- - Application Layer → APM (services reference metrics)
92
- - API Layer → APM (operations set SLA targets)
93
- - Business Layer → APM (processes reference business metrics)
94
- - Data Model Layer → APM (data quality metrics)
95
- - 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" |
96
205
 
97
206
  ---
98
207
 
@@ -113,22 +222,22 @@ Activate when the user:
113
222
 
114
223
  ```bash
115
224
  # Add span
116
- dr add apm span --name "Process Order"
225
+ dr add apm span "Process Order"
117
226
 
118
- # Add metric
119
- dr add apm instrument-config --name "order_rate" --property type=counter
227
+ # Add metric instrument
228
+ dr add apm metricinstrument "order_rate" --description "Order processing rate counter"
120
229
 
121
230
  # Add log record
122
- dr add apm log-record --name "Error Log"
231
+ dr add apm logrecord "Error Log"
123
232
 
124
233
  # List APM elements
125
- dr list apm span
234
+ dr list apm --type span
126
235
 
127
236
  # Validate APM layer
128
- dr validate --layer apm
237
+ dr validate --layers apm
129
238
 
130
239
  # Export APM configuration
131
- dr export --layer apm --format json
240
+ dr export markdown --layers apm
132
241
  ```
133
242
 
134
243
  ---
@@ -140,28 +249,21 @@ id: apm.span.process-order
140
249
  name: "Process Order Span"
141
250
  type: span
142
251
  properties:
252
+ traceId: "4bf92f3577b34da6a3ce929d0e0e4736"
253
+ spanId: "00f067aa0ba902b7"
254
+ traceState: ""
255
+ parentSpanId: "b9c7c989f97918e1"
143
256
  spanKind: INTERNAL
144
- operationName: process_order
257
+ startTimeUnixNano: "1544712660000000000"
258
+ endTimeUnixNano: "1544712661000000000"
259
+ droppedAttributesCount: 0
260
+ droppedEventsCount: 0
261
+ droppedLinksCount: 0
262
+ statusCode: OK
145
263
  attributes:
146
- - key: order.id
147
- type: string
148
- - key: order.total
149
- type: double
150
- - key: customer.id
151
- type: string
152
- events:
153
- - name: order_validated
154
- timestamp: relative
155
- - name: payment_processed
156
- timestamp: relative
157
- - name: inventory_reserved
158
- timestamp: relative
159
- instrumented-service: application.service.order-processing
160
- business-metrics:
161
- - apm.metric.orders-processed
162
- - apm.metric.order-processing-time
163
- sla-target-latency: 500ms
164
- sla-target-availability: 99.9%
264
+ order.id: "ord-12345"
265
+ order.total: 99.99
266
+ customer.id: "cust-67890"
165
267
  ```
166
268
 
167
269
  ---
@@ -169,58 +271,40 @@ properties:
169
271
  ## Example: Business Metrics
170
272
 
171
273
  ```yaml
172
- id: apm.metric.order-rate
274
+ id: apm.metricinstrument.order-rate
173
275
  name: "Order Rate Metric"
174
- type: instrument-config
276
+ type: metricinstrument
175
277
  properties:
176
- instrumentType: counter
278
+ type: Counter
177
279
  unit: orders
178
- description: "Number of orders processed"
179
- attributes:
180
- - key: order.type
181
- type: string
182
- values: [standard, express, subscription]
183
- - key: payment.method
184
- type: string
185
- values: [credit_card, paypal, bank_transfer]
186
- business-context:
187
- kpi: true
188
- dashboard: revenue-dashboard
189
- alerts:
190
- - threshold: 100
191
- condition: less-than
192
- severity: warning
193
- message: "Order rate below threshold"
280
+ description: "Number of orders processed per minute"
281
+ enabled: true
194
282
  ```
195
283
 
196
284
  ---
197
285
 
198
- ## Example: Data Quality Metrics
199
-
200
- ```yaml
201
- id: apm.data-quality-metrics.user-data
202
- name: "User Data Quality Metrics"
203
- type: data-quality-metrics
204
- properties:
205
- entity: data_model.object-schema.user
206
- metrics:
207
- - name: completeness
208
- type: gauge
209
- description: "Percentage of non-null required fields"
210
- target: 95%
211
- - name: validity
212
- type: gauge
213
- description: "Percentage of records passing validation"
214
- target: 99%
215
- - name: uniqueness
216
- type: gauge
217
- description: "Percentage of unique email addresses"
218
- target: 100%
219
- - name: freshness
220
- type: histogram
221
- description: "Time since last update"
222
- target: 24h
223
- ```
286
+ ## Coverage Completeness Checklist
287
+
288
+ Before declaring APM layer extraction complete, verify each type was considered:
289
+
290
+ - [ ] `apm.alert` — Alert rule with severity and notification channels
291
+ - [ ] `apm.dashboard` — Monitoring dashboard (Grafana, Datadog, etc.)
292
+ - [ ] `apm.exporterconfig` — Telemetry exporter configuration (OTLP, Prometheus, etc.)
293
+ - [ ] `apm.instrumentationconfig` — Code instrumentation configuration
294
+ - [ ] `apm.instrumentationscope` — Instrumentation scope (library version and schema URL)
295
+ - [ ] `apm.logconfiguration` — Logging configuration per service
296
+ - [ ] `apm.logprocessor` — Log processing pipeline step
297
+ - [ ] `apm.logrecord` — Individual structured log record
298
+ - [ ] `apm.metricconfiguration` — Metrics collection configuration per service
299
+ - [ ] `apm.metricinstrument` — Specific metric instrument (Counter, Gauge, Histogram, etc.)
300
+ - [ ] `apm.resource` — Telemetry resource attributes (service name, environment)
301
+ - [ ] `apm.span` — Unit of work in a distributed trace
302
+ - [ ] `apm.spanevent` — Timestamped event within a span
303
+ - [ ] `apm.spanlink` — Link between spans from different traces
304
+ - [ ] `apm.traceconfiguration` — Distributed tracing configuration
305
+
306
+ If any type has ZERO elements, explicitly decide:
307
+ "This type doesn't apply to this codebase" with reasoning.
224
308
 
225
309
  ---
226
310