@documentation-robotics/cli 0.1.0 → 0.1.5

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 (510) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +466 -693
  3. package/dist/analysis/data-model-analyzer.js +189 -0
  4. package/dist/analysis/data-model-analyzer.js.map +7 -0
  5. package/dist/analysis/index.js +3 -0
  6. package/dist/analysis/index.js.map +7 -0
  7. package/dist/analysis/relationship-classifier.js +181 -0
  8. package/dist/analysis/relationship-classifier.js.map +7 -0
  9. package/dist/analyzers/base-analyzer.js +1 -0
  10. package/dist/analyzers/base-analyzer.js.map +7 -0
  11. package/dist/analyzers/call-graph-utils.js +39 -0
  12. package/dist/analyzers/call-graph-utils.js.map +7 -0
  13. package/dist/analyzers/cbm-analyzer.js +1205 -0
  14. package/dist/analyzers/cbm-analyzer.js.map +7 -0
  15. package/dist/analyzers/heuristic-utils.js +55 -0
  16. package/dist/analyzers/heuristic-utils.js.map +7 -0
  17. package/dist/analyzers/mapping-loader.js +146 -0
  18. package/dist/analyzers/mapping-loader.js.map +7 -0
  19. package/dist/analyzers/registry.js +124 -0
  20. package/dist/analyzers/registry.js.map +7 -0
  21. package/dist/analyzers/session-state.js +176 -0
  22. package/dist/analyzers/session-state.js.map +7 -0
  23. package/dist/analyzers/stdio-client.js +206 -0
  24. package/dist/analyzers/stdio-client.js.map +7 -0
  25. package/dist/analyzers/types.js +15 -0
  26. package/dist/analyzers/types.js.map +7 -0
  27. package/dist/analyzers/verify-engine.js +209 -0
  28. package/dist/analyzers/verify-engine.js.map +7 -0
  29. package/dist/analyzers/verify-ignore.js +130 -0
  30. package/dist/analyzers/verify-ignore.js.map +7 -0
  31. package/dist/analyzers/version.js +8 -0
  32. package/dist/analyzers/version.js.map +7 -0
  33. package/dist/audit/ai/runner.js +41 -0
  34. package/dist/audit/ai/runner.js.map +7 -0
  35. package/dist/audit/differential-analyzer.js +183 -0
  36. package/dist/audit/differential-analyzer.js.map +7 -0
  37. package/dist/audit/index.js +32 -0
  38. package/dist/audit/index.js.map +7 -0
  39. package/dist/audit/nodes/ai/evaluator.js +49 -0
  40. package/dist/audit/nodes/ai/evaluator.js.map +7 -0
  41. package/dist/audit/nodes/ai/parser.js +55 -0
  42. package/dist/audit/nodes/ai/parser.js.map +7 -0
  43. package/dist/audit/nodes/ai/prompts.js +103 -0
  44. package/dist/audit/nodes/ai/prompts.js.map +7 -0
  45. package/dist/audit/nodes/analysis/node-completeness-checker.js +32 -0
  46. package/dist/audit/nodes/analysis/node-completeness-checker.js.map +7 -0
  47. package/dist/audit/nodes/analysis/node-definition-analyzer.js +47 -0
  48. package/dist/audit/nodes/analysis/node-definition-analyzer.js.map +7 -0
  49. package/dist/audit/nodes/analysis/node-overlap-detector.js +79 -0
  50. package/dist/audit/nodes/analysis/node-overlap-detector.js.map +7 -0
  51. package/dist/audit/nodes/model/orchestrator.js +82 -0
  52. package/dist/audit/nodes/model/orchestrator.js.map +7 -0
  53. package/dist/audit/nodes/spec/loader.js +116 -0
  54. package/dist/audit/nodes/spec/loader.js.map +7 -0
  55. package/dist/audit/nodes/spec/orchestrator.js +68 -0
  56. package/dist/audit/nodes/spec/orchestrator.js.map +7 -0
  57. package/dist/audit/nodes/types.js +1 -0
  58. package/dist/audit/nodes/types.js.map +7 -0
  59. package/dist/audit/pipeline/index.js +5 -0
  60. package/dist/audit/pipeline/index.js.map +7 -0
  61. package/dist/audit/pipeline/pipeline-orchestrator.js +218 -0
  62. package/dist/audit/pipeline/pipeline-orchestrator.js.map +7 -0
  63. package/dist/audit/relationships/ai/evaluator.js +235 -0
  64. package/dist/audit/relationships/ai/evaluator.js.map +7 -0
  65. package/dist/audit/relationships/ai/parser.js +197 -0
  66. package/dist/audit/relationships/ai/parser.js.map +7 -0
  67. package/dist/audit/relationships/ai/prompts.js +274 -0
  68. package/dist/audit/relationships/ai/prompts.js.map +7 -0
  69. package/dist/audit/relationships/analysis/balance-assessor.js +115 -0
  70. package/dist/audit/relationships/analysis/balance-assessor.js.map +7 -0
  71. package/dist/audit/relationships/analysis/coverage-analyzer.js +99 -0
  72. package/dist/audit/relationships/analysis/coverage-analyzer.js.map +7 -0
  73. package/dist/audit/relationships/analysis/duplicate-detector.js +95 -0
  74. package/dist/audit/relationships/analysis/duplicate-detector.js.map +7 -0
  75. package/dist/audit/relationships/analysis/gap-analyzer.js +99 -0
  76. package/dist/audit/relationships/analysis/gap-analyzer.js.map +7 -0
  77. package/dist/audit/relationships/analysis/layer-templates.js +294 -0
  78. package/dist/audit/relationships/analysis/layer-templates.js.map +7 -0
  79. package/dist/audit/relationships/graph/connectivity.js +129 -0
  80. package/dist/audit/relationships/graph/connectivity.js.map +7 -0
  81. package/dist/audit/relationships/graph/relationship-graph.js +179 -0
  82. package/dist/audit/relationships/graph/relationship-graph.js.map +7 -0
  83. package/dist/audit/relationships/model/balance-assessor.js +49 -0
  84. package/dist/audit/relationships/model/balance-assessor.js.map +7 -0
  85. package/dist/audit/relationships/model/coverage-analyzer.js +34 -0
  86. package/dist/audit/relationships/model/coverage-analyzer.js.map +7 -0
  87. package/dist/audit/relationships/model/duplicate-detector.js +68 -0
  88. package/dist/audit/relationships/model/duplicate-detector.js.map +7 -0
  89. package/dist/audit/relationships/model/gap-analyzer.js +41 -0
  90. package/dist/audit/relationships/model/gap-analyzer.js.map +7 -0
  91. package/dist/audit/relationships/model/orchestrator.js +126 -0
  92. package/dist/audit/relationships/model/orchestrator.js.map +7 -0
  93. package/dist/audit/relationships/spec/orchestrator.js +157 -0
  94. package/dist/audit/relationships/spec/orchestrator.js.map +7 -0
  95. package/dist/audit/reports/index.js +5 -0
  96. package/dist/audit/reports/index.js.map +7 -0
  97. package/dist/audit/reports/report-generator.js +118 -0
  98. package/dist/audit/reports/report-generator.js.map +7 -0
  99. package/dist/audit/snapshot-storage.js +163 -0
  100. package/dist/audit/snapshot-storage.js.map +7 -0
  101. package/dist/audit/types.js +21 -0
  102. package/dist/audit/types.js.map +7 -0
  103. package/dist/cli.js +223 -92
  104. package/dist/cli.js.map +3 -3
  105. package/dist/coding-agents/agents/claude-code.js +147 -0
  106. package/dist/coding-agents/agents/claude-code.js.map +7 -0
  107. package/dist/coding-agents/agents/index.js +5 -0
  108. package/dist/coding-agents/agents/index.js.map +7 -0
  109. package/dist/coding-agents/agents/types.js +1 -0
  110. package/dist/coding-agents/agents/types.js.map +7 -0
  111. package/dist/coding-agents/base-chat-client.js +45 -0
  112. package/dist/coding-agents/base-chat-client.js.map +7 -0
  113. package/dist/coding-agents/chat-utils.js +23 -0
  114. package/dist/coding-agents/chat-utils.js.map +7 -0
  115. package/dist/coding-agents/claude-code-client.js +246 -0
  116. package/dist/coding-agents/claude-code-client.js.map +7 -0
  117. package/dist/coding-agents/copilot-client.js +209 -0
  118. package/dist/coding-agents/copilot-client.js.map +7 -0
  119. package/dist/commands/add.js +95 -33
  120. package/dist/commands/add.js.map +2 -2
  121. package/dist/commands/analyzer.js +511 -0
  122. package/dist/commands/analyzer.js.map +7 -0
  123. package/dist/commands/audit-diff.js +49 -0
  124. package/dist/commands/audit-diff.js.map +7 -0
  125. package/dist/commands/audit-snapshots.js +62 -0
  126. package/dist/commands/audit-snapshots.js.map +7 -0
  127. package/dist/commands/audit.js +81 -0
  128. package/dist/commands/audit.js.map +7 -0
  129. package/dist/commands/catalog.js +248 -0
  130. package/dist/commands/catalog.js.map +7 -0
  131. package/dist/commands/changeset.js +577 -66
  132. package/dist/commands/changeset.js.map +2 -2
  133. package/dist/commands/chat.js +106 -83
  134. package/dist/commands/chat.js.map +2 -2
  135. package/dist/commands/claude.js +74 -0
  136. package/dist/commands/claude.js.map +7 -0
  137. package/dist/commands/conformance.js +71 -68
  138. package/dist/commands/conformance.js.map +2 -2
  139. package/dist/commands/copilot.js +75 -0
  140. package/dist/commands/copilot.js.map +7 -0
  141. package/dist/commands/delete.js +125 -11
  142. package/dist/commands/delete.js.map +3 -3
  143. package/dist/commands/discover-logic.js +44 -0
  144. package/dist/commands/discover-logic.js.map +7 -0
  145. package/dist/commands/docs.js +87 -0
  146. package/dist/commands/docs.js.map +7 -0
  147. package/dist/commands/element.js +14 -20
  148. package/dist/commands/element.js.map +2 -2
  149. package/dist/commands/export.js +13 -3
  150. package/dist/commands/export.js.map +2 -2
  151. package/dist/commands/import.js +51 -0
  152. package/dist/commands/import.js.map +7 -0
  153. package/dist/commands/info.js +30 -24
  154. package/dist/commands/info.js.map +2 -2
  155. package/dist/commands/init.js +27 -11
  156. package/dist/commands/init.js.map +2 -2
  157. package/dist/commands/list.js +63 -13
  158. package/dist/commands/list.js.map +3 -3
  159. package/dist/commands/relationship.js +225 -37
  160. package/dist/commands/relationship.js.map +2 -2
  161. package/dist/commands/report.js +54 -0
  162. package/dist/commands/report.js.map +7 -0
  163. package/dist/commands/reports.js +45 -0
  164. package/dist/commands/reports.js.map +7 -0
  165. package/dist/commands/schema.js +135 -0
  166. package/dist/commands/schema.js.map +7 -0
  167. package/dist/commands/search.js +40 -12
  168. package/dist/commands/search.js.map +2 -2
  169. package/dist/commands/show.js +58 -27
  170. package/dist/commands/show.js.map +2 -2
  171. package/dist/commands/stats.js +35 -0
  172. package/dist/commands/stats.js.map +7 -0
  173. package/dist/commands/trace.js +39 -16
  174. package/dist/commands/trace.js.map +2 -2
  175. package/dist/commands/update.js +141 -14
  176. package/dist/commands/update.js.map +2 -2
  177. package/dist/commands/upgrade.js +210 -46
  178. package/dist/commands/upgrade.js.map +3 -3
  179. package/dist/commands/validate.js +142 -23
  180. package/dist/commands/validate.js.map +3 -3
  181. package/dist/commands/version.js +8 -12
  182. package/dist/commands/version.js.map +2 -2
  183. package/dist/commands/visualize.js +155 -25
  184. package/dist/commands/visualize.js.map +2 -2
  185. package/dist/core/base-snapshot-manager.js +84 -0
  186. package/dist/core/base-snapshot-manager.js.map +7 -0
  187. package/dist/core/changeset-exporter.js +305 -0
  188. package/dist/core/changeset-exporter.js.map +7 -0
  189. package/dist/core/changeset-validator.js +41 -0
  190. package/dist/core/changeset-validator.js.map +7 -0
  191. package/dist/core/changeset.js +88 -173
  192. package/dist/core/changeset.js.map +2 -2
  193. package/dist/core/dependency-tracker.js +4 -2
  194. package/dist/core/dependency-tracker.js.map +2 -2
  195. package/dist/core/element.js +98 -27
  196. package/dist/core/element.js.map +2 -2
  197. package/dist/core/golden-copy-cache.js +290 -0
  198. package/dist/core/golden-copy-cache.js.map +7 -0
  199. package/dist/core/graph-model.js +266 -0
  200. package/dist/core/graph-model.js.map +7 -0
  201. package/dist/core/layer.js +159 -16
  202. package/dist/core/layer.js.map +2 -2
  203. package/dist/core/layers.js +32 -0
  204. package/dist/core/layers.js.map +7 -0
  205. package/dist/core/manifest.js +32 -11
  206. package/dist/core/manifest.js.map +2 -2
  207. package/dist/core/migration-registry.js +56 -1
  208. package/dist/core/migration-registry.js.map +2 -2
  209. package/dist/core/model.js +424 -217
  210. package/dist/core/model.js.map +3 -3
  211. package/dist/core/mutation-handler.js +179 -0
  212. package/dist/core/mutation-handler.js.map +7 -0
  213. package/dist/core/reference-registry.js +29 -21
  214. package/dist/core/reference-registry.js.map +2 -2
  215. package/dist/core/relationship-catalog.js +189 -0
  216. package/dist/core/relationship-catalog.js.map +7 -0
  217. package/dist/core/relationship-registry.js.map +2 -2
  218. package/dist/core/relationships.js.map +1 -1
  219. package/dist/core/report-data-model.js +285 -0
  220. package/dist/core/report-data-model.js.map +7 -0
  221. package/dist/core/spec-data-service.js +185 -0
  222. package/dist/core/spec-data-service.js.map +7 -0
  223. package/dist/core/spec-loader-types.js +1 -0
  224. package/dist/core/spec-loader-types.js.map +7 -0
  225. package/dist/core/spec-loader.js +234 -0
  226. package/dist/core/spec-loader.js.map +7 -0
  227. package/dist/core/staged-changeset-storage.js +282 -0
  228. package/dist/core/staged-changeset-storage.js.map +7 -0
  229. package/dist/core/staging-area.js +1002 -0
  230. package/dist/core/staging-area.js.map +7 -0
  231. package/dist/core/stats-collector.js +169 -0
  232. package/dist/core/stats-collector.js.map +7 -0
  233. package/dist/core/virtual-projection.js +443 -0
  234. package/dist/core/virtual-projection.js.map +7 -0
  235. package/dist/export/archimate-exporter.js +99 -60
  236. package/dist/export/archimate-exporter.js.map +2 -2
  237. package/dist/export/audit-formatters.js +479 -0
  238. package/dist/export/audit-formatters.js.map +7 -0
  239. package/dist/export/diff-formatters.js +99 -0
  240. package/dist/export/diff-formatters.js.map +7 -0
  241. package/dist/export/export-manager.js.map +2 -2
  242. package/dist/export/graphml-exporter.js +44 -27
  243. package/dist/export/graphml-exporter.js.map +2 -2
  244. package/dist/export/index.js +4 -0
  245. package/dist/export/index.js.map +2 -2
  246. package/dist/export/json-schema-exporter.js +55 -42
  247. package/dist/export/json-schema-exporter.js.map +2 -2
  248. package/dist/export/markdown-exporter.js +92 -70
  249. package/dist/export/markdown-exporter.js.map +2 -2
  250. package/dist/export/markdown-generator.js +248 -0
  251. package/dist/export/markdown-generator.js.map +7 -0
  252. package/dist/export/markdown-utils.js +30 -0
  253. package/dist/export/markdown-utils.js.map +7 -0
  254. package/dist/export/mermaid-markdown-exporter.js +37 -0
  255. package/dist/export/mermaid-markdown-exporter.js.map +7 -0
  256. package/dist/export/openapi-exporter.js +119 -71
  257. package/dist/export/openapi-exporter.js.map +2 -2
  258. package/dist/export/plantuml-exporter.js +104 -39
  259. package/dist/export/plantuml-exporter.js.map +2 -2
  260. package/dist/export/report-formatters.js +111 -0
  261. package/dist/export/report-formatters.js.map +7 -0
  262. package/dist/export/stats-formatters.js +98 -0
  263. package/dist/export/stats-formatters.js.map +7 -0
  264. package/dist/export/types.js +2 -14
  265. package/dist/export/types.js.map +2 -2
  266. package/dist/export/verify-formatters.js +153 -0
  267. package/dist/export/verify-formatters.js.map +7 -0
  268. package/dist/generated/compiled-validators.js +17 -0
  269. package/dist/generated/compiled-validators.js.map +7 -0
  270. package/dist/generated/index.js +31 -0
  271. package/dist/generated/index.js.map +7 -0
  272. package/dist/generated/layer-registry.js +190 -0
  273. package/dist/generated/layer-registry.js.map +7 -0
  274. package/dist/generated/layer-types.js +7 -0
  275. package/dist/generated/layer-types.js.map +7 -0
  276. package/dist/generated/node-types.js +1719 -0
  277. package/dist/generated/node-types.js.map +7 -0
  278. package/dist/generated/relationship-index.js +14552 -0
  279. package/dist/generated/relationship-index.js.map +7 -0
  280. package/dist/import/archimate-importer.js +166 -0
  281. package/dist/import/archimate-importer.js.map +7 -0
  282. package/dist/import/index.js +47 -0
  283. package/dist/import/index.js.map +7 -0
  284. package/dist/import/openapi-importer.js +143 -0
  285. package/dist/import/openapi-importer.js.map +7 -0
  286. package/dist/import/types.js +1 -0
  287. package/dist/import/types.js.map +7 -0
  288. package/dist/integrations/base-manager.js +311 -0
  289. package/dist/integrations/base-manager.js.map +7 -0
  290. package/dist/integrations/claude-manager.js +360 -0
  291. package/dist/integrations/claude-manager.js.map +7 -0
  292. package/dist/integrations/claude_code/agents/dr-advisor.md +253 -0
  293. package/dist/integrations/claude_code/agents/dr-architect.md +278 -0
  294. package/dist/integrations/claude_code/agents/dr-extractor.md +286 -0
  295. package/dist/integrations/claude_code/commands/dr-changeset.md +657 -0
  296. package/dist/integrations/claude_code/commands/dr-design.md +373 -0
  297. package/dist/integrations/claude_code/commands/dr-info.md +132 -0
  298. package/dist/integrations/claude_code/commands/dr-init.md +251 -0
  299. package/dist/integrations/claude_code/commands/dr-map.md +936 -0
  300. package/dist/integrations/claude_code/commands/dr-model.md +493 -0
  301. package/dist/integrations/claude_code/commands/dr-relate.md +814 -0
  302. package/dist/integrations/claude_code/commands/dr-sync.md +279 -0
  303. package/dist/integrations/claude_code/commands/dr-validate.md +654 -0
  304. package/dist/integrations/claude_code/commands/dr-verify.md +559 -0
  305. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +903 -0
  306. package/dist/integrations/claude_code/docs/QUICK_START.md +271 -0
  307. package/dist/integrations/claude_code/docs/README.md +347 -0
  308. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +550 -0
  309. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +620 -0
  310. package/dist/integrations/claude_code/skills/dr_03_security_layer/SKILL.md +642 -0
  311. package/dist/integrations/claude_code/skills/dr_04_application_layer/SKILL.md +911 -0
  312. package/dist/integrations/claude_code/skills/dr_05_technology_layer/SKILL.md +836 -0
  313. package/dist/integrations/claude_code/skills/dr_06_api_layer/SKILL.md +933 -0
  314. package/dist/integrations/claude_code/skills/dr_07_data_model_layer/SKILL.md +210 -0
  315. package/dist/integrations/claude_code/skills/dr_08_dataset_layer/SKILL.md +319 -0
  316. package/dist/integrations/claude_code/skills/dr_09_ux_layer/SKILL.md +319 -0
  317. package/dist/integrations/claude_code/skills/dr_10_navigation_layer/SKILL.md +318 -0
  318. package/dist/integrations/claude_code/skills/dr_11_apm_layer/SKILL.md +273 -0
  319. package/dist/integrations/claude_code/skills/dr_12_testing_layer/SKILL.md +273 -0
  320. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +187 -0
  321. package/dist/integrations/claude_code/skills/dr_codebase_memory/SKILL.md +590 -0
  322. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +295 -0
  323. package/dist/integrations/copilot-manager.js +328 -0
  324. package/dist/integrations/copilot-manager.js.map +7 -0
  325. package/dist/integrations/github_copilot/agents/dr-advisor.md +243 -0
  326. package/dist/integrations/github_copilot/agents/dr-architect.md +1567 -0
  327. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +491 -0
  328. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +539 -0
  329. package/dist/integrations/github_copilot/skills/dr_03_security_layer/SKILL.md +667 -0
  330. package/dist/integrations/github_copilot/skills/dr_04_application_layer/SKILL.md +670 -0
  331. package/dist/integrations/github_copilot/skills/dr_05_technology_layer/SKILL.md +660 -0
  332. package/dist/integrations/github_copilot/skills/dr_06_api_layer/SKILL.md +855 -0
  333. package/dist/integrations/github_copilot/skills/dr_07_data_model_layer/SKILL.md +171 -0
  334. package/dist/integrations/github_copilot/skills/dr_08_dataset_layer/SKILL.md +216 -0
  335. package/dist/integrations/github_copilot/skills/dr_09_ux_layer/SKILL.md +230 -0
  336. package/dist/integrations/github_copilot/skills/dr_10_navigation_layer/SKILL.md +228 -0
  337. package/dist/integrations/github_copilot/skills/dr_11_apm_layer/SKILL.md +234 -0
  338. package/dist/integrations/github_copilot/skills/dr_12_testing_layer/SKILL.md +230 -0
  339. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +187 -0
  340. package/dist/integrations/hash-utils.js +51 -0
  341. package/dist/integrations/hash-utils.js.map +7 -0
  342. package/dist/integrations/types.js +16 -0
  343. package/dist/integrations/types.js.map +7 -0
  344. package/dist/reports/model-layer-report-generator.js +278 -0
  345. package/dist/reports/model-layer-report-generator.js.map +7 -0
  346. package/dist/reports/model-report-data.js +57 -0
  347. package/dist/reports/model-report-data.js.map +7 -0
  348. package/dist/reports/model-report-orchestrator.js +103 -0
  349. package/dist/reports/model-report-orchestrator.js.map +7 -0
  350. package/dist/schemas/bundled/analyzers/cbm.json +595 -0
  351. package/dist/schemas/bundled/analyzers/manifest.json +9 -0
  352. package/dist/schemas/bundled/api.json +3411 -0
  353. package/dist/schemas/bundled/apm.json +2371 -0
  354. package/dist/schemas/bundled/application.json +1253 -0
  355. package/dist/schemas/bundled/base.json +1622 -0
  356. package/dist/schemas/bundled/business.json +1279 -0
  357. package/dist/schemas/bundled/data-model.json +1298 -0
  358. package/dist/schemas/bundled/data-store.json +2025 -0
  359. package/dist/schemas/bundled/manifest.json +93 -0
  360. package/dist/schemas/bundled/motivation.json +1360 -0
  361. package/dist/schemas/bundled/navigation.json +1874 -0
  362. package/dist/schemas/bundled/security.json +3488 -0
  363. package/dist/schemas/bundled/technology.json +2067 -0
  364. package/dist/schemas/bundled/testing.json +3120 -0
  365. package/dist/schemas/bundled/ux.json +3592 -0
  366. package/dist/server/schemas.js +202 -0
  367. package/dist/server/schemas.js.map +7 -0
  368. package/dist/server/server.js +1336 -252
  369. package/dist/server/server.js.map +3 -3
  370. package/dist/server/telemetry-middleware.js +22 -15
  371. package/dist/server/telemetry-middleware.js.map +2 -2
  372. package/dist/server-entry.js +65 -0
  373. package/dist/server-entry.js.map +7 -0
  374. package/dist/telemetry/config.js +89 -0
  375. package/dist/telemetry/config.js.map +7 -0
  376. package/dist/telemetry/console-interceptor.js.map +1 -1
  377. package/dist/telemetry/detect.js +24 -0
  378. package/dist/telemetry/detect.js.map +7 -0
  379. package/dist/telemetry/fetch-otlp-exporter.js +112 -0
  380. package/dist/telemetry/fetch-otlp-exporter.js.map +7 -0
  381. package/dist/telemetry/index.js +153 -3
  382. package/dist/telemetry/index.js.map +2 -2
  383. package/dist/telemetry/resilient-exporter.js +22 -8
  384. package/dist/telemetry/resilient-exporter.js.map +2 -2
  385. package/dist/telemetry/resilient-log-exporter.js +17 -8
  386. package/dist/telemetry/resilient-log-exporter.js.map +2 -2
  387. package/dist/telemetry/test-instrumentation.js.map +2 -2
  388. package/dist/types/index.js +84 -0
  389. package/dist/types/index.js.map +3 -3
  390. package/dist/types/source-reference.js +1 -0
  391. package/dist/types/source-reference.js.map +7 -0
  392. package/dist/utils/chat-logger.js +292 -0
  393. package/dist/utils/chat-logger.js.map +7 -0
  394. package/dist/utils/claude-stream.js +8 -0
  395. package/dist/utils/claude-stream.js.map +7 -0
  396. package/dist/utils/date-utils.js +7 -0
  397. package/dist/utils/date-utils.js.map +7 -0
  398. package/dist/utils/element-utils.js.map +1 -1
  399. package/dist/utils/errors.js +88 -15
  400. package/dist/utils/errors.js.map +3 -3
  401. package/dist/utils/export-python-annotations.js +82 -0
  402. package/dist/utils/export-python-annotations.js.map +7 -0
  403. package/dist/utils/file-io.js +7 -2
  404. package/dist/utils/file-io.js.map +2 -2
  405. package/dist/utils/file-lock.js +156 -0
  406. package/dist/utils/file-lock.js.map +7 -0
  407. package/dist/utils/id-generator.js +18 -0
  408. package/dist/utils/id-generator.js.map +7 -0
  409. package/dist/utils/layer-name-formatter.js +16 -0
  410. package/dist/utils/layer-name-formatter.js.map +7 -0
  411. package/dist/utils/markdown-anchor.js +7 -0
  412. package/dist/utils/markdown-anchor.js.map +7 -0
  413. package/dist/utils/markdown-link.js +12 -0
  414. package/dist/utils/markdown-link.js.map +7 -0
  415. package/dist/utils/markdown-table.js +17 -0
  416. package/dist/utils/markdown-table.js.map +7 -0
  417. package/dist/utils/mermaid-utils.js +11 -0
  418. package/dist/utils/mermaid-utils.js.map +7 -0
  419. package/dist/utils/project-paths.js.map +2 -2
  420. package/dist/utils/source-reference.js +52 -0
  421. package/dist/utils/source-reference.js.map +7 -0
  422. package/dist/utils/spec-installer.js +40 -53
  423. package/dist/utils/spec-installer.js.map +2 -2
  424. package/dist/utils/spec-version.js +5 -1
  425. package/dist/utils/spec-version.js.map +2 -2
  426. package/dist/utils/string-utils.js +12 -0
  427. package/dist/utils/string-utils.js.map +7 -0
  428. package/dist/utils/table-formatting.js +19 -0
  429. package/dist/utils/table-formatting.js.map +7 -0
  430. package/dist/validators/index.js +4 -0
  431. package/dist/validators/index.js.map +2 -2
  432. package/dist/validators/naming-validator.js +20 -23
  433. package/dist/validators/naming-validator.js.map +2 -2
  434. package/dist/validators/reference-validator.js +23 -38
  435. package/dist/validators/reference-validator.js.map +2 -2
  436. package/dist/validators/relationship-schema-validator.js +243 -0
  437. package/dist/validators/relationship-schema-validator.js.map +7 -0
  438. package/dist/validators/schema-validator.js +168 -68
  439. package/dist/validators/schema-validator.js.map +2 -2
  440. package/dist/validators/semantic-validator.js +36 -60
  441. package/dist/validators/semantic-validator.js.map +2 -2
  442. package/dist/validators/types.js.map +2 -2
  443. package/dist/validators/validation-formatter.js +159 -0
  444. package/dist/validators/validation-formatter.js.map +7 -0
  445. package/dist/validators/validator.js +24 -38
  446. package/dist/validators/validator.js.map +2 -2
  447. package/dist/viewer/README.md +139 -0
  448. package/dist/viewer/assets/main-CY0Xufuj.css +1 -0
  449. package/dist/viewer/assets/main-DtgErnwF.js +81 -0
  450. package/dist/viewer/assets/vendor-CxKvDp2x.js +17 -0
  451. package/dist/viewer/favicon.svg +11 -0
  452. package/dist/viewer/fonts/inter/Inter-Black.woff2 +0 -0
  453. package/dist/viewer/fonts/inter/Inter-Bold.woff2 +0 -0
  454. package/dist/viewer/fonts/inter/Inter-ExtraBold.woff2 +0 -0
  455. package/dist/viewer/fonts/inter/Inter-Light.woff2 +0 -0
  456. package/dist/viewer/fonts/inter/Inter-Medium.woff2 +0 -0
  457. package/dist/viewer/fonts/inter/Inter-Regular.woff2 +0 -0
  458. package/dist/viewer/fonts/inter/Inter-SemiBold.woff2 +0 -0
  459. package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2 +0 -0
  460. package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
  461. package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-SemiBold.woff2 +0 -0
  462. package/dist/viewer/index.html +15 -0
  463. package/dist/viewer/manifest.json +99 -0
  464. package/dist/viewer/version.json +1 -0
  465. package/package.json +37 -13
  466. package/PYTHON_CLI_PARITY.md +0 -265
  467. package/PYTHON_CLI_STRUCTURE_UPDATE.md +0 -246
  468. package/biome.json +0 -42
  469. package/bunfig.toml +0 -3
  470. package/dist/ai/claude-client.js +0 -71
  471. package/dist/ai/claude-client.js.map +0 -7
  472. package/dist/ai/context-provider.js +0 -129
  473. package/dist/ai/context-provider.js.map +0 -7
  474. package/dist/ai/tools.js +0 -231
  475. package/dist/ai/tools.js.map +0 -7
  476. package/dist/commands/migrate.js +0 -36
  477. package/dist/commands/migrate.js.map +0 -7
  478. package/dist/commands/project.js +0 -74
  479. package/dist/commands/project.js.map +0 -7
  480. package/dist/core/active-changeset.js +0 -52
  481. package/dist/core/active-changeset.js.map +0 -7
  482. package/dist/core/projection-engine.js +0 -288
  483. package/dist/core/projection-engine.js.map +0 -7
  484. package/dist/schemas/bundled/01-motivation-layer.schema.json +0 -942
  485. package/dist/schemas/bundled/02-business-layer.schema.json +0 -1293
  486. package/dist/schemas/bundled/03-security-layer.schema.json +0 -2177
  487. package/dist/schemas/bundled/04-application-layer.schema.json +0 -1328
  488. package/dist/schemas/bundled/05-technology-layer.schema.json +0 -1465
  489. package/dist/schemas/bundled/06-api-layer.schema.json +0 -1743
  490. package/dist/schemas/bundled/07-data-model-layer.schema.json +0 -1253
  491. package/dist/schemas/bundled/08-datastore-layer.schema.json +0 -892
  492. package/dist/schemas/bundled/09-ux-layer.schema.json +0 -1506
  493. package/dist/schemas/bundled/10-navigation-layer.schema.json +0 -843
  494. package/dist/schemas/bundled/11-apm-observability-layer.schema.json +0 -1430
  495. package/dist/schemas/bundled/12-testing-layer.schema.json +0 -1091
  496. package/dist/schemas/bundled/common/layer-extensions.schema.json +0 -266
  497. package/dist/schemas/bundled/common/predicates.schema.json +0 -493
  498. package/dist/schemas/bundled/common/relationships.schema.json +0 -791
  499. package/dist/schemas/bundled/common/source-references.schema.json +0 -71
  500. package/dist/schemas/bundled/link-registry.json +0 -1839
  501. package/dist/schemas/bundled/link-registry.schema.json +0 -339
  502. package/dist/schemas/bundled/relationship-catalog.json +0 -1302
  503. package/dist/schemas/bundled/relationship-type.schema.json +0 -221
  504. package/dist/utils/model-path.js +0 -22
  505. package/dist/utils/model-path.js.map +0 -7
  506. package/docs/TEST-INSTRUMENTATION.md +0 -405
  507. package/docs/telemetry.md +0 -427
  508. package/test-debug.js +0 -33
  509. package/test-special.mjs +0 -46
  510. package/test_runner.ts +0 -7
