ai-spector 0.9.21 → 0.9.24

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 (579) hide show
  1. package/contracts/bootstrap/config/prototype-screen-map.json +25 -0
  2. package/contracts/bootstrap/config/prototype.config.json +17 -0
  3. package/contracts/bootstrap/config/review-queue-pending.json +4 -0
  4. package/contracts/bootstrap/config/review-queue-registry.json +4 -0
  5. package/contracts/bootstrap/config/review.config.json +5 -0
  6. package/contracts/bootstrap/docs/ENTITY_REGISTRY_MIGRATION.md +192 -0
  7. package/contracts/bootstrap/docs/MIGRATION.md +463 -0
  8. package/contracts/bootstrap/docs/README.md +48 -0
  9. package/contracts/bootstrap/docs/adapters/README.md +32 -0
  10. package/contracts/bootstrap/docs/guides/COMMENTS_ENTITY_MIGRATION.md +195 -0
  11. package/contracts/bootstrap/docs/guides/DOCOPS_MANUAL_FALLBACK.md +177 -0
  12. package/contracts/bootstrap/docs/guides/PROJECT_LAYOUT.md +84 -0
  13. package/contracts/bootstrap/docs/modules/comments.md +77 -0
  14. package/contracts/bootstrap/docs/modules/generate.md +25 -0
  15. package/contracts/bootstrap/docs/modules/graph.md +31 -0
  16. package/contracts/bootstrap/docs/modules/prototype.md +26 -0
  17. package/contracts/bootstrap/docs/modules/review.md +25 -0
  18. package/contracts/bootstrap/docs/modules/translate.md +26 -0
  19. package/contracts/bootstrap/scripts/migrate-entity-registry.sh +55 -0
  20. package/contracts/bootstrap/templates/basic-design/db-design-template.md +177 -0
  21. package/contracts/bootstrap/templates/basic-design/detail-api-template.md +278 -0
  22. package/contracts/bootstrap/templates/basic-design/detail-screen-template.md +281 -0
  23. package/contracts/bootstrap/templates/basic-design/list-api-template.md +130 -0
  24. package/contracts/bootstrap/templates/basic-design/list-screen-template.md +242 -0
  25. package/contracts/bootstrap/templates/detail-design/common/architecture-overview-template.md +302 -0
  26. package/contracts/bootstrap/templates/detail-design/common/deployment-infrastructure-template.md +461 -0
  27. package/contracts/bootstrap/templates/detail-design/common/error-handling-patterns-template.md +460 -0
  28. package/contracts/bootstrap/templates/detail-design/common/integration-patterns-template.md +410 -0
  29. package/contracts/bootstrap/templates/detail-design/common/performance-standards-template.md +406 -0
  30. package/contracts/bootstrap/templates/detail-design/common/security-patterns-template.md +395 -0
  31. package/contracts/bootstrap/templates/detail-design/feature-detail-design-template.md +773 -0
  32. package/contracts/bootstrap/templates/detail-design/feature-list-template.md +39 -0
  33. package/contracts/bootstrap/templates/srs/1-introduction.md +58 -0
  34. package/contracts/bootstrap/templates/srs/2-overall-description.md +91 -0
  35. package/contracts/bootstrap/templates/srs/3-use-case-detail-template.md +142 -0
  36. package/contracts/bootstrap/templates/srs/3-use-cases.md +53 -0
  37. package/contracts/bootstrap/templates/srs/4-system-feature-detail-template.md +131 -0
  38. package/contracts/bootstrap/templates/srs/4-system-features-list-template.md +39 -0
  39. package/contracts/bootstrap/templates/srs/5-data-requirements.md +59 -0
  40. package/contracts/bootstrap/templates/srs/6-external-interfaces.md +56 -0
  41. package/contracts/bootstrap/templates/srs/7-quality-attributes.md +74 -0
  42. package/contracts/bootstrap/templates/srs/8-internationalization.md +36 -0
  43. package/contracts/bootstrap/templates/srs/9-other-requirements.md +46 -0
  44. package/contracts/examples/full-docops.config.json +54 -0
  45. package/contracts/examples/migrate-lifecycle.json +18 -0
  46. package/contracts/examples/minimal-comment-thread/comment-root.json +10 -0
  47. package/contracts/examples/minimal-comment-thread/meta_data.json +22 -0
  48. package/contracts/examples/minimal-docops.config.json +33 -0
  49. package/contracts/examples/minimal-lifecycle.json +17 -0
  50. package/contracts/examples/minimal-prototype.config.json +18 -0
  51. package/contracts/examples/minimal-screen-map.json +25 -0
  52. package/contracts/examples/registry/minimal-document.entity.json +15 -0
  53. package/contracts/examples/registry/minimal-manifest.json +7 -0
  54. package/contracts/examples/registry/minimal-screen.entity.json +11 -0
  55. package/contracts/examples/review/minimal-pending.json +14 -0
  56. package/contracts/examples/review/minimal-registry.json +31 -0
  57. package/contracts/examples/review/minimal-review.config.json +7 -0
  58. package/contracts/schemas/comments/comment_body.schema.json +19 -0
  59. package/contracts/schemas/comments/meta_data.schema.json +59 -0
  60. package/contracts/schemas/docops.config.schema.json +97 -0
  61. package/contracts/schemas/lifecycle.schema.json +43 -0
  62. package/contracts/schemas/prototype/config.schema.json +56 -0
  63. package/contracts/schemas/prototype/screen-map.schema.json +51 -0
  64. package/contracts/schemas/registry/document.entity.schema.json +38 -0
  65. package/contracts/schemas/registry/manifest.schema.json +18 -0
  66. package/contracts/schemas/registry/screen.entity.schema.json +28 -0
  67. package/contracts/schemas/review/registry.schema.json +72 -0
  68. package/contracts/schemas/review/review.config.schema.json +42 -0
  69. package/dist/cli.js +26 -1
  70. package/dist/cli.js.map +1 -1
  71. package/dist/core/docops/bootstrap.d.ts +4 -1
  72. package/dist/core/docops/bootstrap.d.ts.map +1 -1
  73. package/dist/core/docops/bootstrap.js +16 -9
  74. package/dist/core/docops/bootstrap.js.map +1 -1
  75. package/dist/core/docops/guide.d.ts +78 -0
  76. package/dist/core/docops/guide.d.ts.map +1 -0
  77. package/dist/core/docops/guide.js +554 -0
  78. package/dist/core/docops/guide.js.map +1 -0
  79. package/dist/core/docops/migrate.d.ts.map +1 -1
  80. package/dist/core/docops/migrate.js +40 -6
  81. package/dist/core/docops/migrate.js.map +1 -1
  82. package/dist/core/graph/doc-extract.d.ts.map +1 -1
  83. package/dist/core/graph/doc-extract.js +12 -0
  84. package/dist/core/graph/doc-extract.js.map +1 -1
  85. package/dist/core/graph/impact.d.ts.map +1 -1
  86. package/dist/core/graph/impact.js +2 -1
  87. package/dist/core/graph/impact.js.map +1 -1
  88. package/dist/core/graph/link-testcases.d.ts +14 -0
  89. package/dist/core/graph/link-testcases.d.ts.map +1 -0
  90. package/dist/core/graph/link-testcases.js +46 -0
  91. package/dist/core/graph/link-testcases.js.map +1 -0
  92. package/dist/core/operations/docops.d.ts +8 -0
  93. package/dist/core/operations/docops.d.ts.map +1 -1
  94. package/dist/core/operations/docops.js +40 -0
  95. package/dist/core/operations/docops.js.map +1 -1
  96. package/dist/core/operations/index.d.ts.map +1 -1
  97. package/dist/core/operations/index.js +25 -0
  98. package/dist/core/operations/index.js.map +1 -1
  99. package/dist/core/operations/task-gates.d.ts +8 -1
  100. package/dist/core/operations/task-gates.d.ts.map +1 -1
  101. package/dist/core/operations/task-gates.js +14 -0
  102. package/dist/core/operations/task-gates.js.map +1 -1
  103. package/dist/core/operations/task.d.ts +2 -0
  104. package/dist/core/operations/task.d.ts.map +1 -1
  105. package/dist/core/operations/task.js +40 -2
  106. package/dist/core/operations/task.js.map +1 -1
  107. package/dist/core/sync/audit.d.ts.map +1 -1
  108. package/dist/core/sync/audit.js +14 -6
  109. package/dist/core/sync/audit.js.map +1 -1
  110. package/dist/core/sync/baseline.d.ts.map +1 -1
  111. package/dist/core/sync/baseline.js +5 -2
  112. package/dist/core/sync/baseline.js.map +1 -1
  113. package/dist/core/sync/constants.d.ts.map +1 -1
  114. package/dist/core/sync/constants.js +2 -1
  115. package/dist/core/sync/constants.js.map +1 -1
  116. package/dist/core/sync/gaps.d.ts.map +1 -1
  117. package/dist/core/sync/gaps.js +23 -2
  118. package/dist/core/sync/gaps.js.map +1 -1
  119. package/dist/core/sync/git-diff.d.ts +1 -0
  120. package/dist/core/sync/git-diff.d.ts.map +1 -1
  121. package/dist/core/sync/git-diff.js +14 -0
  122. package/dist/core/sync/git-diff.js.map +1 -1
  123. package/dist/core/sync/repo-context.d.ts +23 -0
  124. package/dist/core/sync/repo-context.d.ts.map +1 -0
  125. package/dist/core/sync/repo-context.js +28 -0
  126. package/dist/core/sync/repo-context.js.map +1 -0
  127. package/dist/core/sync/snapshot.d.ts.map +1 -1
  128. package/dist/core/sync/snapshot.js +24 -18
  129. package/dist/core/sync/snapshot.js.map +1 -1
  130. package/dist/core/sync/types.d.ts +7 -2
  131. package/dist/core/sync/types.d.ts.map +1 -1
  132. package/dist/core/upgrade/checklist.json +2 -2
  133. package/dist/interfaces/mcp/schemas.d.ts +2 -0
  134. package/dist/interfaces/mcp/schemas.d.ts.map +1 -1
  135. package/dist/interfaces/mcp/schemas.js +4 -0
  136. package/dist/interfaces/mcp/schemas.js.map +1 -1
  137. package/dist/interfaces/mcp/server.js +0 -0
  138. package/dist/types.d.ts +2 -2
  139. package/dist/types.d.ts.map +1 -1
  140. package/package.json +2 -1
  141. package/scaffold/claude/.claude/skills/_skill-router.md +11 -8
  142. package/scaffold/claude/.claude/skills/ai-spector/references/cli-failures.md +3 -3
  143. package/scaffold/claude/.claude/skills/ai-spector/references/docops-migrate.md +112 -0
  144. package/scaffold/claude/.claude/skills/ai-spector/references/help.md +1 -1
  145. package/scaffold/claude/.claude/skills/ai-spector/references/runbook.md +49 -26
  146. package/scaffold/claude/.claude/skills/ai-spector/skill.md +3 -2
  147. package/scaffold/cursor/skills/_skill-router.md +11 -8
  148. package/scaffold/cursor/skills/ai-spector/SKILL.md +3 -2
  149. package/scaffold/cursor/skills/ai-spector/references/cli-failures.md +3 -3
  150. package/scaffold/cursor/skills/ai-spector/references/docops-migrate.md +112 -0
  151. package/scaffold/cursor/skills/ai-spector/references/help.md +1 -1
  152. package/scaffold/cursor/skills/ai-spector/references/runbook.md +49 -26
  153. package/schemas/rules.impact.json +3 -2
  154. package/schemas/schema.graph.json +4 -2
  155. package/dist/commands/analyze.d.ts +0 -12
  156. package/dist/commands/analyze.d.ts.map +0 -1
  157. package/dist/commands/analyze.js +0 -53
  158. package/dist/commands/analyze.js.map +0 -1
  159. package/dist/commands/bootstrap.d.ts +0 -4
  160. package/dist/commands/bootstrap.d.ts.map +0 -1
  161. package/dist/commands/bootstrap.js +0 -58
  162. package/dist/commands/bootstrap.js.map +0 -1
  163. package/dist/commands/comments.d.ts +0 -44
  164. package/dist/commands/comments.d.ts.map +0 -1
  165. package/dist/commands/comments.js +0 -79
  166. package/dist/commands/comments.js.map +0 -1
  167. package/dist/commands/graph-impact.d.ts +0 -28
  168. package/dist/commands/graph-impact.d.ts.map +0 -1
  169. package/dist/commands/graph-impact.js +0 -174
  170. package/dist/commands/graph-impact.js.map +0 -1
  171. package/dist/commands/graph-merge.d.ts +0 -32
  172. package/dist/commands/graph-merge.d.ts.map +0 -1
  173. package/dist/commands/graph-merge.js +0 -101
  174. package/dist/commands/graph-merge.js.map +0 -1
  175. package/dist/commands/graph-query.d.ts +0 -10
  176. package/dist/commands/graph-query.d.ts.map +0 -1
  177. package/dist/commands/graph-query.js +0 -24
  178. package/dist/commands/graph-query.js.map +0 -1
  179. package/dist/commands/graph-report.d.ts +0 -9
  180. package/dist/commands/graph-report.d.ts.map +0 -1
  181. package/dist/commands/graph-report.js +0 -10
  182. package/dist/commands/graph-report.js.map +0 -1
  183. package/dist/commands/graph-visualize.d.ts +0 -17
  184. package/dist/commands/graph-visualize.d.ts.map +0 -1
  185. package/dist/commands/graph-visualize.js +0 -44
  186. package/dist/commands/graph-visualize.js.map +0 -1
  187. package/dist/commands/hooks-constants.d.ts +0 -2
  188. package/dist/commands/hooks-constants.d.ts.map +0 -1
  189. package/dist/commands/hooks-constants.js +0 -2
  190. package/dist/commands/hooks-constants.js.map +0 -1
  191. package/dist/commands/hooks.d.ts +0 -28
  192. package/dist/commands/hooks.d.ts.map +0 -1
  193. package/dist/commands/hooks.js +0 -187
  194. package/dist/commands/hooks.js.map +0 -1
  195. package/dist/commands/index.d.ts +0 -22
  196. package/dist/commands/index.d.ts.map +0 -1
  197. package/dist/commands/index.js +0 -472
  198. package/dist/commands/index.js.map +0 -1
  199. package/dist/commands/init.d.ts +0 -19
  200. package/dist/commands/init.d.ts.map +0 -1
  201. package/dist/commands/init.js +0 -210
  202. package/dist/commands/init.js.map +0 -1
  203. package/dist/commands/lang-queue.d.ts +0 -28
  204. package/dist/commands/lang-queue.d.ts.map +0 -1
  205. package/dist/commands/lang-queue.js +0 -49
  206. package/dist/commands/lang-queue.js.map +0 -1
  207. package/dist/commands/lang.d.ts +0 -16
  208. package/dist/commands/lang.d.ts.map +0 -1
  209. package/dist/commands/lang.js +0 -69
  210. package/dist/commands/lang.js.map +0 -1
  211. package/dist/commands/prototype.d.ts +0 -66
  212. package/dist/commands/prototype.d.ts.map +0 -1
  213. package/dist/commands/prototype.js +0 -370
  214. package/dist/commands/prototype.js.map +0 -1
  215. package/dist/commands/setup.d.ts +0 -26
  216. package/dist/commands/setup.d.ts.map +0 -1
  217. package/dist/commands/setup.js +0 -259
  218. package/dist/commands/setup.js.map +0 -1
  219. package/dist/commands/sync-cursor.d.ts +0 -10
  220. package/dist/commands/sync-cursor.d.ts.map +0 -1
  221. package/dist/commands/sync-cursor.js +0 -18
  222. package/dist/commands/sync-cursor.js.map +0 -1
  223. package/dist/commands/template-regen.d.ts +0 -24
  224. package/dist/commands/template-regen.d.ts.map +0 -1
  225. package/dist/commands/template-regen.js +0 -240
  226. package/dist/commands/template-regen.js.map +0 -1
  227. package/dist/commands/template.d.ts +0 -3
  228. package/dist/commands/template.d.ts.map +0 -1
  229. package/dist/commands/template.js +0 -1285
  230. package/dist/commands/template.js.map +0 -1
  231. package/dist/commands/validate.d.ts +0 -10
  232. package/dist/commands/validate.d.ts.map +0 -1
  233. package/dist/commands/validate.js +0 -89
  234. package/dist/commands/validate.js.map +0 -1
  235. package/dist/comments/anchor.d.ts +0 -16
  236. package/dist/comments/anchor.d.ts.map +0 -1
  237. package/dist/comments/anchor.js +0 -59
  238. package/dist/comments/anchor.js.map +0 -1
  239. package/dist/comments/inbox.d.ts +0 -82
  240. package/dist/comments/inbox.d.ts.map +0 -1
  241. package/dist/comments/inbox.js +0 -179
  242. package/dist/comments/inbox.js.map +0 -1
  243. package/dist/comments/paths.d.ts +0 -12
  244. package/dist/comments/paths.d.ts.map +0 -1
  245. package/dist/comments/paths.js +0 -54
  246. package/dist/comments/paths.js.map +0 -1
  247. package/dist/comments/plan.d.ts +0 -20
  248. package/dist/comments/plan.d.ts.map +0 -1
  249. package/dist/comments/plan.js +0 -62
  250. package/dist/comments/plan.js.map +0 -1
  251. package/dist/comments/storage.d.ts +0 -30
  252. package/dist/comments/storage.d.ts.map +0 -1
  253. package/dist/comments/storage.js +0 -272
  254. package/dist/comments/storage.js.map +0 -1
  255. package/dist/comments/types.d.ts +0 -54
  256. package/dist/comments/types.d.ts.map +0 -1
  257. package/dist/comments/types.js +0 -2
  258. package/dist/comments/types.js.map +0 -1
  259. package/dist/config/load.d.ts +0 -47
  260. package/dist/config/load.d.ts.map +0 -1
  261. package/dist/config/load.js +0 -148
  262. package/dist/config/load.js.map +0 -1
  263. package/dist/config/types.d.ts +0 -56
  264. package/dist/config/types.d.ts.map +0 -1
  265. package/dist/config/types.js +0 -2
  266. package/dist/config/types.js.map +0 -1
  267. package/dist/core/adopt/apply.d.ts +0 -15
  268. package/dist/core/adopt/apply.d.ts.map +0 -1
  269. package/dist/core/adopt/apply.js +0 -127
  270. package/dist/core/adopt/apply.js.map +0 -1
  271. package/dist/core/adopt/bootstrap.d.ts +0 -16
  272. package/dist/core/adopt/bootstrap.d.ts.map +0 -1
  273. package/dist/core/adopt/bootstrap.js +0 -195
  274. package/dist/core/adopt/bootstrap.js.map +0 -1
  275. package/dist/core/adopt/classify.d.ts +0 -22
  276. package/dist/core/adopt/classify.d.ts.map +0 -1
  277. package/dist/core/adopt/classify.js +0 -295
  278. package/dist/core/adopt/classify.js.map +0 -1
  279. package/dist/core/adopt/paths.d.ts +0 -10
  280. package/dist/core/adopt/paths.d.ts.map +0 -1
  281. package/dist/core/adopt/paths.js +0 -16
  282. package/dist/core/adopt/paths.js.map +0 -1
  283. package/dist/core/adopt/plan.d.ts +0 -10
  284. package/dist/core/adopt/plan.d.ts.map +0 -1
  285. package/dist/core/adopt/plan.js +0 -269
  286. package/dist/core/adopt/plan.js.map +0 -1
  287. package/dist/core/adopt/scan.d.ts +0 -5
  288. package/dist/core/adopt/scan.d.ts.map +0 -1
  289. package/dist/core/adopt/scan.js +0 -169
  290. package/dist/core/adopt/scan.js.map +0 -1
  291. package/dist/core/adopt/setup.d.ts +0 -7
  292. package/dist/core/adopt/setup.d.ts.map +0 -1
  293. package/dist/core/adopt/setup.js +0 -64
  294. package/dist/core/adopt/setup.js.map +0 -1
  295. package/dist/core/adopt/tasks.d.ts +0 -9
  296. package/dist/core/adopt/tasks.d.ts.map +0 -1
  297. package/dist/core/adopt/tasks.js +0 -153
  298. package/dist/core/adopt/tasks.js.map +0 -1
  299. package/dist/core/adopt/types.d.ts +0 -75
  300. package/dist/core/adopt/types.d.ts.map +0 -1
  301. package/dist/core/adopt/types.js +0 -2
  302. package/dist/core/adopt/types.js.map +0 -1
  303. package/dist/core/adopt/validate.d.ts +0 -20
  304. package/dist/core/adopt/validate.d.ts.map +0 -1
  305. package/dist/core/adopt/validate.js +0 -129
  306. package/dist/core/adopt/validate.js.map +0 -1
  307. package/dist/core/docops/dual-write.d.ts +0 -12
  308. package/dist/core/docops/dual-write.d.ts.map +0 -1
  309. package/dist/core/docops/dual-write.js +0 -44
  310. package/dist/core/docops/dual-write.js.map +0 -1
  311. package/dist/core/engine/local-adapter.d.ts +0 -3
  312. package/dist/core/engine/local-adapter.d.ts.map +0 -1
  313. package/dist/core/engine/local-adapter.js +0 -18
  314. package/dist/core/engine/local-adapter.js.map +0 -1
  315. package/dist/core/graph/rules/default-impact.json +0 -24
  316. package/dist/core/operations/adopt-gates.d.ts +0 -19
  317. package/dist/core/operations/adopt-gates.d.ts.map +0 -1
  318. package/dist/core/operations/adopt-gates.js +0 -71
  319. package/dist/core/operations/adopt-gates.js.map +0 -1
  320. package/dist/core/operations/adopt-plan.d.ts +0 -15
  321. package/dist/core/operations/adopt-plan.d.ts.map +0 -1
  322. package/dist/core/operations/adopt-plan.js +0 -24
  323. package/dist/core/operations/adopt-plan.js.map +0 -1
  324. package/dist/core/operations/adopt.d.ts +0 -11
  325. package/dist/core/operations/adopt.d.ts.map +0 -1
  326. package/dist/core/operations/adopt.js +0 -150
  327. package/dist/core/operations/adopt.js.map +0 -1
  328. package/dist/core/operations/analyze.d.ts +0 -12
  329. package/dist/core/operations/analyze.d.ts.map +0 -1
  330. package/dist/core/operations/analyze.js +0 -53
  331. package/dist/core/operations/analyze.js.map +0 -1
  332. package/dist/core/prototype/spa-route-fallbacks.d.ts +0 -21
  333. package/dist/core/prototype/spa-route-fallbacks.d.ts.map +0 -1
  334. package/dist/core/prototype/spa-route-fallbacks.js +0 -93
  335. package/dist/core/prototype/spa-route-fallbacks.js.map +0 -1
  336. package/dist/graph/InMemoryGraph.d.ts +0 -2
  337. package/dist/graph/InMemoryGraph.d.ts.map +0 -1
  338. package/dist/graph/InMemoryGraph.js +0 -2
  339. package/dist/graph/InMemoryGraph.js.map +0 -1
  340. package/dist/graph/bundles.d.ts +0 -32
  341. package/dist/graph/bundles.d.ts.map +0 -1
  342. package/dist/graph/bundles.js +0 -109
  343. package/dist/graph/bundles.js.map +0 -1
  344. package/dist/graph/defaults.d.ts +0 -23
  345. package/dist/graph/defaults.d.ts.map +0 -1
  346. package/dist/graph/defaults.js +0 -25
  347. package/dist/graph/defaults.js.map +0 -1
  348. package/dist/graph/detail-sections.d.ts +0 -28
  349. package/dist/graph/detail-sections.d.ts.map +0 -1
  350. package/dist/graph/detail-sections.js +0 -220
  351. package/dist/graph/detail-sections.js.map +0 -1
  352. package/dist/graph/doc-extract.d.ts +0 -84
  353. package/dist/graph/doc-extract.d.ts.map +0 -1
  354. package/dist/graph/doc-extract.js +0 -821
  355. package/dist/graph/doc-extract.js.map +0 -1
  356. package/dist/graph/impact.d.ts +0 -5
  357. package/dist/graph/impact.d.ts.map +0 -1
  358. package/dist/graph/impact.js +0 -7
  359. package/dist/graph/impact.js.map +0 -1
  360. package/dist/graph/knowledge.d.ts +0 -11
  361. package/dist/graph/knowledge.d.ts.map +0 -1
  362. package/dist/graph/knowledge.js +0 -62
  363. package/dist/graph/knowledge.js.map +0 -1
  364. package/dist/graph/layer-audit.d.ts +0 -5
  365. package/dist/graph/layer-audit.d.ts.map +0 -1
  366. package/dist/graph/layer-audit.js +0 -29
  367. package/dist/graph/layer-audit.js.map +0 -1
  368. package/dist/graph/load.d.ts +0 -4
  369. package/dist/graph/load.d.ts.map +0 -1
  370. package/dist/graph/load.js +0 -12
  371. package/dist/graph/load.js.map +0 -1
  372. package/dist/graph/loadGraph.d.ts +0 -3
  373. package/dist/graph/loadGraph.d.ts.map +0 -1
  374. package/dist/graph/loadGraph.js +0 -7
  375. package/dist/graph/loadGraph.js.map +0 -1
  376. package/dist/graph/merge.d.ts +0 -27
  377. package/dist/graph/merge.d.ts.map +0 -1
  378. package/dist/graph/merge.js +0 -239
  379. package/dist/graph/merge.js.map +0 -1
  380. package/dist/graph/path-target-edges.d.ts +0 -2
  381. package/dist/graph/path-target-edges.d.ts.map +0 -1
  382. package/dist/graph/path-target-edges.js +0 -2
  383. package/dist/graph/path-target-edges.js.map +0 -1
  384. package/dist/graph/provenance.d.ts +0 -19
  385. package/dist/graph/provenance.d.ts.map +0 -1
  386. package/dist/graph/provenance.js +0 -199
  387. package/dist/graph/provenance.js.map +0 -1
  388. package/dist/graph/query.d.ts +0 -3
  389. package/dist/graph/query.d.ts.map +0 -1
  390. package/dist/graph/query.js +0 -2
  391. package/dist/graph/query.js.map +0 -1
  392. package/dist/graph/resolve.d.ts +0 -15
  393. package/dist/graph/resolve.d.ts.map +0 -1
  394. package/dist/graph/resolve.js +0 -117
  395. package/dist/graph/resolve.js.map +0 -1
  396. package/dist/graph/source-refs.d.ts +0 -2
  397. package/dist/graph/source-refs.d.ts.map +0 -1
  398. package/dist/graph/source-refs.js +0 -30
  399. package/dist/graph/source-refs.js.map +0 -1
  400. package/dist/graph/translation.d.ts +0 -14
  401. package/dist/graph/translation.d.ts.map +0 -1
  402. package/dist/graph/translation.js +0 -65
  403. package/dist/graph/translation.js.map +0 -1
  404. package/dist/index/doc-semantics.d.ts +0 -14
  405. package/dist/index/doc-semantics.d.ts.map +0 -1
  406. package/dist/index/doc-semantics.js +0 -101
  407. package/dist/index/doc-semantics.js.map +0 -1
  408. package/dist/index/docs-build.d.ts +0 -40
  409. package/dist/index/docs-build.d.ts.map +0 -1
  410. package/dist/index/docs-build.js +0 -136
  411. package/dist/index/docs-build.js.map +0 -1
  412. package/dist/index/docs-config.d.ts +0 -19
  413. package/dist/index/docs-config.d.ts.map +0 -1
  414. package/dist/index/docs-config.js +0 -5
  415. package/dist/index/docs-config.js.map +0 -1
  416. package/dist/interfaces/cli/format/adopt.d.ts +0 -23
  417. package/dist/interfaces/cli/format/adopt.d.ts.map +0 -1
  418. package/dist/interfaces/cli/format/adopt.js +0 -89
  419. package/dist/interfaces/cli/format/adopt.js.map +0 -1
  420. package/dist/interfaces/mcp/tools/adopt.d.ts +0 -22
  421. package/dist/interfaces/mcp/tools/adopt.d.ts.map +0 -1
  422. package/dist/interfaces/mcp/tools/adopt.js +0 -55
  423. package/dist/interfaces/mcp/tools/adopt.js.map +0 -1
  424. package/dist/lang/diff.d.ts +0 -12
  425. package/dist/lang/diff.d.ts.map +0 -1
  426. package/dist/lang/diff.js +0 -71
  427. package/dist/lang/diff.js.map +0 -1
  428. package/dist/lang/paths.d.ts +0 -16
  429. package/dist/lang/paths.d.ts.map +0 -1
  430. package/dist/lang/paths.js +0 -32
  431. package/dist/lang/paths.js.map +0 -1
  432. package/dist/lang/queue-layout.d.ts +0 -11
  433. package/dist/lang/queue-layout.d.ts.map +0 -1
  434. package/dist/lang/queue-layout.js +0 -56
  435. package/dist/lang/queue-layout.js.map +0 -1
  436. package/dist/lang/queue-store.d.ts +0 -23
  437. package/dist/lang/queue-store.d.ts.map +0 -1
  438. package/dist/lang/queue-store.js +0 -285
  439. package/dist/lang/queue-store.js.map +0 -1
  440. package/dist/lang/queue-types.d.ts +0 -122
  441. package/dist/lang/queue-types.d.ts.map +0 -1
  442. package/dist/lang/queue-types.js +0 -2
  443. package/dist/lang/queue-types.js.map +0 -1
  444. package/dist/lang/queue.d.ts +0 -17
  445. package/dist/lang/queue.d.ts.map +0 -1
  446. package/dist/lang/queue.js +0 -362
  447. package/dist/lang/queue.js.map +0 -1
  448. package/dist/lang/sections.d.ts +0 -26
  449. package/dist/lang/sections.d.ts.map +0 -1
  450. package/dist/lang/sections.js +0 -85
  451. package/dist/lang/sections.js.map +0 -1
  452. package/dist/markdown/parse.d.ts +0 -25
  453. package/dist/markdown/parse.d.ts.map +0 -1
  454. package/dist/markdown/parse.js +0 -100
  455. package/dist/markdown/parse.js.map +0 -1
  456. package/dist/prototype/build-base-path.d.ts +0 -11
  457. package/dist/prototype/build-base-path.d.ts.map +0 -1
  458. package/dist/prototype/build-base-path.js +0 -84
  459. package/dist/prototype/build-base-path.js.map +0 -1
  460. package/dist/prototype/build-manifest.d.ts +0 -21
  461. package/dist/prototype/build-manifest.d.ts.map +0 -1
  462. package/dist/prototype/build-manifest.js +0 -171
  463. package/dist/prototype/build-manifest.js.map +0 -1
  464. package/dist/prototype/config.d.ts +0 -21
  465. package/dist/prototype/config.d.ts.map +0 -1
  466. package/dist/prototype/config.js +0 -131
  467. package/dist/prototype/config.js.map +0 -1
  468. package/dist/prototype/deploy-path.d.ts +0 -9
  469. package/dist/prototype/deploy-path.d.ts.map +0 -1
  470. package/dist/prototype/deploy-path.js +0 -21
  471. package/dist/prototype/deploy-path.js.map +0 -1
  472. package/dist/prototype/htpasswd.d.ts +0 -8
  473. package/dist/prototype/htpasswd.d.ts.map +0 -1
  474. package/dist/prototype/htpasswd.js +0 -36
  475. package/dist/prototype/htpasswd.js.map +0 -1
  476. package/dist/prototype/nginx-config.d.ts +0 -16
  477. package/dist/prototype/nginx-config.d.ts.map +0 -1
  478. package/dist/prototype/nginx-config.js +0 -39
  479. package/dist/prototype/nginx-config.js.map +0 -1
  480. package/dist/prototype/parse-screen-index.d.ts +0 -10
  481. package/dist/prototype/parse-screen-index.d.ts.map +0 -1
  482. package/dist/prototype/parse-screen-index.js +0 -109
  483. package/dist/prototype/parse-screen-index.js.map +0 -1
  484. package/dist/prototype/preview-uri.d.ts +0 -8
  485. package/dist/prototype/preview-uri.d.ts.map +0 -1
  486. package/dist/prototype/preview-uri.js +0 -35
  487. package/dist/prototype/preview-uri.js.map +0 -1
  488. package/dist/prototype/relative-assets.d.ts +0 -9
  489. package/dist/prototype/relative-assets.d.ts.map +0 -1
  490. package/dist/prototype/relative-assets.js +0 -23
  491. package/dist/prototype/relative-assets.js.map +0 -1
  492. package/dist/prototype/resolve-default-screen.d.ts +0 -17
  493. package/dist/prototype/resolve-default-screen.d.ts.map +0 -1
  494. package/dist/prototype/resolve-default-screen.js +0 -31
  495. package/dist/prototype/resolve-default-screen.js.map +0 -1
  496. package/dist/prototype/rewrite-build-assets.d.ts +0 -8
  497. package/dist/prototype/rewrite-build-assets.d.ts.map +0 -1
  498. package/dist/prototype/rewrite-build-assets.js +0 -40
  499. package/dist/prototype/rewrite-build-assets.js.map +0 -1
  500. package/dist/prototype/route-defaults.d.ts +0 -43
  501. package/dist/prototype/route-defaults.d.ts.map +0 -1
  502. package/dist/prototype/route-defaults.js +0 -50
  503. package/dist/prototype/route-defaults.js.map +0 -1
  504. package/dist/prototype/screen-doc-paths.d.ts +0 -15
  505. package/dist/prototype/screen-doc-paths.d.ts.map +0 -1
  506. package/dist/prototype/screen-doc-paths.js +0 -38
  507. package/dist/prototype/screen-doc-paths.js.map +0 -1
  508. package/dist/prototype/spa-route-fallbacks.d.ts +0 -21
  509. package/dist/prototype/spa-route-fallbacks.d.ts.map +0 -1
  510. package/dist/prototype/spa-route-fallbacks.js +0 -93
  511. package/dist/prototype/spa-route-fallbacks.js.map +0 -1
  512. package/dist/prototype/theme-preview.d.ts +0 -17
  513. package/dist/prototype/theme-preview.d.ts.map +0 -1
  514. package/dist/prototype/theme-preview.js +0 -73
  515. package/dist/prototype/theme-preview.js.map +0 -1
  516. package/dist/prototype/themes.d.ts +0 -6
  517. package/dist/prototype/themes.d.ts.map +0 -1
  518. package/dist/prototype/themes.js +0 -55
  519. package/dist/prototype/themes.js.map +0 -1
  520. package/dist/prototype/types.d.ts +0 -160
  521. package/dist/prototype/types.d.ts.map +0 -1
  522. package/dist/prototype/types.js +0 -2
  523. package/dist/prototype/types.js.map +0 -1
  524. package/dist/prototype/validate.d.ts +0 -16
  525. package/dist/prototype/validate.d.ts.map +0 -1
  526. package/dist/prototype/validate.js +0 -149
  527. package/dist/prototype/validate.js.map +0 -1
  528. package/dist/registry/build.d.ts +0 -5
  529. package/dist/registry/build.d.ts.map +0 -1
  530. package/dist/registry/build.js +0 -71
  531. package/dist/registry/build.js.map +0 -1
  532. package/dist/registry/slug.d.ts +0 -4
  533. package/dist/registry/slug.d.ts.map +0 -1
  534. package/dist/registry/slug.js +0 -16
  535. package/dist/registry/slug.js.map +0 -1
  536. package/dist/registry/structure-patch.d.ts +0 -6
  537. package/dist/registry/structure-patch.d.ts.map +0 -1
  538. package/dist/registry/structure-patch.js +0 -49
  539. package/dist/registry/structure-patch.js.map +0 -1
  540. package/dist/template/scan.d.ts +0 -21
  541. package/dist/template/scan.d.ts.map +0 -1
  542. package/dist/template/scan.js +0 -84
  543. package/dist/template/scan.js.map +0 -1
  544. package/dist/template/validate.d.ts +0 -10
  545. package/dist/template/validate.d.ts.map +0 -1
  546. package/dist/template/validate.js +0 -64
  547. package/dist/template/validate.js.map +0 -1
  548. package/dist/util/fs.d.ts +0 -6
  549. package/dist/util/fs.d.ts.map +0 -1
  550. package/dist/util/fs.js +0 -24
  551. package/dist/util/fs.js.map +0 -1
  552. package/dist/util/git-diff.d.ts +0 -16
  553. package/dist/util/git-diff.d.ts.map +0 -1
  554. package/dist/util/git-diff.js +0 -93
  555. package/dist/util/git-diff.js.map +0 -1
  556. package/dist/util/gitignore.d.ts +0 -9
  557. package/dist/util/gitignore.d.ts.map +0 -1
  558. package/dist/util/gitignore.js +0 -44
  559. package/dist/util/gitignore.js.map +0 -1
  560. package/dist/util/open-browser.d.ts +0 -3
  561. package/dist/util/open-browser.d.ts.map +0 -1
  562. package/dist/util/open-browser.js +0 -24
  563. package/dist/util/open-browser.js.map +0 -1
  564. package/dist/util/paths.d.ts +0 -16
  565. package/dist/util/paths.d.ts.map +0 -1
  566. package/dist/util/paths.js +0 -19
  567. package/dist/util/paths.js.map +0 -1
  568. package/dist/util/prompt.d.ts +0 -14
  569. package/dist/util/prompt.d.ts.map +0 -1
  570. package/dist/util/prompt.js +0 -65
  571. package/dist/util/prompt.js.map +0 -1
  572. package/dist/visualize/html.d.ts +0 -13
  573. package/dist/visualize/html.d.ts.map +0 -1
  574. package/dist/visualize/html.js +0 -766
  575. package/dist/visualize/html.js.map +0 -1
  576. package/dist/visualize/stats.d.ts +0 -8
  577. package/dist/visualize/stats.d.ts.map +0 -1
  578. package/dist/visualize/stats.js +0 -9
  579. package/dist/visualize/stats.js.map +0 -1
