@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,903 @@
1
+ ---
2
+ title: End-to-End DR Workflow Walkthrough
3
+ description: Complete manual walkthrough from fresh project through architecture model extraction, analyzer setup, and verification
4
+ ---
5
+
6
+ # End-to-End Documentation Robotics Workflow
7
+
8
+ This guide walks through the complete Documentation Robotics (DR) workflow: from initializing a fresh project through extracting an architecture model, setting up code analysis, and verifying alignment between your codebase and the generated model.
9
+
10
+ **Estimated time:** 10-20 minutes (depending on codebase size)
11
+
12
+ ---
13
+
14
+ ## The Complete Workflow Overview
15
+
16
+ ```
17
+ ┌─────────────────────────────────────────────────────────────────┐
18
+ │ START: Fresh Project (or existing codebase) │
19
+ └────────────────────┬────────────────────────────────────────────┘
20
+ │
21
+ ▼
22
+ ┌────────────────────────────┐
23
+ │ 1. Initialize DR Model │
24
+ │ dr init <project-name> │
25
+ └────────────┬───────────────┘
26
+ │
27
+ ▼
28
+ ┌────────────────────────────────────────────┐
29
+ │ 2. Choose Your Workflow Path │
30
+ └────────────┬───────────────────────────────┘
31
+ │
32
+ ┌────────────┴────────────┐
33
+ │ │
34
+ ▼ ▼
35
+ ┌─────────────┐ ┌──────────────────────┐
36
+ │ Option A │ │ Option B │
37
+ │ (w/ Analyzer) │ (Skip Analyzer) │
38
+ │ │ │ │
39
+ │ dr analyzer │ │ Skip to Step 3 │
40
+ │ discover │ │ │
41
+ │ dr analyzer │ │ • Faster setup │
42
+ │ index │ │ • Manual control │
43
+ │ │ │ │
44
+ │ • Enables │ │ • No /dr-verify │
45
+ │ /dr-verify │ until added later │
46
+ └────────────┬┘ └──────────────┬───────┘
47
+ │ │
48
+ └───────────┬───────────┘
49
+ │
50
+ ▼
51
+ ┌─────────────────────────────────────────────────────┐
52
+ │ 3. Extract Architecture Model from Codebase │
53
+ │ /dr-map <path> [--layers] [--tech] │
54
+ │ • Consumes pre-briefs from analyzer (if present) │
55
+ │ • Creates elements with source provenance │
56
+ │ • Wires cross-layer references │
57
+ │ • Validates extracted model │
58
+ └────────────┬────────────────────────────────────────┘
59
+ │
60
+ ▼
61
+ ┌─────────────────────────────────────────────────────┐
62
+ │ 4. Verify Model (if analyzer available) │
63
+ │ /dr-verify [--layer <layer>] │
64
+ │ • Reports matched elements ✓ │
65
+ │ • Shows suspected gaps (graph-only) ⚠ │
66
+ │ • Identifies possible drift (model-only) ? │
67
+ │ • Generates actionable reports │
68
+ └────────────┬────────────────────────────────────────┘
69
+ │
70
+ ▼
71
+ ┌─────────────────────────────────────────────────────┐
72
+ │ 5. User Reconciliation & Refinement │
73
+ │ • Add missing operations from gaps │
74
+ │ • Remove or update drifted elements │
75
+ │ • Establish additional relationships │
76
+ │ • Validate final model │
77
+ └────────────┬────────────────────────────────────────┘
78
+ │
79
+ ▼
80
+ ┌────────────────────────────┐
81
+ │ COMPLETE: Model Ready │
82
+ │ Ready for use/export │
83
+ └────────────────────────────┘
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Step 1: Initialize a DR Model
89
+
90
+ **What this does:** Creates a new Documentation Robotics model for your project.
91
+
92
+ **Command:**
93
+
94
+ ```bash
95
+ dr init <project-name>
96
+ ```
97
+
98
+ **Example:**
99
+
100
+ ```bash
101
+ dr init my-awesome-api
102
+ ```
103
+
104
+ **Output:**
105
+
106
+ ```
107
+ ✓ Model initialized: my-awesome-api
108
+ ```
109
+
110
+ **What was created:**
111
+
112
+ - `documentation-robotics/model/manifest.yaml` — Project metadata
113
+ - `documentation-robotics/model/{NN}_{layer-name}/` — Empty layer directories for all 12 layers (e.g., `01_motivation/`, `02_business/`, ..., `12_testing/`)
114
+ - `.dr/` — Local DR configuration directory
115
+
116
+ (Use `--verbose` to see additional details about the model setup)
117
+
118
+ ---
119
+
120
+ ## Step 2: Choose Your Workflow Path
121
+
122
+ At this point, you have two options for how to proceed:
123
+
124
+ ### Option A: With Code Analyzer (Recommended for Verification)
125
+
126
+ If you want to verify extracted elements against your codebase, set up an analyzer and index your code:
127
+
128
+ #### Discover Available Analyzers
129
+
130
+ **What this does:** Shows available code analyzers that can scan your codebase and build a code graph for verification.
131
+
132
+ **Command:**
133
+
134
+ ```bash
135
+ dr analyzer discover
136
+ ```
137
+
138
+ **Output:**
139
+
140
+ ```
141
+ Available Code Analyzers
142
+ ========================
143
+
144
+ 1. codebase-memory (Recommended)
145
+ Type: Graph-based code analyzer
146
+ Coverage: Python, TypeScript, JavaScript, Java, Go
147
+ Install: codebase-memory-mcp
148
+
149
+ Builds a semantic graph of your codebase:
150
+ • Identifies all endpoints/routes
151
+ • Maps service dependencies
152
+ • Detects data store schemas
153
+ • Provides pre-briefs for extraction
154
+
155
+ Install this analyzer?
156
+ [y] Yes, install codebase-memory-mcp
157
+ [n] Skip (you can add it later)
158
+ ```
159
+
160
+ **Select your analyzer:**
161
+
162
+ - **Recommended:** `codebase-memory` for most projects
163
+ - Other options may be available for specific tech stacks
164
+
165
+ If you select [y], the analyzer is installed and ready.
166
+
167
+ #### Index Your Codebase
168
+
169
+ **What this does:** Scans your codebase and builds an indexed code graph for later verification.
170
+
171
+ **Command:**
172
+
173
+ ```bash
174
+ dr analyzer index
175
+ ```
176
+
177
+ **Output:**
178
+
179
+ ```
180
+ Indexing codebase...
181
+
182
+ Scanning files:
183
+ ✓ 245 files scanned
184
+ ✓ 8 layers detected
185
+ ✓ 45 endpoints identified
186
+ ✓ 12 services mapped
187
+ ✓ 35 data models indexed
188
+
189
+ Building graph:
190
+ ✓ 892 nodes created
191
+ ✓ 1,247 edges created
192
+
193
+ Index complete and fresh.
194
+ Endpoints summary: /tmp/dr-analyzer-endpoints.json
195
+ Services summary: /tmp/dr-analyzer-services.json
196
+ Datastores summary: /tmp/dr-analyzer-datastores.json
197
+
198
+ Ready for extraction with /dr-map
199
+ ```
200
+
201
+ **What happens:**
202
+
203
+ - Your codebase is scanned for architectural elements (endpoints, services, data models)
204
+ - Pre-briefs are generated — summaries that `/dr-map` will consume during extraction
205
+ - The index is saved locally; you can verify freshness before running `/dr-verify`
206
+
207
+ **Then proceed to Step 3** with the analyzer installed. This enables `/dr-verify` for gap and drift detection.
208
+
209
+ ---
210
+
211
+ ### Option B: Without Code Analyzer (Faster, Manual-First Approach)
212
+
213
+ If you prefer to build your model without code analysis, **skip the analyzer setup entirely** and go straight to Step 3:
214
+
215
+ ```bash
216
+ # Skip dr analyzer discover and dr analyzer index
217
+ # Go directly to Step 3: /dr-map
218
+ ```
219
+
220
+ **When to use this path:**
221
+
222
+ - You prefer to manually define your architecture model
223
+ - Your codebase is small and doesn't need systematic verification
224
+ - You want to iterate quickly without indexing overhead
225
+ - You'll add an analyzer later if needed
226
+
227
+ **Tradeoffs:**
228
+
229
+ - ❌ You won't have `/dr-verify` until you add an analyzer later
230
+ - ❌ No automated gap/drift detection
231
+ - ✅ Faster initial setup (no indexing wait)
232
+ - ✅ Full manual control over model creation
233
+
234
+ **Adding an analyzer later:**
235
+
236
+ If you decide later that you want verification capabilities, you can add an analyzer at any time:
237
+
238
+ ```bash
239
+ dr analyzer discover # Install analyzer
240
+ dr analyzer index # Index your code
241
+ /dr-verify # Now verification is available
242
+ ```
243
+
244
+ ---
245
+
246
+ ## Step 3: Extract Architecture Model with `/dr-map`
247
+
248
+ **What this does:** Analyzes your codebase and automatically generates DR model elements across the relevant layers. Uses pre-briefs from the analyzer if available.
249
+
250
+ ### 3a: Start the Extraction
251
+
252
+ **Command:**
253
+
254
+ ```bash
255
+ /dr-map <path> [--layers <layers>] [--tech <technology>]
256
+ ```
257
+
258
+ **Examples:**
259
+
260
+ **Simple extraction (infers layers):**
261
+
262
+ ```bash
263
+ /dr-map ./src
264
+ ```
265
+
266
+ **Specific layers only:**
267
+
268
+ ```bash
269
+ /dr-map ./src --layers application,api,data-model
270
+ ```
271
+
272
+ **With technology hints:**
273
+
274
+ ```bash
275
+ /dr-map ./backend --tech "Python FastAPI PostgreSQL"
276
+ ```
277
+
278
+ ### 3b: Choose Extraction Mode
279
+
280
+ If your model is empty, you'll be asked which mode to use:
281
+
282
+ ```
283
+ I see this is a new model with no existing elements.
284
+
285
+ I can extract in two ways:
286
+
287
+ 1. Recipe Mode (recommended)
288
+ Walks through all 12 layers in the correct architectural order,
289
+ with checkpoints to review and validate each layer before proceeding.
290
+ Takes longer but produces a complete, well-structured model.
291
+
292
+ 2. Targeted Mode
293
+ Extract specific layers only.
294
+
295
+ Which would you prefer?
296
+ [r] Recipe Mode
297
+ [t] Targeted Mode
298
+ ```
299
+
300
+ **Recommendation:** Choose **Recipe Mode** for a comprehensive first extraction. It ensures infrastructure and data layers are populated before business and motivation layers are inferred.
301
+
302
+ ### 3c: Preliminary Analysis
303
+
304
+ The extraction performs a quick scan before starting:
305
+
306
+ ```
307
+ Preliminary scan of ./src:
308
+
309
+ Detected:
310
+ ✓ Language: Python (45 .py files)
311
+ ✓ Framework: FastAPI (found fastapi imports)
312
+ ✓ API: 8 route files detected
313
+ ✓ Database: SQLAlchemy models found (12 files)
314
+ ✓ Tests: pytest structure detected
315
+
316
+ Detected Analyzer (Status):
317
+ ✓ Analyzer: codebase-memory (installed and indexed)
318
+ → Endpoints summary available
319
+ → Services summary available
320
+ → Datastores summary available
321
+ → Extraction will cross-reference these for high-confidence mappings
322
+
323
+ Estimated extraction:
324
+ - Business services: ~5
325
+ - Application services: ~8
326
+ - API operations: ~35
327
+ - Data models: ~12
328
+
329
+ This will take approximately 2-3 minutes.
330
+ Proceed with extraction?
331
+ [y] Yes, proceed
332
+ [n] Cancel
333
+ ```
334
+
335
+ ### 3d: Recipe Mode Layer-by-Layer Extraction
336
+
337
+ If you selected Recipe Mode, you'll see checkpoints after each layer:
338
+
339
+ **Layer 1: Technology**
340
+
341
+ ```
342
+ Checkpoint: Technology Layer Complete
343
+ =========================================
344
+ Extracted 3 elements:
345
+ - technology.platform.fastapi
346
+ - technology.platform.postgresql
347
+ - technology.framework.sqlalchemy
348
+
349
+ Validation: ✓ Passed (all elements valid)
350
+
351
+ What would you like to do?
352
+ [c] Continue to next layer (Data Store)
353
+ [a] Add a missing element
354
+ [s] Skip to a specific layer
355
+ [r] Re-extract this layer
356
+ [q] Finish here
357
+ ```
358
+
359
+ **Between-layer wiring:**
360
+ After each layer, the system wires relationships to elements in already-populated lower layers:
361
+
362
+ ```
363
+ Wiring cross-layer references...
364
+ ✓ 8 realizes references (application → business)
365
+ ✓ 35 exposes references (api → application)
366
+ ✓ 12 stores references (data-store → data-model)
367
+ ```
368
+
369
+ ### 3e: Extraction Complete
370
+
371
+ After all layers (or when you finish):
372
+
373
+ ```
374
+ Recipe Extraction Complete!
375
+ =============================
376
+
377
+ Layers:
378
+ ✓ Layer 5 (Technology): 3 elements
379
+ ✓ Layer 8 (Data Store): 8 elements
380
+ ✓ Layer 7 (Data Model): 12 elements
381
+ ✓ Layer 4 (Application): 8 elements
382
+ ✓ Layer 6 (API): 35 elements
383
+ ✓ Layer 9 (UX): 0 elements (no frontend detected)
384
+ ✓ Layer 2 (Business): 5 elements (inferred)
385
+ ✓ Layer 3 (Security): 2 elements (inferred)
386
+ ✓ Layer 1 (Motivation): 1 element (inferred)
387
+
388
+ Total: 74 elements across 9 layers
389
+
390
+ Final validation: ✓ Passed
391
+
392
+ Connectivity:
393
+ dr validate --orphans
394
+ This shows elements still needing relationships, grouped by layer
395
+ Orphans remaining after /dr-map are best handled by running
396
+ /dr-relate --orphans rather than a full /dr-relate pass.
397
+
398
+ Next steps:
399
+ - Review element quality: /dr-model
400
+ - Verify against code: /dr-verify
401
+ - Establish relationships: /dr-relate
402
+ ```
403
+
404
+ ### 3f: Source Provenance
405
+
406
+ All extracted elements include **source provenance**:
407
+
408
+ - `source_file` — The file the element was extracted from
409
+ - `source_symbol` — The specific class, function, or symbol
410
+ - `source_provenance` — How the element was identified (extracted or inferred)
411
+
412
+ This traceability is critical for:
413
+
414
+ - `/dr-sync` — Detecting drift when code changes
415
+ - `dr validate` — Verifying referenced files still exist
416
+ - Reconciliation — Linking model elements back to their code origins
417
+
418
+ **Example element with provenance:**
419
+
420
+ ```bash
421
+ dr show api.operation.create-order
422
+ ```
423
+
424
+ ```
425
+ Element: api.operation.create-order
426
+ Description: POST /api/v1/orders
427
+ Layer: API (Layer 6)
428
+
429
+ Source Reference:
430
+ File: src/routes/orders.ts
431
+ Symbol: createOrder
432
+ Provenance: extracted
433
+ Lines: 45-60
434
+ ```
435
+
436
+ ---
437
+
438
+ ## Step 4: Verify Model Against Code with `/dr-verify`
439
+
440
+ **⚠️ This step only applies if you chose Option A (with Code Analyzer) in Step 2.** If you chose Option B (no analyzer), skip to Step 5 or refer to [Adding an analyzer later](#option-b-without-code-analyzer-faster-manual-first-approach) for instructions on adding verification capability.
441
+
442
+ **What this does:** Cross-references your extracted model against the code analyzer's index and reports on alignment. Shows what's matched, what's missing (gaps), and what's out of sync (drift).
443
+
444
+ ### 4a: Run Verification
445
+
446
+ **Command:**
447
+
448
+ ```bash
449
+ /dr-verify [--layer <layer>]
450
+ ```
451
+
452
+ **Check analyzer status first:**
453
+
454
+ ```bash
455
+ dr analyzer status
456
+ ```
457
+
458
+ ```
459
+ Analyzer Status
460
+ ===============
461
+ Analyzer: codebase-memory
462
+ Status: installed and indexed
463
+ Index freshness: fresh (updated 2 minutes ago)
464
+ Ready for verification.
465
+ ```
466
+
467
+ **Run verification:**
468
+
469
+ ```bash
470
+ /dr-verify --layer api
471
+ ```
472
+
473
+ ### 4b: Verification Results
474
+
475
+ **Summary:**
476
+
477
+ ```
478
+ Verified 45 graph routes against 40 model operations.
479
+ 35 matched, 8 graph-only (suspected gaps), 2 model-only (possible drift).
480
+
481
+ Verifying against base model (no active changeset).
482
+ ```
483
+
484
+ **Where:**
485
+
486
+ - **Matched (35)** — Routes found in code AND in your model ✓
487
+ - **Graph-only (8)** — Routes found in code but NOT in model (suspected gaps) ⚠
488
+ - **Model-only (2)** — Operations in model but NOT in code (possible drift) ?
489
+
490
+ ### 4c: Matched Elements
491
+
492
+ ```
493
+ Matched Operations (35):
494
+ ========================
495
+ ✓ api.operation.create-order (POST /api/v1/orders)
496
+ Source: src/routes/orders.ts:createOrder
497
+
498
+ ✓ api.operation.get-order (GET /api/v1/orders/{id})
499
+ Source: src/routes/orders.ts:getOrder
500
+
501
+ ✓ api.operation.update-order (PUT /api/v1/orders/{id})
502
+ Source: src/routes/orders.ts:updateOrder
503
+
504
+ [... and 32 more matched operations ...]
505
+ ```
506
+
507
+ **These are good!** Your model has correct coverage for these elements.
508
+
509
+ ### 4d: Graph-Only Entries (Suspected Gaps)
510
+
511
+ ```
512
+ Graph-Only Routes (8 suspected gaps):
513
+ ======================================
514
+ ⚠ POST /api/v1/orders/bulk-create
515
+ Source: src/routes/orders.ts:bulkCreate
516
+
517
+ Add this operation to the model?
518
+ [a] Add with command
519
+ [i] Ignore (not a public operation)
520
+ [s] Skip
521
+ ```
522
+
523
+ **Process gaps:**
524
+
525
+ **Option 1: Add to Model**
526
+
527
+ - Select [a]
528
+ - A pre-populated `dr add` command is generated with all source info from the analyzer:
529
+
530
+ ```bash
531
+ dr add api operation "bulk-create-orders" \
532
+ --description "POST /api/v1/orders/bulk-create" \
533
+ --source-file "src/routes/orders.ts" \
534
+ --source-symbol "bulkCreate" \
535
+ --source-provenance extracted
536
+ ```
537
+
538
+ - Command is executed and element is added
539
+
540
+ **Option 2: Ignore**
541
+
542
+ - Select [i]
543
+ - Provide a reason: "Internal utility, not user-facing"
544
+ - Entry is added to `.dr-verify-ignore.yaml` for future reference
545
+
546
+ ```yaml
547
+ version: 1
548
+ ignore:
549
+ - patterns:
550
+ - path: "/api/v1/orders/bulk-create"
551
+ reason: "Internal utility, not user-facing"
552
+ match: "graph_only"
553
+ ```
554
+
555
+ **Option 3: Skip**
556
+
557
+ - Select [s]
558
+ - Move to next gap, decide later
559
+
560
+ ### 4e: Model-Only Entries (Possible Drift)
561
+
562
+ ```
563
+ Model-Only Operations (2):
564
+ ==========================
565
+ ? api.operation.legacy-endpoint
566
+ Description: GET /api/v1/legacy/old-endpoint
567
+ Source: src/legacy/endpoints.ts:oldEndpoint
568
+
569
+ Possible reasons:
570
+ - Code was refactored or removed
571
+ - Route handler is in a file the analyzer didn't scan
572
+ - Confidence threshold filtered it out
573
+
574
+ Options:
575
+ [s] Show element details
576
+ [q] Query analyzer for pattern
577
+ [r] Remove from model
578
+ [u] Update element
579
+ [i] Ignore (still valid but not found)
580
+ [n] Next entry
581
+ ```
582
+
583
+ **Process drift:**
584
+
585
+ **Option 1: Show Details** ([s])
586
+
587
+ - Display full element information from the model
588
+ - Helps you decide if it's truly obsolete
589
+
590
+ **Option 2: Query Analyzer** ([q])
591
+
592
+ - Search the code graph for related patterns
593
+ - "Are there any routes similar to this?"
594
+ - If found, maybe the naming changed in code
595
+
596
+ **Option 3: Remove** ([r])
597
+
598
+ - Delete from model if confirmed obsolete
599
+ - `dr delete api.operation.legacy-endpoint`
600
+ - Clean up outdated elements
601
+
602
+ **Option 4: Update** ([u])
603
+
604
+ - Modify the element if it's still valid but renamed
605
+ - Update description, source file, etc.
606
+
607
+ **Option 5: Ignore** ([i])
608
+
609
+ - Keep it in the model but note that analyzer didn't find it
610
+ - Useful for deprecated endpoints you're tracking
611
+
612
+ ### 4f: Verification Complete
613
+
614
+ ```
615
+ Verification Complete
616
+ =====================
617
+
618
+ Summary:
619
+ ✓ 35 matched (operations aligned)
620
+ ⚠ 8 graph-only (add to model)
621
+ ? 2 model-only (review or remove)
622
+
623
+ Changeset Context:
624
+ Verifying against base model (no active changeset)
625
+
626
+ Next Steps:
627
+
628
+ 1. Review added operations:
629
+ /dr-validate --strict
630
+
631
+ 2. View detailed report:
632
+ /dr-verify --output verify.json
633
+
634
+ 3. Full recursive extraction (systematic):
635
+ /dr-relate --orphans
636
+
637
+ 4. Sync team:
638
+ /dr-changeset preview
639
+ ```
640
+
641
+ ---
642
+
643
+ ## Step 5: User Reconciliation & Refinement
644
+
645
+ ### 5a: Address Gaps
646
+
647
+ **For each suspected gap from `/dr-verify`:**
648
+
649
+ 1. **Understand the gap** — Why wasn't this operation extracted initially?
650
+ - Low confidence? Hidden in less-obvious code pattern?
651
+ - Newer code added after `/dr-map` ran?
652
+ - Multi-file route registration?
653
+
654
+ 2. **Add to model** (if confirmed valid)
655
+
656
+ ```bash
657
+ dr add api operation "bulk-create-orders" \
658
+ --description "POST /api/v1/orders/bulk-create" \
659
+ --source-file "src/routes/orders.ts" \
660
+ --source-symbol "bulkCreate"
661
+ ```
662
+
663
+ 3. **Add to ignore list** (if confirmed not user-facing)
664
+
665
+ ```bash
666
+ echo "- path: /api/v1/internal/debug
667
+ reason: Internal debug endpoint
668
+ match: graph_only" >> .dr-verify-ignore.yaml
669
+ ```
670
+
671
+ ### 5b: Address Drift
672
+
673
+ **For each model-only entry from `/dr-verify`:**
674
+
675
+ 1. **Investigate** — Is the code still there?
676
+
677
+ ```bash
678
+ dr analyzer query "MATCH (n) WHERE n.name CONTAINS 'oldEndpoint' RETURN n"
679
+ ```
680
+
681
+ 2. **Remove** (if code no longer exists)
682
+
683
+ ```bash
684
+ dr delete api.operation.legacy-endpoint
685
+ ```
686
+
687
+ 3. **Update** (if code was refactored)
688
+
689
+ ```bash
690
+ dr update api.operation.legacy-endpoint \
691
+ --source-file "src/routes/new-location.ts" \
692
+ --source-symbol "newName"
693
+ ```
694
+
695
+ 4. **Keep** (if it's intentionally deprecated but tracked)
696
+ - Add to ignore list for future verification runs
697
+
698
+ ### 5c: Establish Relationships
699
+
700
+ **If you extracted the model but `/dr-map` didn't fully wire relationships:**
701
+
702
+ ```bash
703
+ /dr-relate --orphans
704
+ ```
705
+
706
+ This systematically establishes intra-layer and cross-layer relationships for elements that are still disconnected.
707
+
708
+ ### 5d: Final Validation
709
+
710
+ **Run strict validation:**
711
+
712
+ ```bash
713
+ dr validate --strict
714
+ ```
715
+
716
+ ```
717
+ Validation Results
718
+ ==================
719
+
720
+ ✓ Schema validation passed (all elements valid)
721
+ ✓ Reference validation passed (all cross-layer references exist)
722
+ ⚠ 2 semantic warnings:
723
+
724
+ 1. api.operation.create-order
725
+ Warning: No security policy assigned
726
+ Recommendation: Add authentication via /dr-design
727
+
728
+ 2. application.service.payment-service
729
+ Warning: Critical service not monitored
730
+ Recommendation: Add APM metrics via /dr-model
731
+ ```
732
+
733
+ ---
734
+
735
+ ## Complete Example: Start to Finish
736
+
737
+ ### Scenario: Extracting a Python FastAPI backend
738
+
739
+ ```bash
740
+ # Step 1: Initialize model
741
+ dr init order-service
742
+
743
+ # Step 2: Setup analyzer
744
+ dr analyzer discover # Select codebase-memory
745
+ dr analyzer index # Index the codebase (~2 minutes)
746
+
747
+ # Step 3: Extract architecture
748
+ /dr-map ./src --tech "Python FastAPI PostgreSQL"
749
+
750
+ # At prompt: Select Recipe Mode
751
+ # Work through all 12 layers, validating at each checkpoint
752
+ # Take ~5-10 minutes to complete
753
+
754
+ # Step 4: Verify alignment
755
+ /dr-verify --layer api
756
+
757
+ # Process results:
758
+ # - Add 3 graph-only operations (pre-populated commands provided)
759
+ # - Review and remove 1 model-only drift item
760
+ # - Keep 2 operations in ignore list
761
+
762
+ # Step 5: Final check
763
+ dr validate --strict
764
+
765
+ # All done!
766
+ ✓ Model extracted and verified
767
+ ✓ 74 elements across 9 layers
768
+ ✓ 98% analyzer alignment
769
+ ✓ Ready for team use
770
+ ```
771
+
772
+ **Time to completion: ~20 minutes** (mostly spent at Recipe Mode checkpoints reviewing layer extractions)
773
+
774
+ ---
775
+
776
+ ## Key Concepts
777
+
778
+ ### Pre-Briefs from Analyzer
779
+
780
+ When `/dr-map` runs and an analyzer is indexed:
781
+
782
+ - **Endpoints pre-brief** — All discovered routes/endpoints
783
+ - Treated as authoritative checklist for API layer
784
+ - Each candidate must be extracted or explicitly rejected
785
+
786
+ - **Services pre-brief** — Suggested application services
787
+ - Used as hints; rely on code inspection as primary signal
788
+
789
+ - **Datastores pre-brief** — Database schemas and tables
790
+ - Suggestions only; verify against actual code
791
+
792
+ ### Source Provenance
793
+
794
+ Every extracted element includes:
795
+
796
+ - **source_file** — Where the element came from (relative to repo root)
797
+ - **source_symbol** — The specific class/function/symbol name
798
+ - **source_provenance** — "extracted" (from code) or "inferred" (from patterns)
799
+
800
+ This is **mandatory** for traceability. Without it:
801
+
802
+ - `/dr-sync` can't detect drift
803
+ - `dr validate` can't verify file existence
804
+ - Model becomes a snapshot with no connection to source code
805
+
806
+ ### Three-Bucket Verification
807
+
808
+ `/dr-verify` always reports three buckets:
809
+
810
+ ```
811
+ Graph-only ⚠ ← Routes in code but not in model (gaps to fill)
812
+ Matched ✓ ← Routes in code AND in model (good alignment)
813
+ Model-only ? ← Operations in model but not in code (drift to fix)
814
+ ```
815
+
816
+ The goal: Maximize matched, minimize gaps and drift.
817
+
818
+ ---
819
+
820
+ ## Troubleshooting
821
+
822
+ ### "No analyzer installed"
823
+
824
+ ```bash
825
+ dr analyzer discover # Install one first
826
+ dr analyzer index # Then index your codebase
827
+ /dr-verify # Then verify
828
+ ```
829
+
830
+ ### "Index is stale"
831
+
832
+ ```bash
833
+ dr analyzer status # Check freshness
834
+ dr analyzer index # Reindex if stale
835
+ /dr-verify # Reverify
836
+ ```
837
+
838
+ ### "Verification found many gaps"
839
+
840
+ ```bash
841
+ /dr-map ./src --layers api # Re-extract API layer specifically
842
+ /dr-verify --layer api # Reverify just that layer
843
+ ```
844
+
845
+ ### "Model validation errors"
846
+
847
+ ```bash
848
+ dr validate --strict # See all errors
849
+ /dr-model # Manually fix issues
850
+ dr validate --strict # Revalidate
851
+ ```
852
+
853
+ ---
854
+
855
+ ## Related Commands
856
+
857
+ - **Initialize:** `/dr-init <project-name>` — Create new model
858
+ - **Extract:** `/dr-map <path>` — Extract from codebase
859
+ - **Verify:** `/dr-verify` — Cross-reference against analyzer
860
+ - **Validate:** `dr validate` — Validate model integrity
861
+ - **Enhance:** `/dr-model` — Manually add/adjust elements
862
+ - **Relate:** `/dr-relate` — Wire relationships
863
+ - **Sync:** `/dr-sync` — Update when code changes
864
+ - **Search:** `dr search` — Query extracted elements
865
+ - **Show:** `dr show <element-id>` — Inspect element details
866
+
867
+ ---
868
+
869
+ ## Next Steps After Extraction
870
+
871
+ Once your model is extracted and verified:
872
+
873
+ 1. **Document Business Goals**
874
+ - `/dr-model Add motivation layer goals`
875
+
876
+ 2. **Add Security Policies**
877
+ - `/dr-model Add authentication to public endpoints`
878
+
879
+ 3. **Establish Monitoring**
880
+ - `/dr-model Add APM metrics to critical services`
881
+
882
+ 4. **Create Changesets**
883
+ - `/dr-changeset Create changeset for new feature`
884
+
885
+ 5. **Export for Stakeholders**
886
+ - `dr export archimate` — Export to ArchiMate format
887
+ - `dr export openapi` — Export API documentation
888
+ - `dr export markdown` — Generate markdown docs
889
+
890
+ ---
891
+
892
+ ## Summary
893
+
894
+ The end-to-end workflow:
895
+
896
+ 1. **Initialize** — Create fresh model
897
+ 2. **Analyze** — Setup and index code analyzer
898
+ 3. **Extract** — Run `/dr-map` to automatically build model from code
899
+ 4. **Verify** — Run `/dr-verify` to cross-reference against code
900
+ 5. **Reconcile** — Address gaps and drift discovered during verification
901
+ 6. **Validate** — Confirm final model integrity and completeness
902
+
903
+ **Result:** A complete, verified, traceable architecture model ready for team use, exports, and ongoing synchronization.