@@ -0,0 +1,654 @@
1
+ ---
2
+ description: Comprehensive validation of DR model including schema, references, semantic rules, and cross-layer relationships
3
+ argument-hint: "[--strict]"
4
+ ---
5
+
6
+ # Validate Architecture Model
7
+
8
+ Comprehensive validation of the Documentation Robotics model including schema, naming, references, semantic rules, and cross-layer relationship validation.
9
+
10
+ ## What This Command Does
11
+
12
+ 1. Runs comprehensive validation on the architecture model:
13
+ - Schema validation (JSON schema compliance)
14
+ - Naming conventions (kebab-case, valid IDs)
15
+ - Reference integrity (broken references)
16
+ - Semantic rules (business logic, best practices)
17
+ - **Cross-layer relationship validation** (existence, type, cardinality, format)
18
+ - **Intra-layer relationship validation** (validated against relationship catalog)
19
+ 2. Reports errors, warnings, and informational messages
20
+ 3. Analyzes issues and suggests fixes with confidence scores
21
+ 4. Provides actionable recommendations for fixes
22
+
23
+ ## Usage
24
+
25
+ ```
26
+ /dr-validate [--strict]
27
+ ```
28
+
29
+ **Options:**
30
+
31
+ - `--strict`: Enable strict validation with comprehensive semantic rules
32
+
33
+ ## Instructions for Claude Code
34
+
35
+ When the user runs this command, perform intelligent validation with helpful suggestions.
36
+
37
+ ### Step 1: Run Initial Validation
38
+
39
+ **Basic validation** (default):
40
+
41
+ ```bash
42
+ dr validate
43
+ ```
44
+
45
+ **Comprehensive validation with strict rules**:
46
+
47
+ ```bash
48
+ dr validate --strict
49
+ ```
50
+
51
+ ### Relationship Validation
52
+
53
+ Cross-layer and intra-layer relationship validation checks:
54
+
55
+ 1. **Existence**: Target elements exist
56
+ 2. **Type**: Correct element types referenced
57
+ 3. **Cardinality**: Single values vs arrays correct
58
+ 4. **Format**: Valid element ID format (UUID, paths, durations)
59
+ 5. **Catalog Compliance**: Intra-layer relationships exist in relationship catalog
60
+
61
+ ### Step 2: Parse and Categorize Results
62
+
63
+ Group validation results by severity:
64
+
65
+ - **Errors** (❌): Must fix (breaks model integrity)
66
+ - **Warnings** (⚠️): Should fix (best practices)
67
+ - **Info** (ℹ️): Consider (suggestions)
68
+
69
+ ### Step 3: Analyze and Present Results
70
+
71
+ Present results in a clear, organized format:
72
+
73
+ ```
74
+ Validation Results
75
+ ==================
76
+
77
+ Summary:
78
+ ❌ 3 errors
79
+ ⚠️ 5 warnings
80
+ ℹ️ 2 info
81
+
82
+ Errors (must fix):
83
+
84
+ 1. ❌ business.service.orders
85
+ Location: documentation-robotics/model/02_business/services.yaml:15
86
+ Issue: Missing 'realizes' cross-layer reference
87
+ Impact: No traceability to application layer
88
+
89
+ Suggested fix:
90
+ → Add reference to application service
91
+ Command: dr update business.service.orders \
92
+ --property realizes=application.service.order-api
93
+
94
+ 2. ❌ application.service.payment-api
95
+ Location: documentation-robotics/model/04_application/services.yaml:23
96
+ Issue: Critical service has no security policy
97
+ Impact: High-risk service is unsecured
98
+
99
+ Suggested fix:
100
+ → Add authentication scheme
101
+ Command: dr add security policy \
102
+ --name "Payment API Authentication" \
103
+ --property applies_to=application.service.payment-api
104
+
105
+ [Continue for all errors...]
106
+
107
+ Warnings (should fix):
108
+ [List warnings with suggestions...]
109
+
110
+ Info (suggestions):
111
+ [List informational items...]
112
+ ```
113
+
114
+ ### Step 4: Suggest Fixes
115
+
116
+ For each issue, provide:
117
+
118
+ 1. **Clear explanation**: What's wrong and why it matters
119
+ 2. **Specific fix**: Exact command to resolve
120
+ 3. **Confidence level**: How certain you are this is the right fix
121
+ 4. **Risk assessment**: Is this safe to auto-fix?
122
+
123
+ #### Fix Confidence Levels
124
+
125
+ **High confidence** (✓ Auto-fix safe):
126
+
127
+ - Broken references with obvious targets
128
+ - Missing descriptions (can infer from name)
129
+ - Naming convention fixes
130
+ - Missing IDs (can generate)
131
+
132
+ **Medium confidence** (⚠ Review recommended):
133
+
134
+ - Security policy selection (multiple options)
135
+ - Goal associations (requires domain knowledge)
136
+ - Criticality levels (business decision)
137
+
138
+ **Low confidence** (❌ Manual review required):
139
+
140
+ - Complex traceability issues
141
+ - Architectural decisions
142
+ - Business-specific requirements
143
+
144
+ ### Step 5: Apply Fixes (if requested)
145
+
146
+ When user requests fixes:
147
+
148
+ 1. **Show fix plan**: List all fixes to be applied
149
+ 2. **Separate by risk**: Group safe vs. risky fixes
150
+ 3. **Get confirmation**: Always ask before applying changes
151
+ 4. **Apply approved fixes**: Execute commands sequentially
152
+ 5. **Re-validate**: Confirm fixes resolved issues
153
+ 6. **Report results**: Show what was fixed and what remains
154
+
155
+ #### Auto-Fix Process
156
+
157
+ ```bash
158
+ # Get user confirmation
159
+ "I found 8 issues. Here's my fix plan:
160
+
161
+ Safe to auto-fix (5):
162
+ ✓ Add missing descriptions (3 elements)
163
+ ✓ Fix naming conventions (2 elements)
164
+
165
+ Require review (3):
166
+ ⚠ Select security policies (2 services)
167
+ ⚠ Associate with goals (1 service)
168
+
169
+ Apply safe fixes now? (I'll ask about the others)"
170
+
171
+ # If yes, apply safe fixes
172
+ dr update business.service.orders \
173
+ --description "Manages customer orders"
174
+
175
+ dr update business.service.shipping \
176
+ --description "Handles shipping logistics"
177
+
178
+ # ... continue for all safe fixes
179
+
180
+ # Re-validate
181
+ dr validate
182
+
183
+ # Report
184
+ "✓ Applied 5 fixes
185
+ ✓ Re-validated
186
+
187
+ Remaining issues: 3 (require review)
188
+ [Show remaining issues with recommendations]"
189
+ ```
190
+
191
+ ### Step 6: Handle Different Validation Scenarios
192
+
193
+ #### Scenario 1: Clean Model (No Issues)
194
+
195
+ ```
196
+ ✓ Validation passed!
197
+
198
+ Model is healthy:
199
+ - 0 errors
200
+ - 0 warnings
201
+ - All cross-layer references valid
202
+ - Naming conventions followed
203
+ - Semantic rules satisfied
204
+
205
+ Great job! Your model is well-structured.
206
+ ```
207
+
208
+ #### Scenario 2: Minor Issues (Warnings Only)
209
+
210
+ ```
211
+ ⚠️ Validation passed with warnings
212
+
213
+ Summary: 0 errors, 3 warnings
214
+
215
+ Your model is valid but could be improved:
216
+
217
+ 1. ⚠️ business.service.checkout
218
+ Recommendation: Add description to document what this element represents
219
+ Impact: Improves model documentation quality
220
+
221
+ 2. ⚠️ application.service.reporting
222
+ Recommendation: Add monitoring metrics
223
+ Impact: Improves observability
224
+
225
+ 3. ⚠️ api.operation.create-payment
226
+ Recommendation: Consider adding rate limiting
227
+ Impact: Protects against abuse
228
+
229
+ Would you like me to address these warnings?
230
+ ```
231
+
232
+ #### Scenario 3: Critical Errors
233
+
234
+ ```
235
+ ❌ Validation failed
236
+
237
+ Summary: 3 errors, 2 warnings
238
+
239
+ Critical issues found:
240
+
241
+ 1. ❌ application.service.payment-api
242
+ Error: References non-existent business.service.payment
243
+ Impact: Broken traceability chain
244
+ Fix: Create business service or update reference
245
+
246
+ 2. ❌ Invalid ID format: business.service.Order_Management
247
+ Error: Must use kebab-case
248
+ Impact: Violates naming convention
249
+ Fix: Rename to: business.service.order-management
250
+
251
+ 3. ❌ security.policy.pci-dss
252
+ Error: Applies to non-existent application.service.payment
253
+ Impact: Security policy orphaned
254
+ Fix: Update reference or remove policy
255
+
256
+ I can fix #2 automatically (rename).
257
+ #1 and #3 require your input - which service should they reference?
258
+ ```
259
+
260
+ #### Scenario 4: Pattern Detection
261
+
262
+ Look for patterns in errors to provide higher-level guidance:
263
+
264
+ ```
265
+ Detected patterns:
266
+
267
+ 🔍 Security Gap (3 services)
268
+ All critical services should have security policies.
269
+ Found 3 critical services without policies:
270
+ - application.service.payment-api
271
+ - application.service.order-api
272
+ - application.service.user-api
273
+
274
+ Fix: /dr-model Add authentication policies to critical services
275
+
276
+ 🔍 Missing Monitoring (5 services)
277
+ Critical services should have APM metrics.
278
+ Found 5 critical services without metrics:
279
+ [list services...]
280
+
281
+ Fix: /dr-model Add availability and latency metrics
282
+
283
+ 🔍 Broken Traceability (2 services)
284
+ Application services should realize business services.
285
+ Found 2 application services with no 'realizes' reference:
286
+ [list services...]
287
+
288
+ Fix: Review each service and add business service references
289
+ ```
290
+
291
+ ### Step 7: Provide Actionable Next Steps
292
+
293
+ Based on validation results, suggest specific actions:
294
+
295
+ ```
296
+ Next steps:
297
+
298
+ Priority 1 (Critical):
299
+ 1. Fix broken references (3 errors)
300
+ → I can help fix these (ask me to apply fixes)
301
+
302
+ Priority 2 (Security):
303
+ 2. Add security policies to critical services
304
+ → Run: /dr-model Add OAuth2 authentication for payment API
305
+
306
+ Priority 3 (Monitoring):
307
+ 3. Add APM metrics for critical services
308
+ → Run: /dr-model Add availability metrics to critical services
309
+
310
+ Priority 4 (Documentation):
311
+ 4. Add descriptions to 5 elements
312
+ → I can help fix these with high confidence
313
+ ```
314
+
315
+ ## Advanced Features
316
+
317
+ ### Understanding Warning Categories
318
+
319
+ Not all warnings require immediate action. Understand the priority:
320
+
321
+ **Structural errors** (❌ — must fix before `dr changeset commit` will succeed):
322
+
323
+ - Schema violations (missing required fields, wrong types)
324
+ - Broken references (referencing non-existent elements)
325
+ - Naming convention violations
326
+ - Cardinality violations in relationships
327
+
328
+ **Orphan warnings** (⚠️ — expected during active development):
329
+
330
+ - Elements with no cross-layer references or intra-layer relationships
331
+ - Normal during incremental work — run `/dr-relate` to wire them up when ready
332
+ - Do NOT block `dr changeset commit`
333
+
334
+ **Source-reference warnings** (⚠️ — expected on manually authored elements):
335
+
336
+ - Elements without `source_reference` provenance
337
+ - Normal for hand-authored elements; only mandatory for elements created via `dr scan`
338
+ - Do NOT block `dr changeset commit`
339
+
340
+ ### Validate Before Commit
341
+
342
+ Run `dr validate` **before** `dr changeset commit` so you can see and react to errors:
343
+
344
+ ```bash
345
+ # Step 1: Validate (includes staged changes automatically)
346
+ dr validate
347
+
348
+ # Step 2: Fix any structural errors
349
+ # [apply fixes as needed]
350
+
351
+ # Step 3: Commit — built-in validation runs again as a safety net
352
+ dr changeset commit
353
+ ```
354
+
355
+ If a changeset is active, `dr validate` automatically validates the projected model (staged changes merged with the base model). You see exactly what `commit` will validate.
356
+
357
+ ### Validate a Specific Layer
358
+
359
+ ```bash
360
+ # Only validate the API layer (faster for targeted checks)
361
+ dr validate --layers api
362
+
363
+ # Validate multiple layers
364
+ dr validate --layers api,application
365
+ ```
366
+
367
+ Note: `--layers` filters which layer elements are reported in errors, but the full model is still loaded for reference validation.
368
+
369
+ ### Validation Reports
370
+
371
+ Generate machine-readable reports using `--output`:
372
+
373
+ ```
374
+ User: /dr-validate --report
375
+
376
+ You: Generating comprehensive validation report...
377
+
378
+ dr validate --output validation-report.json
379
+
380
+ ✓ Report saved to: validation-report.json
381
+
382
+ Summary:
383
+ - Total elements: 45
384
+ - Validated: 45
385
+ - Errors: 0
386
+ - Warnings: 3
387
+
388
+ Report includes:
389
+ - Element-by-element validation status
390
+ - Cross-layer reference validation
391
+ - Semantic rule results
392
+ - Recommendations
393
+
394
+ View report: cat validation-report.json | jq
395
+ ```
396
+
397
+ **IMPORTANT**: Use `--output <file.json>` for machine-readable output, NOT shell redirection. Shell redirection (`>`) captures ANSI-colored console output, not clean JSON.
398
+
399
+ **JSON output schema** (from `--output report.json`):
400
+
401
+ ```json
402
+ {
403
+ "valid": true,
404
+ "summary": {
405
+ "totalElements": 285,
406
+ "totalRelationships": 445,
407
+ "errorCount": 0,
408
+ "warningCount": 3,
409
+ "orphanedCount": 0,
410
+ "layersValidated": 12
411
+ },
412
+ "layerStats": {
413
+ "motivation": 20,
414
+ "business": 17,
415
+ "application": 54
416
+ },
417
+ "relationshipsByPredicate": {
418
+ "realizes": 84,
419
+ "serves": 34,
420
+ "depends-on": 43
421
+ },
422
+ "orphanedElements": [],
423
+ "errors": [
424
+ {
425
+ "layer": "api",
426
+ "elementId": "api.operation.create-order",
427
+ "message": "Element 'api.operation.create-order': At /name: missing required property 'name'",
428
+ "location": "/name",
429
+ "fixSuggestion": "Add required field: name"
430
+ }
431
+ ],
432
+ "warnings": [
433
+ {
434
+ "layer": "business",
435
+ "elementId": "business.service.orders",
436
+ "message": "Element 'business.service.orders' has no source reference",
437
+ "category": "source-reference",
438
+ "fixSuggestion": "Add a source_reference with provenance to link this element to its implementation"
439
+ }
440
+ ]
441
+ }
442
+ ```
443
+
444
+ > `errorCount` and `warningCount` are nested under `summary`, not top-level fields. Access them as `report.summary.errorCount`.
445
+
446
+ **Note on `location` field**: The `location` field contains an AJV `instancePath` (e.g., `/attributes/criticality`), not a file path. To locate the element's YAML file, use the `elementId` with `dr show <elementId>`.
447
+
448
+ ## Validation Rules Reference
449
+
450
+ ### Semantic Rules (11 rules)
451
+
452
+ 1. **Security Controls**: Critical services must have security policies
453
+ 2. **Critical Services Monitored**: Critical services need APM metrics
454
+ 3. **Public APIs Authenticated**: Public APIs need auth schemes
455
+ 4. **Personal Data Encrypted**: PII data needs encryption
456
+ 5. **Business Processes Have Owners**: Processes need owners
457
+ 6. **Goals Have KPIs**: Goals need measurable metrics
458
+ 7. **Requirements Traced**: Requirements link to implementation
459
+ 8. **Services Deployed**: App services reference infrastructure
460
+ 9. **APIs Rate Limited**: Public APIs should have rate limits
461
+ 10. **Data Has Backup**: Critical data needs backup policies
462
+ 11. **UX Accessibility**: UX meets WCAG standards
463
+
464
+ ### Common Validation Errors
465
+
466
+ **Broken Reference**:
467
+
468
+ ```
469
+ Error: business.service.orders references motivation.goal.missing
470
+ Fix: Create goal or remove reference
471
+ ```
472
+
473
+ **Invalid ID Format**:
474
+
475
+ ```
476
+ Error: Invalid ID: business.service.Order_Management
477
+ Fix: Use kebab-case: business.service.order-management
478
+ ```
479
+
480
+ **Missing Required Field**:
481
+
482
+ ```
483
+ Error: Element missing required field 'name'
484
+ Fix: Add name field to element
485
+ ```
486
+
487
+ **Circular Reference**:
488
+
489
+ ```
490
+ Error: Circular reference detected: A → B → C → A
491
+ Fix: Break the cycle by removing one reference
492
+ ```
493
+
494
+ ## Error Handling
495
+
496
+ ### Error: Model not found
497
+
498
+ ```
499
+ Error: No DR model found in current directory
500
+
501
+ Fix: Initialize a model first:
502
+ /dr-init <project-name>
503
+ ```
504
+
505
+ ### Error: Validation failed to run
506
+
507
+ ```
508
+ Error: Validation command failed
509
+
510
+ Troubleshooting:
511
+ 1. Check model structure: ls -la documentation-robotics/model/
512
+ 2. Check manifest: cat documentation-robotics/model/manifest.yaml
513
+ 3. Verify DR installation: dr --version
514
+ 4. Check logs: cat .dr/logs/dr.log
515
+ ```
516
+
517
+ ## Example Interactions
518
+
519
+ ### Example 1: Clean Validation
520
+
521
+ ```
522
+ User: /dr-validate
523
+
524
+ You: Running model validation...
525
+
526
+ dr validate
527
+
528
+ ✓ Validation passed!
529
+
530
+ Model health: Excellent
531
+ - 45 elements validated
532
+ - 0 errors
533
+ - 0 warnings
534
+ - All references valid
535
+ - Full traceability
536
+
537
+ Your model is production-ready!
538
+ ```
539
+
540
+ ### Example 2: With Fixes
541
+
542
+ ```
543
+ User: /dr-validate --strict
544
+
545
+ You: Running validation with auto-fix...
546
+
547
+ dr validate --strict
548
+
549
+ Found 5 issues (3 safe to fix):
550
+
551
+ Auto-fixing:
552
+ ✓ Added description to business.service.orders
553
+ ✓ Fixed ID: business.service.order-mgmt → order-management
554
+ ✓ Added missing documentation reference
555
+
556
+ Require review (2):
557
+ 1. application.service.payment-api needs security policy
558
+ → Suggest: /dr-model Add OAuth2 authentication
559
+
560
+ 2. business.service.checkout needs goal reference
561
+ → Which goal? (run: dr list motivation goal)
562
+
563
+ Re-validating...
564
+ ✓ Fixed 3 issues, 2 remain
565
+ ```
566
+
567
+ ### Example 3: Detailed Analysis
568
+
569
+ ```
570
+ User: /dr-validate --strict
571
+
572
+ You: Running comprehensive validation...
573
+
574
+ dr validate --strict
575
+
576
+ Validation Summary:
577
+ ❌ 2 errors (must fix)
578
+ ⚠️ 4 warnings (should fix)
579
+ ℹ️ 3 info (suggestions)
580
+
581
+ [Detailed breakdown with suggestions]
582
+
583
+ Pattern Analysis:
584
+ 🔍 All critical services missing monitoring
585
+ → Quick fix: /dr-model Add APM metrics to critical services
586
+
587
+ Would you like me to:
588
+ 1. Fix errors automatically (where safe)
589
+ 2. Show detailed fix commands for each issue
590
+ 3. Create a fix plan for batch processing
591
+ ```
592
+
593
+ ## Relationship Quality Audit
594
+
595
+ Beyond schema and reference validation, use `dr audit` to measure **intra-layer relationship coverage** — whether node types are connected to each other in a meaningful way.
596
+
597
+ ### When to Run an Audit
598
+
599
+ Run `dr audit` after:
600
+
601
+ - Adding many elements to a layer without explicit relationships
602
+ - Completing a major extraction session
603
+ - When the user asks about model completeness or coverage
604
+
605
+ ### Audit Commands
606
+
607
+ ```bash
608
+ # Full model audit (all layers)
609
+ dr audit
610
+
611
+ # Layer-specific audit
612
+ dr audit <layer-name>
613
+
614
+ # Generate detailed markdown report (--threshold is not a supported flag)
615
+
616
+ # Generate detailed markdown report
617
+ dr audit --format markdown --output audit-report.md
618
+
619
+ # JSON output for programmatic use
620
+ dr audit --format json --output audit.json
621
+ ```
622
+
623
+ ### Quality Thresholds
624
+
625
+ | Metric | Target | Description |
626
+ | -------------------- | ------ | ---------------------------------------------- |
627
+ | Isolation | ≤ 20% | % of node types with no relationships |
628
+ | Density | ≥ 1.5 | Average relationships per node type |
629
+ | High-Priority Gaps | ≤ 10 | Missing high-value relationships |
630
+ | Duplicate Candidates | ≤ 5 | Semantically redundant relationship candidates |
631
+
632
+ ### Audit + Validate Workflow
633
+
634
+ ```bash
635
+ # Step 1: Schema and reference validation
636
+ dr validate --strict
637
+
638
+ # Step 2: Relationship quality audit
639
+ dr audit <layer-name>
640
+
641
+ # Step 3: Review and address gaps
642
+ # [Add relationships based on audit recommendations]
643
+
644
+ # Step 4: Re-validate
645
+ dr validate
646
+ ```
647
+
648
+ ## Related Commands
649
+
650
+ - `/dr-init` - Initialize new model
651
+ - `/dr-model` - Add/update elements
652
+ - `/dr-project` - Cross-layer projection
653
+ - `dr validate --help` - CLI validation options
654
+ - `dr audit --help` - Relationship audit options