@@ -0,0 +1,195 @@
1
+ # Comment storage — legacy path → entity ID migration
2
+
3
+ > **Audience:** Teams with comment threads under path-keyed folders who want stable **entityId** / **screenId** storage.
4
+ > **Full registry migration:** [ENTITY_REGISTRY_MIGRATION.md](../ENTITY_REGISTRY_MIGRATION.md) (comments are step 2b in that runbook).
5
+
6
+ ---
7
+
8
+ ## Layout comparison
9
+
10
+ ### Legacy (path-keyed)
11
+
12
+ Threads are stored by **logical document path** (no `docs/` prefix, `.md` stripped):
13
+
14
+ ```text
15
+ .docops/comments/
16
+ ├── srs/01-overview/
17
+ │ └── {thread_id}/
18
+ │ ├── meta_data.json
19
+ │ ├── events.jsonl
20
+ │ └── {comment_id}
21
+ └── prototype/
22
+ └── src/login.html/
23
+ └── {thread_id}/
24
+ └── …
25
+ ```
26
+
27
+ `meta_data.json` uses `filePath` as the primary key. Renaming or moving a doc in git breaks the folder path unless you manually move threads.
28
+
29
+ ### Entity registry (recommended)
30
+
31
+ Threads are stored by **stable IDs** from `.docops/registry/`:
32
+
33
+ ```text
34
+ .docops/comments/
35
+ ├── documents/
36
+ │ └── {entityId}/ # UUID from registry/documents/{entityId}.json
37
+ │ └── {thread_id}/
38
+ │ └── …
39
+ └── screens/
40
+ └── {screenId}/ # from registry/screens/{screenId}.json
41
+ └── {thread_id}/
42
+ └── …
43
+ ```
44
+
45
+ After migration, `meta_data.json` includes:
46
+
47
+ | Field | Purpose |
48
+ |-------|---------|
49
+ | `targetId` | `entityId` (documents) or `screenId` (prototype) |
50
+ | `commentType` | `"document"` or `"prototype"` |
51
+ | `filePath` | Human-readable path label (anchor + display; not the storage key) |
52
+
53
+ Renaming `docs/srs/01-overview.md` only updates registry JSON — comment threads stay under the same `entityId`.
54
+
55
+ ---
56
+
57
+ ## Prerequisites
58
+
59
+ | Check | Command / path |
60
+ |-------|----------------|
61
+ | Docops contract | `.docops/docops.config.json` with `capabilities.comments: true` |
62
+ | Registry path | `"paths": { "registry": ".docops/registry", "comments": ".docops/comments" }` |
63
+ | Design docs indexed | `docs/` contains SRS/BD/DD markdown |
64
+ | Registry populated | `npx ai-spector docops registry sync` (creates `registry/documents/*.json`) |
65
+
66
+ If `registry/documents/` is empty, **comments migrate will skip every thread** with a warning.
67
+
68
+ ---
69
+
70
+ ## Migration steps
71
+
72
+ Run on **each git branch** that should use entity-keyed comment folders (e.g. `main`, active release branches).
73
+
74
+ ### 1. Preview
75
+
76
+ ```bash
77
+ npx ai-spector docops registry sync --dry-run
78
+ npx ai-spector docops comments migrate --dry-run
79
+ ```
80
+
81
+ Review output:
82
+
83
+ - **registry sync** — which document entities will be created/updated
84
+ - **comments migrate** — lines like `move srs/01-overview/{threadId} → documents/{entityId}/{threadId}`
85
+
86
+ ### 2. Apply registry sync first
87
+
88
+ ```bash
89
+ npx ai-spector docops registry sync
90
+ ```
91
+
92
+ This must run **before** comment migration so each legacy `filePath` resolves to an `entityId`.
93
+
94
+ ### 3. Migrate comment folders
95
+
96
+ ```bash
97
+ npx ai-spector docops comments migrate
98
+ ```
99
+
100
+ For each legacy thread:
101
+
102
+ 1. Resolves `entityId` (documents) or `screenId` (prototype) from registry + `meta_data.json`
103
+ 2. Copies thread folder to `comments/documents/{entityId}/` or `comments/screens/{screenId}/`
104
+ 3. Updates `meta_data.json` with `targetId` and `commentType`
105
+ 4. Removes the legacy folder
106
+
107
+ Safe to re-run: already-migrated threads (under `documents/` or `screens/`) are skipped.
108
+
109
+ ### 4. Verify
110
+
111
+ ```bash
112
+ # List by entity (preferred)
113
+ npx ai-spector comments list --entity <entityId> --json
114
+
115
+ # Prototype
116
+ npx ai-spector comments list --screen-id <screenId> --type prototype --json
117
+
118
+ # Legacy path still works as a filter during deprecation window
119
+ npx ai-spector comments list --file srs/01-overview --json
120
+ ```
121
+
122
+ Confirm in git:
123
+
124
+ ```bash
125
+ ls .docops/comments/documents/
126
+ test ! -d .docops/comments/srs || echo "WARN: legacy srs/ comment tree still present"
127
+ ```
128
+
129
+ ### 5. Commit
130
+
131
+ ```bash
132
+ git add .docops/registry .docops/comments
133
+ git commit -m "chore: migrate comment threads to entityId layout"
134
+ ```
135
+
136
+ ---
137
+
138
+ ## One-shot script
139
+
140
+ From repo root (after `.docops/guide/scripts/` is scaffolded):
141
+
142
+ ```bash
143
+ bash .docops/guide/scripts/migrate-entity-registry.sh --dry-run
144
+ bash .docops/guide/scripts/migrate-entity-registry.sh
145
+ ```
146
+
147
+ Or skip non-comment steps:
148
+
149
+ ```bash
150
+ bash .docops/guide/scripts/migrate-entity-registry.sh --skip-review
151
+ ```
152
+
153
+ ---
154
+
155
+ ## CLI after migration
156
+
157
+ | Action | Legacy filter | Preferred filter |
158
+ |--------|---------------|------------------|
159
+ | List | `--file srs/01-overview` | `--entity <uuid>` |
160
+ | Show | `--file …` | `--entity …` |
161
+ | Create | `--file srs/01-overview` | `--entity <uuid>` |
162
+ | Reply | `--file …` | `--entity …` |
163
+ | Resolve | `--file …` | `--entity …` |
164
+
165
+ Create/reply resolve storage location via registry: when `entityId` is known, threads are written under `comments/documents/{entityId}/` automatically.
166
+
167
+ ---
168
+
169
+ ## Troubleshooting
170
+
171
+ | Symptom | Cause | Fix |
172
+ |---------|-------|-----|
173
+ | `comments migrate` skips all threads | Registry empty or path mismatch | Run `registry sync`; check `logicalPath` in `registry/documents/*.json` matches thread `filePath` |
174
+ | Warning: `No registry target for thread …` | Doc not in registry (wrong path, missing file) | Add/fix markdown under `docs/`; re-run `registry sync` |
175
+ | Destination exists, thread skipped | Duplicate thread id under target | Inspect both folders; merge manually or remove duplicate |
176
+ | Comments visible in CLI but not Writer | Writer `storage_layout` still `legacy` | Project Settings → Docops → `storage_layout: docops` |
177
+ | Thread not found on reply with `--file` | Entity-layout storage (`documents/{entityId}/`) | Use `comments reply <threadId> --body "..."` only, or `--entity <targetId>` from show/list |
178
+
179
+ ---
180
+
181
+ ## Rollback (before push)
182
+
183
+ ```bash
184
+ git checkout -- .docops/comments .docops/registry
185
+ ```
186
+
187
+ Keep a backup branch before migrating production release branches.
188
+
189
+ ---
190
+
191
+ ## Related
192
+
193
+ - [ENTITY_REGISTRY_MIGRATION.md](../ENTITY_REGISTRY_MIGRATION.md) — full registry + review queue migration
194
+ - [modules/comments.md](../modules/comments.md) — comment module overview and CLI create/reply
195
+ - [MIGRATION.md](../MIGRATION.md) — legacy repo-root → `.docops/` contract paths
@@ -0,0 +1,177 @@
1
+ # Docops manual fallback — for agents
2
+
3
+ Use this guide when **`npx ai-spector docops init`**, **`docops migrate`**, or **`docops migrate --repair`** fails (or is unavailable) and the user approves a **bounded workaround** (cli-failures option **2 Workaround** — pause, report, manual gap-fill, verify).
4
+
5
+ **First:** run **`npx ai-spector docops guide --prompt`** — it prints **wrong vs correct** for this repo, a tailored `docops.config.json` example, expected document paths, scaffold checklist, and **bundled bootstrap paths** inside the installed ai-spector package.
6
+
7
+ **Goal:** finish the same work the CLI would do — patch `.docops/docops.config.json`, fill missing scaffold files, copy templates — **without overwriting** anything that already exists.
8
+
9
+ **Related:** [MIGRATION.md](../MIGRATION.md) · [examples/full-docops.config.json](../../../examples/full-docops.config.json)
10
+
11
+ ---
12
+
13
+ ## When to use
14
+
15
+ | Situation | Action |
16
+ |-----------|--------|
17
+ | `command not found` | `npm install ai-spector` then use `npx ai-spector` |
18
+ | `docops bootstrap bundle not found` | Reinstall ai-spector — bundle ships at `node_modules/ai-spector/contracts/bootstrap` |
19
+ | `migrate --repair` exits non-zero mid-run | Fix reported path, then **resume manual steps** for remaining gaps only |
20
+ | Writer **Set up repository** returns 409 (config exists) | Manual gap-fill (this guide), not full init |
21
+
22
+ ## Hard rules (same as MIGRATION)
23
+
24
+ | Rule | Detail |
25
+ |------|--------|
26
+ | **Do not overwrite** | Skip any destination file that already exists |
27
+ | **Repo-root-relative `path`** | `docs/srs`, `docs/basic-design`, `docs/detail-design`, `docs/other` — not bare `srs` |
28
+ | **Optional layers default off** | `detailDesign` and `otherDocument` must appear in config with `"enabled": false` unless the project already enables them |
29
+ | **DD templates always scaffold** | Copy `.docops/templates/detail-design/*.md` even when `detailDesign.enabled` is `false` |
30
+
31
+ ---
32
+
33
+ ## 1. Locate the bootstrap bundle (bundled in ai-spector CLI)
34
+
35
+ The ai-spector npm package is **standalone** — it ships everything under:
36
+
37
+ ```text
38
+ node_modules/ai-spector/contracts/bootstrap/ # templates, config stubs, docs
39
+ node_modules/ai-spector/contracts/schemas/ # JSON schemas
40
+ node_modules/ai-spector/contracts/examples/ # reference configs
41
+ ```
42
+
43
+ `npx ai-spector docops guide --json` prints resolved `targetState.examples.bundle.bootstrapRoot` and `bootstrapCopyMap` for your install.
44
+
45
+ Optional override (rare):
46
+
47
+ ```bash
48
+ export DOCOPS_BOOTSTRAP_ROOT=/path/to/custom/bootstrap
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 2. Patch `.docops/docops.config.json`
54
+
55
+ Read the existing file. **Merge** missing keys only — do not change `enabled` or `path` on layers the project already configured.
56
+
57
+ Prefer the **example from `docops guide --prompt`** for this repo. Reference shape: [examples/full-docops.config.json](../../../examples/full-docops.config.json).
58
+
59
+ ### Required optional doc types (if missing)
60
+
61
+ Add both blocks when absent:
62
+
63
+ ```json
64
+ "detailDesign": {
65
+ "enabled": false,
66
+ "path": "docs/detail-design",
67
+ "label": "Detail Design",
68
+ "templatesPath": ".docops/templates/detail-design"
69
+ },
70
+ "otherDocument": {
71
+ "enabled": false,
72
+ "path": "docs/other",
73
+ "label": "Other Document"
74
+ }
75
+ ```
76
+
77
+ `otherDocument` has **no** `templatesPath` (no cloud generation).
78
+
79
+ ### Path sanity
80
+
81
+ | Key | Default `path` |
82
+ |-----|----------------|
83
+ | `srs` | `docs/srs` |
84
+ | `basicDesign` | `docs/basic-design` |
85
+ | `detailDesign` | `docs/detail-design` |
86
+ | `otherDocument` | `docs/other` |
87
+
88
+ If `docs/other/` or `docs/detail-design/` already exists on disk, keep `enabled: false` in config unless the user explicitly asks to enable the layer.
89
+
90
+ ---
91
+
92
+ ## 3. Copy scaffold files (gap-fill only)
93
+
94
+ Let `BUNDLE` = bootstrap root from §1 (or `docops guide --json` → `bundle.bootstrapRoot`). For each row: **copy only if destination does not exist**.
95
+
96
+ | Source (`BUNDLE/…`) | Destination |
97
+ |---------------------|-------------|
98
+ | `docs/**` | `.docops/guide/**` (prefix: replace `docs/` with `.docops/guide/`) |
99
+ | `../schemas/**` | `.docops/guide/schemas/**` |
100
+ | `../examples/**` | `.docops/guide/examples/**` |
101
+ | `config/review.config.json` | `.docops/review.config.json` |
102
+ | `config/review-queue-registry.json` | `.docops/review-queue/registry.json` |
103
+ | `config/review-queue-pending.json` | `.docops/review-queue/pending.json` |
104
+ | `config/prototype.config.json` | `.docops/prototype/config.json` |
105
+ | `config/prototype-screen-map.json` | `.docops/prototype/screen-map.json` |
106
+
107
+ Create empty dirs when needed: `.docops/comments/`, `.docops/registry/`, `.docops/prototype/`.
108
+
109
+ ---
110
+
111
+ ## 4. Copy templates
112
+
113
+ | Source | Destination | When |
114
+ |--------|-------------|------|
115
+ | `templates/srs/**` | `.docops/templates/srs/` | Layer enabled **and** dest has no `*.md` |
116
+ | `templates/basic-design/**` | `.docops/templates/basic-design/` | Layer enabled **and** dest has no `*.md` |
117
+ | `templates/detail-design/**` | `.docops/templates/detail-design/` | **Always** if dest has no `*.md` (even when `detailDesign.enabled` is `false`) |
118
+
119
+ Example (from repo root; `BUNDLE` from `docops guide --json`):
120
+
121
+ ```bash
122
+ BUNDLE="$(node -e "const r=require('child_process').execSync('npx ai-spector docops guide --json',{encoding:'utf8'}); console.log(JSON.parse(r).targetState.examples.bundle.bootstrapRoot)")"
123
+ DEST=.docops/templates/detail-design
124
+ test -d "$DEST" && [ "$(find "$DEST" -name '*.md' | wc -l)" -eq 0 ] \
125
+ && mkdir -p "$DEST" && cp -R "$BUNDLE/templates/detail-design/." "$DEST/"
126
+ ```
127
+
128
+ Do **not** copy templates for `otherDocument`.
129
+
130
+ ---
131
+
132
+ ## 5. Language placeholders (optional)
133
+
134
+ For each **enabled** `docTypes` layer and each `languages[].path`:
135
+
136
+ ```text
137
+ {docTypes.<key>.path}/{lang}/.gitkeep
138
+ ```
139
+
140
+ Example: `docs/srs/en/.gitkeep`. Skip disabled layers (`detailDesign`, `otherDocument` when `enabled: false`).
141
+
142
+ ---
143
+
144
+ ## 6. Verify and report
145
+
146
+ 1. JSON-parse `.docops/docops.config.json`
147
+ 2. Confirm `detailDesign` + `otherDocument` keys exist
148
+ 3. Confirm `.docops/templates/detail-design/` has at least one `*.md`
149
+ 4. Re-run CLI when available: `npx ai-spector docops status --json` → `writerReady: true`, no blocking gaps
150
+ 5. Or walk [MIGRATION.md §5 checklist](../MIGRATION.md#5-post-migration-checklist)
151
+
152
+ Tell the user which files were **written** vs **skipped (already existed)**.
153
+
154
+ ---
155
+
156
+ ## 7. Writer project settings (remind user)
157
+
158
+ After git commit + push:
159
+
160
+ - Set **storage layout** to `docops` when `.docops/` paths are live on the working branch
161
+ - Enable **Detail Design** / **Other Documents** tabs in Project Settings only when the team wants those layers (separate from `docTypes.enabled`)
162
+
163
+ ---
164
+
165
+ ## Agent quick checklist
166
+
167
+ ```text
168
+ [ ] npx ai-spector docops guide --prompt (wrong vs correct + example config)
169
+ [ ] Read existing .docops/docops.config.json
170
+ [ ] Merge detailDesign + otherDocument (enabled: false) if missing
171
+ [ ] Copy BUNDLE → .docops/guide/, review/prototype stubs (skip existing)
172
+ [ ] Copy detail-design templates if .docops/templates/detail-design/ empty
173
+ [ ] Copy srs/basic-design templates only if layer enabled and dest empty
174
+ [ ] gitkeep for enabled layers × languages
175
+ [ ] Verify JSON + template counts; report written/skipped paths
176
+ [ ] Retry npx ai-spector docops status when CLI works again
177
+ ```
@@ -0,0 +1,84 @@
1
+ # Project layout — configure paths (self-service)
2
+
3
+ This guide helps you **point Writer at your existing docs** without automated file moves.
4
+
5
+ **Related:** [MIGRATION.md](../MIGRATION.md) (contract migration) · run `npx ai-spector docops layout --prompt`
6
+
7
+ ---
8
+
9
+ ## Principles
10
+
11
+ 1. **Do not move markdown unless you choose to** — set `docTypes.*.path` in `.docops/docops.config.json` to folders that already contain your files.
12
+ 2. **Repo-root-relative paths** — use `docs/srs`, not `srs`.
13
+ 3. **Languages** — recommended layout is per-language subfolders: `docs/srs/en/…`, `docs/srs/vi/…`. Flat layouts (`docs/srs/1-intro.md`) work if you set `primaryLanguage` and accept single-language generation.
14
+ 4. **Templates** — customize files under `.docops/templates/{srs,basic-design,detail-design}/`; repair copies builtins only when folders are empty.
15
+
16
+ ---
17
+
18
+ ## Recommended folder map
19
+
20
+ | Layer | Config key | Typical path | Notes |
21
+ |-------|------------|--------------|-------|
22
+ | SRS | `docTypes.srs` | `docs/srs` | Per-lang: `docs/srs/{en,vi,jp}/` |
23
+ | Basic design | `docTypes.basicDesign` | `docs/basic-design` | Same pattern |
24
+ | Detail design | `docTypes.detailDesign` | `docs/detail-design` | Often `enabled: false` until needed |
25
+ | Other | `docTypes.otherDocument` | `docs/other` | Optional catch-all, usually disabled |
26
+ | Data source | (convention) | `docs/data-source/` | Context for agents, not a docType |
27
+
28
+ **Legacy aliases** (point config here if your repo uses them):
29
+
30
+ - `docs/dd/`, `docs/detail_design/` → set `detailDesign.path` accordingly
31
+ - `docs/bd/` → set `basicDesign.path` to `docs/bd`
32
+
33
+ ---
34
+
35
+ ## Workflow
36
+
37
+ ```bash
38
+ # 1. See disk vs config (read-only)
39
+ npx ai-spector docops layout --prompt
40
+
41
+ # 1b. CLI migrate/repair failed — agent fallback
42
+ npx ai-spector docops guide --prompt
43
+
44
+ # 2. Edit .docops/docops.config.json (paths, languages, templatesPath)
45
+
46
+ # 3. Fill contract gaps
47
+ npx ai-spector docops migrate --repair
48
+
49
+ # 4. Index + registry
50
+ npx ai-spector index
51
+ npx ai-spector docops registry sync
52
+
53
+ # 5. Verify
54
+ npx ai-spector docops check --prompt
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Common patterns
60
+
61
+ ### Already on `docs/srs/en/` (canonical)
62
+
63
+ Set paths to defaults; run `docops migrate --repair` for optional layers (`detailDesign`, `otherDocument`).
64
+
65
+ ### Flat SRS (`docs/srs/*.md`)
66
+
67
+ Either:
68
+
69
+ - **A (preferred):** Keep files in place, set `primaryLanguage: "en"` (or your lang), flat is OK for single-language projects.
70
+ - **B:** Manually move to `docs/srs/en/` when you want multi-language folders.
71
+
72
+ ### Docs live outside `docs/`
73
+
74
+ Set `docTypes.srs.path` (and others) to the real folder, e.g. `specs/srs` or `documentation/requirements`.
75
+
76
+ ### Custom template packs
77
+
78
+ Copy/edit templates under `.docops/templates/…` before generate. For wholly custom packs, use **template-import** workflow first.
79
+
80
+ ---
81
+
82
+ ## Writer UI
83
+
84
+ After git push, set **Project Settings → storage layout** to `docops` when `.docops/docops.config.json` is on your branch. See MIGRATION.md §2.1.
@@ -0,0 +1,77 @@
1
+ # Comments — Docops Module Guide
2
+
3
+ ## Native config (Writer)
4
+
5
+ Enable with `capabilities.comments: true` in `.docops/docops.config.json`.
6
+
7
+ Comments live under `paths.comments` (default `.docops/comments/`).
8
+
9
+ ### Entity registry layout (recommended)
10
+
11
+ ```text
12
+ .docops/comments/documents/{entityId}/{thread_id}/
13
+ ├── meta_data.json
14
+ ├── events.jsonl
15
+ └── {comment_id} # one JSON file per comment
16
+
17
+ .docops/comments/screens/{screenId}/{thread_id}/
18
+ └── … # prototype threads
19
+ ```
20
+
21
+ `entityId` / `screenId` come from `.docops/registry/`. Threads survive document renames.
22
+
23
+ ### Legacy layout (deprecated)
24
+
25
+ ```text
26
+ .docops/comments/{logical_path}/{thread_id}/
27
+ ├── meta_data.json
28
+ ├── events.jsonl
29
+ └── {comment_id}
30
+ ```
31
+
32
+ `logical_path` matches the document path without `docs/` prefix (e.g. `srs/en/1-introduction`).
33
+
34
+ **Migrate to entity layout:** [guides/COMMENTS_ENTITY_MIGRATION.md](../guides/COMMENTS_ENTITY_MIGRATION.md)
35
+
36
+ Schema: `kari-writer/contracts/schemas/comments/`. Example: `contracts/examples/minimal-comment-thread/`.
37
+
38
+ `meta_data.json` carries `version` for optimistic concurrency. Writer increments version on each write.
39
+
40
+ ## Local CLI (AI Spector)
41
+
42
+ ```bash
43
+ # List / triage
44
+ npx ai-spector comments inbox --json
45
+ npx ai-spector comments list --entity <uuid> --json
46
+
47
+ # Create and reply (document comments)
48
+ npx ai-spector comments create --file srs/01-overview --body "Please clarify" --start-line 12 --end-line 14
49
+ npx ai-spector comments create --entity <uuid> --body "Please clarify" --start-line 12 --end-line 14
50
+ npx ai-spector comments reply <threadId> --body "Updated in next revision"
51
+ npx ai-spector comments reply <threadId> --entity <uuid> --body "Updated in next revision"
52
+
53
+ # Resolve
54
+ npx ai-spector comments resolve <threadId> --entity <uuid>
55
+ ```
56
+
57
+ **Reply scope:** `threadId` alone is enough when the thread is unique under `.docops/comments/`. For entity-layout storage (`comments/documents/{entityId}/`), `--file` resolves to the legacy path and may fail — prefer `threadId` only, or pass `--entity <targetId>` from `comments show` / `comments list` (`targetId` field).
58
+
59
+ **MCP:** `contract_comments({ action: "create" | "reply" | "list" | "inbox" | "show" | "resolve", ... })`
60
+
61
+ | Action | Required fields | Notes |
62
+ |--------|-----------------|-------|
63
+ | `reply` | `threadId`, `body` | Pass `entityId` from show/list when scope is ambiguous |
64
+ | `create` | `body`, plus `entityId` or `filePath` | Document anchor: `startLine` / `endLine` |
65
+ | `show` | `threadId` | Optional `entityId` / `filePath`; returns `targetId` for reply |
66
+
67
+ ## Custom adapter
68
+
69
+ A CI bot or local tool may create comment threads by:
70
+
71
+ 1. Creating the thread folder with valid `meta_data.json` and at least one comment file
72
+ 2. Appending events to `events.jsonl` for audit trail
73
+ 3. Re-reading `meta_data.json` before updates; retry on version mismatch
74
+
75
+ Prefer writing under `comments/documents/{entityId}/` when the registry is available.
76
+
77
+ Set `capabilities.comments: false` when comments are managed entirely outside Writer.
@@ -0,0 +1,25 @@
1
+ # Generate — Docops Module Guide
2
+
3
+ ## Native config (Writer)
4
+
5
+ Enable with `capabilities.generate: true` and a non-empty `templatesPath` per enabled doc layer.
6
+
7
+ | Config | Purpose |
8
+ |--------|---------|
9
+ | `docTypes.<layer>.templatesPath` | Folder of `*.md` template files (e.g. `.docops/templates/srs`) |
10
+ | `docTypes.<layer>.enabled` | Layer must be `true` for generation |
11
+ | `capabilities.generate` | Master switch for cloud generation UI |
12
+
13
+ Generated **output** lives under `docs/{layer}/{lang}/` — separate from templates.
14
+
15
+ Writer lists templates from git; cloud generation runs when templates exist and capability is on.
16
+
17
+ ## Custom adapter
18
+
19
+ ai-spector or a custom script may own generation:
20
+
21
+ 1. Copy or author templates into `templatesPath`
22
+ 2. Write generated markdown to `docs/{layer}/{lang}/`
23
+ 3. Commit both template and output to git
24
+
25
+ To use only your pipeline (hide Writer cloud generation), set `capabilities.generate: false`. Templates may still exist for local tooling.
@@ -0,0 +1,31 @@
1
+ # Graph — Docops Module Guide
2
+
3
+ ## Native config (Writer)
4
+
5
+ Enable with `capabilities.graph: true` in `.docops/docops.config.json`.
6
+
7
+ Writer reads `.docops/adapters/graph.json` when present:
8
+
9
+ ```json
10
+ {
11
+ "schemaVersion": "1.0",
12
+ "artifacts": {
13
+ "nodes": ".ai-spector/graph/nodes.json",
14
+ "edges": ".ai-spector/graph/edges.json"
15
+ }
16
+ }
17
+ ```
18
+
19
+ Paths in `artifacts` are repo-relative. Writer does not compute the graph — it displays pre-built artifacts.
20
+
21
+ If `graph` is `true` but adapter file or artifacts are missing, Writer hides the graph UI and logs a warning.
22
+
23
+ ## Custom adapter
24
+
25
+ ai-spector graph plugin or a custom tool:
26
+
27
+ 1. Writes `nodes.json` / `edges.json` (or paths declared in adapter config)
28
+ 2. Updates `.docops/adapters/graph.json` to point at artifacts
29
+ 3. Sets `capabilities.graph: true`
30
+
31
+ Set `capabilities.graph: false` when traceability graph is not used.
@@ -0,0 +1,26 @@
1
+ # Prototype — Docops Module Guide
2
+
3
+ ## Native config (Writer)
4
+
5
+ Enable with `capabilities.prototype: true` in `.docops/docops.config.json`.
6
+
7
+ | File | Purpose |
8
+ |------|---------|
9
+ | `.docops/prototype/screen-map.json` | Maps screens ↔ docs ↔ prototype URLs |
10
+ | `.docops/prototype/config.json` | Deploy/review settings (no HTML source) |
11
+
12
+ Prototype **HTML/SPA source** lives at repo root `prototype/` — optional and not part of the docops schema.
13
+
14
+ Schema: `kari-writer/contracts/schemas/prototype/`. Example: `contracts/examples/minimal-screen-map.json`.
15
+
16
+ Writer reads `screen-map.json` to link design docs to prototype previews. Missing screen-map hides prototype features without error.
17
+
18
+ ## Custom adapter
19
+
20
+ A deploy pipeline may update `screen-map.json` when screens change:
21
+
22
+ 1. Preserve `schemaVersion` and existing screen IDs where possible
23
+ 2. Set `reviewUrl` after deploy completes
24
+ 3. Commit to the same branch users review in Writer
25
+
26
+ Set `capabilities.prototype: false` when prototype mapping is not used.
@@ -0,0 +1,25 @@
1
+ # Review — Docops Module Guide
2
+
3
+ ## Native config (Writer)
4
+
5
+ Enable with `capabilities.review: true` in `.docops/docops.config.json`.
6
+
7
+ | File | Purpose |
8
+ |------|---------|
9
+ | `.docops/review.config.json` | Sign-off preset (`extends: kaopiz-default`) |
10
+ | `.docops/review-queue/registry.json` | Per-document review state (v3) |
11
+ | `.docops/review-queue/pending.json` | Pending queue array |
12
+
13
+ Schema: `kari-writer/contracts/schemas/review/`. Example: `contracts/examples/review/minimal-registry.json`.
14
+
15
+ Writer web UI writes `overallStatus`, track `votes[]`, closure fields. **Do not** write `contentHash` or `docPath` — pipeline-owned.
16
+
17
+ ## Custom adapter
18
+
19
+ An external sign-off tool may update `registry.json` if it:
20
+
21
+ 1. Re-reads the file (and git SHA when available) before write
22
+ 2. Retries on conflict
23
+ 3. Leaves `contentHash` / `docPath` unchanged
24
+
25
+ Set `capabilities.review: false` to hide Writer review UI when your adapter owns the workflow entirely.
@@ -0,0 +1,26 @@
1
+ # Translate — Docops Module Guide
2
+
3
+ ## Native config (Writer)
4
+
5
+ Enable with `capabilities.translate: true` in `.docops/docops.config.json`.
6
+
7
+ | Field | Purpose |
8
+ |-------|---------|
9
+ | `languages[]` | All supported language codes and folder paths |
10
+ | `primaryLanguage` | Authoring language (e.g. `en`) |
11
+ | `internalLanguage` | Language for internal review (e.g. `vi`) |
12
+ | `clientLanguage` | Language for client-facing release (e.g. `jp`) |
13
+
14
+ Translated documents live at `docs/{layer}/{language.path}/*.md` for each entry in `languages`.
15
+
16
+ Writer shows translation workflow UI when `translate` is enabled. Missing target-language files are not errors.
17
+
18
+ ## Custom adapter
19
+
20
+ A local translate workflow (ai-spector, CI, or agent) may:
21
+
22
+ 1. Read source docs from `primaryLanguage` path
23
+ 2. Write translations to other `languages[].path` folders
24
+ 3. Commit per language on the same branch
25
+
26
+ Set `capabilities.translate: false` when translation is handled entirely outside Writer.