@libar-dev/architect 1.0.0-pre.3

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 (800) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +25 -0
  3. package/LICENSE-MCP +62 -0
  4. package/README.md +147 -0
  5. package/dist/api/arch-queries.d.ts +95 -0
  6. package/dist/api/arch-queries.d.ts.map +1 -0
  7. package/dist/api/arch-queries.js +310 -0
  8. package/dist/api/arch-queries.js.map +1 -0
  9. package/dist/api/context-assembler.d.ts +124 -0
  10. package/dist/api/context-assembler.d.ts.map +1 -0
  11. package/dist/api/context-assembler.js +472 -0
  12. package/dist/api/context-assembler.js.map +1 -0
  13. package/dist/api/context-formatter.d.ts +26 -0
  14. package/dist/api/context-formatter.d.ts.map +1 -0
  15. package/dist/api/context-formatter.js +183 -0
  16. package/dist/api/context-formatter.js.map +1 -0
  17. package/dist/api/coverage-analyzer.d.ts +38 -0
  18. package/dist/api/coverage-analyzer.d.ts.map +1 -0
  19. package/dist/api/coverage-analyzer.js +117 -0
  20. package/dist/api/coverage-analyzer.js.map +1 -0
  21. package/dist/api/fuzzy-match.d.ts +75 -0
  22. package/dist/api/fuzzy-match.d.ts.map +1 -0
  23. package/dist/api/fuzzy-match.js +150 -0
  24. package/dist/api/fuzzy-match.js.map +1 -0
  25. package/dist/api/handoff-generator.d.ts +45 -0
  26. package/dist/api/handoff-generator.d.ts.map +1 -0
  27. package/dist/api/handoff-generator.js +139 -0
  28. package/dist/api/handoff-generator.js.map +1 -0
  29. package/dist/api/index.d.ts +61 -0
  30. package/dist/api/index.d.ts.map +1 -0
  31. package/dist/api/index.js +54 -0
  32. package/dist/api/index.js.map +1 -0
  33. package/dist/api/pattern-helpers.d.ts +51 -0
  34. package/dist/api/pattern-helpers.d.ts.map +1 -0
  35. package/dist/api/pattern-helpers.js +84 -0
  36. package/dist/api/pattern-helpers.js.map +1 -0
  37. package/dist/api/process-state.d.ts +224 -0
  38. package/dist/api/process-state.d.ts.map +1 -0
  39. package/dist/api/process-state.js +308 -0
  40. package/dist/api/process-state.js.map +1 -0
  41. package/dist/api/rules-query.d.ts +60 -0
  42. package/dist/api/rules-query.d.ts.map +1 -0
  43. package/dist/api/rules-query.js +154 -0
  44. package/dist/api/rules-query.js.map +1 -0
  45. package/dist/api/scope-validator.d.ts +56 -0
  46. package/dist/api/scope-validator.d.ts.map +1 -0
  47. package/dist/api/scope-validator.js +293 -0
  48. package/dist/api/scope-validator.js.map +1 -0
  49. package/dist/api/stub-resolver.d.ts +117 -0
  50. package/dist/api/stub-resolver.d.ts.map +1 -0
  51. package/dist/api/stub-resolver.js +154 -0
  52. package/dist/api/stub-resolver.js.map +1 -0
  53. package/dist/api/summarize.d.ts +75 -0
  54. package/dist/api/summarize.d.ts.map +1 -0
  55. package/dist/api/summarize.js +97 -0
  56. package/dist/api/summarize.js.map +1 -0
  57. package/dist/api/types.d.ts +221 -0
  58. package/dist/api/types.d.ts.map +1 -0
  59. package/dist/api/types.js +57 -0
  60. package/dist/api/types.js.map +1 -0
  61. package/dist/cache/file-cache.d.ts +72 -0
  62. package/dist/cache/file-cache.d.ts.map +1 -0
  63. package/dist/cache/file-cache.js +80 -0
  64. package/dist/cache/file-cache.js.map +1 -0
  65. package/dist/cache/index.d.ts +5 -0
  66. package/dist/cache/index.d.ts.map +1 -0
  67. package/dist/cache/index.js +5 -0
  68. package/dist/cache/index.js.map +1 -0
  69. package/dist/cli/cli-schema.d.ts +83 -0
  70. package/dist/cli/cli-schema.d.ts.map +1 -0
  71. package/dist/cli/cli-schema.js +505 -0
  72. package/dist/cli/cli-schema.js.map +1 -0
  73. package/dist/cli/dataset-cache.d.ts +66 -0
  74. package/dist/cli/dataset-cache.d.ts.map +1 -0
  75. package/dist/cli/dataset-cache.js +179 -0
  76. package/dist/cli/dataset-cache.js.map +1 -0
  77. package/dist/cli/error-handler.d.ts +84 -0
  78. package/dist/cli/error-handler.d.ts.map +1 -0
  79. package/dist/cli/error-handler.js +197 -0
  80. package/dist/cli/error-handler.js.map +1 -0
  81. package/dist/cli/generate-docs.d.ts +30 -0
  82. package/dist/cli/generate-docs.d.ts.map +1 -0
  83. package/dist/cli/generate-docs.js +370 -0
  84. package/dist/cli/generate-docs.js.map +1 -0
  85. package/dist/cli/lint-patterns.d.ts +57 -0
  86. package/dist/cli/lint-patterns.d.ts.map +1 -0
  87. package/dist/cli/lint-patterns.js +257 -0
  88. package/dist/cli/lint-patterns.js.map +1 -0
  89. package/dist/cli/lint-process.d.ts +54 -0
  90. package/dist/cli/lint-process.d.ts.map +1 -0
  91. package/dist/cli/lint-process.js +319 -0
  92. package/dist/cli/lint-process.js.map +1 -0
  93. package/dist/cli/lint-steps.d.ts +32 -0
  94. package/dist/cli/lint-steps.d.ts.map +1 -0
  95. package/dist/cli/lint-steps.js +172 -0
  96. package/dist/cli/lint-steps.js.map +1 -0
  97. package/dist/cli/mcp-server.d.ts +22 -0
  98. package/dist/cli/mcp-server.d.ts.map +1 -0
  99. package/dist/cli/mcp-server.js +57 -0
  100. package/dist/cli/mcp-server.js.map +1 -0
  101. package/dist/cli/output-pipeline.d.ts +130 -0
  102. package/dist/cli/output-pipeline.d.ts.map +1 -0
  103. package/dist/cli/output-pipeline.js +234 -0
  104. package/dist/cli/output-pipeline.js.map +1 -0
  105. package/dist/cli/process-api.d.ts +37 -0
  106. package/dist/cli/process-api.d.ts.map +1 -0
  107. package/dist/cli/process-api.js +1550 -0
  108. package/dist/cli/process-api.js.map +1 -0
  109. package/dist/cli/repl.d.ts +38 -0
  110. package/dist/cli/repl.d.ts.map +1 -0
  111. package/dist/cli/repl.js +239 -0
  112. package/dist/cli/repl.js.map +1 -0
  113. package/dist/cli/validate-patterns.d.ts +115 -0
  114. package/dist/cli/validate-patterns.d.ts.map +1 -0
  115. package/dist/cli/validate-patterns.js +707 -0
  116. package/dist/cli/validate-patterns.js.map +1 -0
  117. package/dist/cli/version.d.ts +35 -0
  118. package/dist/cli/version.d.ts.map +1 -0
  119. package/dist/cli/version.js +64 -0
  120. package/dist/cli/version.js.map +1 -0
  121. package/dist/config/config-loader.d.ts +167 -0
  122. package/dist/config/config-loader.d.ts.map +1 -0
  123. package/dist/config/config-loader.js +294 -0
  124. package/dist/config/config-loader.js.map +1 -0
  125. package/dist/config/defaults.d.ts +92 -0
  126. package/dist/config/defaults.d.ts.map +1 -0
  127. package/dist/config/defaults.js +103 -0
  128. package/dist/config/defaults.js.map +1 -0
  129. package/dist/config/define-config.d.ts +37 -0
  130. package/dist/config/define-config.d.ts.map +1 -0
  131. package/dist/config/define-config.js +38 -0
  132. package/dist/config/define-config.js.map +1 -0
  133. package/dist/config/factory.d.ts +79 -0
  134. package/dist/config/factory.d.ts.map +1 -0
  135. package/dist/config/factory.js +116 -0
  136. package/dist/config/factory.js.map +1 -0
  137. package/dist/config/index.d.ts +45 -0
  138. package/dist/config/index.d.ts.map +1 -0
  139. package/dist/config/index.js +48 -0
  140. package/dist/config/index.js.map +1 -0
  141. package/dist/config/merge-sources.d.ts +47 -0
  142. package/dist/config/merge-sources.d.ts.map +1 -0
  143. package/dist/config/merge-sources.js +61 -0
  144. package/dist/config/merge-sources.js.map +1 -0
  145. package/dist/config/presets.d.ts +115 -0
  146. package/dist/config/presets.d.ts.map +1 -0
  147. package/dist/config/presets.js +119 -0
  148. package/dist/config/presets.js.map +1 -0
  149. package/dist/config/project-config-schema.d.ts +192 -0
  150. package/dist/config/project-config-schema.d.ts.map +1 -0
  151. package/dist/config/project-config-schema.js +231 -0
  152. package/dist/config/project-config-schema.js.map +1 -0
  153. package/dist/config/project-config.d.ts +229 -0
  154. package/dist/config/project-config.d.ts.map +1 -0
  155. package/dist/config/project-config.js +37 -0
  156. package/dist/config/project-config.js.map +1 -0
  157. package/dist/config/regex-builders.d.ts +49 -0
  158. package/dist/config/regex-builders.d.ts.map +1 -0
  159. package/dist/config/regex-builders.js +85 -0
  160. package/dist/config/regex-builders.js.map +1 -0
  161. package/dist/config/resolve-config.d.ts +65 -0
  162. package/dist/config/resolve-config.d.ts.map +1 -0
  163. package/dist/config/resolve-config.js +150 -0
  164. package/dist/config/resolve-config.js.map +1 -0
  165. package/dist/config/types.d.ts +81 -0
  166. package/dist/config/types.d.ts.map +1 -0
  167. package/dist/config/types.js +22 -0
  168. package/dist/config/types.js.map +1 -0
  169. package/dist/config/workflow-loader.d.ts +90 -0
  170. package/dist/config/workflow-loader.d.ts.map +1 -0
  171. package/dist/config/workflow-loader.js +167 -0
  172. package/dist/config/workflow-loader.js.map +1 -0
  173. package/dist/extractor/doc-extractor.d.ts +233 -0
  174. package/dist/extractor/doc-extractor.d.ts.map +1 -0
  175. package/dist/extractor/doc-extractor.js +481 -0
  176. package/dist/extractor/doc-extractor.js.map +1 -0
  177. package/dist/extractor/dual-source-extractor.d.ts +161 -0
  178. package/dist/extractor/dual-source-extractor.d.ts.map +1 -0
  179. package/dist/extractor/dual-source-extractor.js +407 -0
  180. package/dist/extractor/dual-source-extractor.js.map +1 -0
  181. package/dist/extractor/gherkin-extractor.d.ts +170 -0
  182. package/dist/extractor/gherkin-extractor.d.ts.map +1 -0
  183. package/dist/extractor/gherkin-extractor.js +543 -0
  184. package/dist/extractor/gherkin-extractor.js.map +1 -0
  185. package/dist/extractor/index.d.ts +7 -0
  186. package/dist/extractor/index.d.ts.map +1 -0
  187. package/dist/extractor/index.js +11 -0
  188. package/dist/extractor/index.js.map +1 -0
  189. package/dist/extractor/layer-inference.d.ts +66 -0
  190. package/dist/extractor/layer-inference.d.ts.map +1 -0
  191. package/dist/extractor/layer-inference.js +93 -0
  192. package/dist/extractor/layer-inference.js.map +1 -0
  193. package/dist/extractor/shape-extractor.d.ts +79 -0
  194. package/dist/extractor/shape-extractor.d.ts.map +1 -0
  195. package/dist/extractor/shape-extractor.js +966 -0
  196. package/dist/extractor/shape-extractor.js.map +1 -0
  197. package/dist/generators/built-in/cli-recipe-generator.d.ts +30 -0
  198. package/dist/generators/built-in/cli-recipe-generator.d.ts.map +1 -0
  199. package/dist/generators/built-in/cli-recipe-generator.js +155 -0
  200. package/dist/generators/built-in/cli-recipe-generator.js.map +1 -0
  201. package/dist/generators/built-in/codec-generators.d.ts +29 -0
  202. package/dist/generators/built-in/codec-generators.d.ts.map +1 -0
  203. package/dist/generators/built-in/codec-generators.js +195 -0
  204. package/dist/generators/built-in/codec-generators.js.map +1 -0
  205. package/dist/generators/built-in/decision-doc-generator.d.ts +204 -0
  206. package/dist/generators/built-in/decision-doc-generator.d.ts.map +1 -0
  207. package/dist/generators/built-in/decision-doc-generator.js +654 -0
  208. package/dist/generators/built-in/decision-doc-generator.js.map +1 -0
  209. package/dist/generators/built-in/design-review-generator.d.ts +26 -0
  210. package/dist/generators/built-in/design-review-generator.d.ts.map +1 -0
  211. package/dist/generators/built-in/design-review-generator.js +94 -0
  212. package/dist/generators/built-in/design-review-generator.js.map +1 -0
  213. package/dist/generators/built-in/index.d.ts +22 -0
  214. package/dist/generators/built-in/index.d.ts.map +1 -0
  215. package/dist/generators/built-in/index.js +23 -0
  216. package/dist/generators/built-in/index.js.map +1 -0
  217. package/dist/generators/built-in/process-api-reference-generator.d.ts +18 -0
  218. package/dist/generators/built-in/process-api-reference-generator.d.ts.map +1 -0
  219. package/dist/generators/built-in/process-api-reference-generator.js +85 -0
  220. package/dist/generators/built-in/process-api-reference-generator.js.map +1 -0
  221. package/dist/generators/built-in/reference-generators.d.ts +51 -0
  222. package/dist/generators/built-in/reference-generators.d.ts.map +1 -0
  223. package/dist/generators/built-in/reference-generators.js +320 -0
  224. package/dist/generators/built-in/reference-generators.js.map +1 -0
  225. package/dist/generators/codec-based.d.ts +63 -0
  226. package/dist/generators/codec-based.d.ts.map +1 -0
  227. package/dist/generators/codec-based.js +88 -0
  228. package/dist/generators/codec-based.js.map +1 -0
  229. package/dist/generators/content-deduplicator.d.ts +114 -0
  230. package/dist/generators/content-deduplicator.d.ts.map +1 -0
  231. package/dist/generators/content-deduplicator.js +356 -0
  232. package/dist/generators/content-deduplicator.js.map +1 -0
  233. package/dist/generators/index.d.ts +50 -0
  234. package/dist/generators/index.d.ts.map +1 -0
  235. package/dist/generators/index.js +54 -0
  236. package/dist/generators/index.js.map +1 -0
  237. package/dist/generators/orchestrator.d.ts +265 -0
  238. package/dist/generators/orchestrator.d.ts.map +1 -0
  239. package/dist/generators/orchestrator.js +570 -0
  240. package/dist/generators/orchestrator.js.map +1 -0
  241. package/dist/generators/pipeline/build-pipeline.d.ts +131 -0
  242. package/dist/generators/pipeline/build-pipeline.d.ts.map +1 -0
  243. package/dist/generators/pipeline/build-pipeline.js +248 -0
  244. package/dist/generators/pipeline/build-pipeline.js.map +1 -0
  245. package/dist/generators/pipeline/context-inference.d.ts +55 -0
  246. package/dist/generators/pipeline/context-inference.d.ts.map +1 -0
  247. package/dist/generators/pipeline/context-inference.js +76 -0
  248. package/dist/generators/pipeline/context-inference.js.map +1 -0
  249. package/dist/generators/pipeline/index.d.ts +27 -0
  250. package/dist/generators/pipeline/index.d.ts.map +1 -0
  251. package/dist/generators/pipeline/index.js +34 -0
  252. package/dist/generators/pipeline/index.js.map +1 -0
  253. package/dist/generators/pipeline/merge-patterns.d.ts +33 -0
  254. package/dist/generators/pipeline/merge-patterns.d.ts.map +1 -0
  255. package/dist/generators/pipeline/merge-patterns.js +50 -0
  256. package/dist/generators/pipeline/merge-patterns.js.map +1 -0
  257. package/dist/generators/pipeline/relationship-resolver.d.ts +47 -0
  258. package/dist/generators/pipeline/relationship-resolver.d.ts.map +1 -0
  259. package/dist/generators/pipeline/relationship-resolver.js +132 -0
  260. package/dist/generators/pipeline/relationship-resolver.js.map +1 -0
  261. package/dist/generators/pipeline/sequence-utils.d.ts +49 -0
  262. package/dist/generators/pipeline/sequence-utils.d.ts.map +1 -0
  263. package/dist/generators/pipeline/sequence-utils.js +235 -0
  264. package/dist/generators/pipeline/sequence-utils.js.map +1 -0
  265. package/dist/generators/pipeline/transform-dataset.d.ts +82 -0
  266. package/dist/generators/pipeline/transform-dataset.d.ts.map +1 -0
  267. package/dist/generators/pipeline/transform-dataset.js +355 -0
  268. package/dist/generators/pipeline/transform-dataset.js.map +1 -0
  269. package/dist/generators/pipeline/transform-types.d.ts +96 -0
  270. package/dist/generators/pipeline/transform-types.d.ts.map +1 -0
  271. package/dist/generators/pipeline/transform-types.js +18 -0
  272. package/dist/generators/pipeline/transform-types.js.map +1 -0
  273. package/dist/generators/registry.d.ts +64 -0
  274. package/dist/generators/registry.d.ts.map +1 -0
  275. package/dist/generators/registry.js +77 -0
  276. package/dist/generators/registry.js.map +1 -0
  277. package/dist/generators/source-mapper.d.ts +143 -0
  278. package/dist/generators/source-mapper.d.ts.map +1 -0
  279. package/dist/generators/source-mapper.js +602 -0
  280. package/dist/generators/source-mapper.js.map +1 -0
  281. package/dist/generators/source-mapping-validator.d.ts +118 -0
  282. package/dist/generators/source-mapping-validator.d.ts.map +1 -0
  283. package/dist/generators/source-mapping-validator.js +334 -0
  284. package/dist/generators/source-mapping-validator.js.map +1 -0
  285. package/dist/generators/types.d.ts +104 -0
  286. package/dist/generators/types.d.ts.map +1 -0
  287. package/dist/generators/types.js +5 -0
  288. package/dist/generators/types.js.map +1 -0
  289. package/dist/generators/warning-collector.d.ts +144 -0
  290. package/dist/generators/warning-collector.d.ts.map +1 -0
  291. package/dist/generators/warning-collector.js +166 -0
  292. package/dist/generators/warning-collector.js.map +1 -0
  293. package/dist/git/branch-diff.d.ts +44 -0
  294. package/dist/git/branch-diff.d.ts.map +1 -0
  295. package/dist/git/branch-diff.js +57 -0
  296. package/dist/git/branch-diff.js.map +1 -0
  297. package/dist/git/helpers.d.ts +46 -0
  298. package/dist/git/helpers.d.ts.map +1 -0
  299. package/dist/git/helpers.js +67 -0
  300. package/dist/git/helpers.js.map +1 -0
  301. package/dist/git/index.d.ts +18 -0
  302. package/dist/git/index.d.ts.map +1 -0
  303. package/dist/git/index.js +18 -0
  304. package/dist/git/index.js.map +1 -0
  305. package/dist/git/name-status.d.ts +32 -0
  306. package/dist/git/name-status.d.ts.map +1 -0
  307. package/dist/git/name-status.js +66 -0
  308. package/dist/git/name-status.js.map +1 -0
  309. package/dist/index.d.ts +107 -0
  310. package/dist/index.d.ts.map +1 -0
  311. package/dist/index.js +122 -0
  312. package/dist/index.js.map +1 -0
  313. package/dist/lint/engine.d.ts +113 -0
  314. package/dist/lint/engine.d.ts.map +1 -0
  315. package/dist/lint/engine.js +228 -0
  316. package/dist/lint/engine.js.map +1 -0
  317. package/dist/lint/index.d.ts +26 -0
  318. package/dist/lint/index.d.ts.map +1 -0
  319. package/dist/lint/index.js +24 -0
  320. package/dist/lint/index.js.map +1 -0
  321. package/dist/lint/process-guard/decider.d.ts +166 -0
  322. package/dist/lint/process-guard/decider.d.ts.map +1 -0
  323. package/dist/lint/process-guard/decider.js +412 -0
  324. package/dist/lint/process-guard/decider.js.map +1 -0
  325. package/dist/lint/process-guard/derive-state.d.ts +96 -0
  326. package/dist/lint/process-guard/derive-state.d.ts.map +1 -0
  327. package/dist/lint/process-guard/derive-state.js +368 -0
  328. package/dist/lint/process-guard/derive-state.js.map +1 -0
  329. package/dist/lint/process-guard/detect-changes.d.ts +109 -0
  330. package/dist/lint/process-guard/detect-changes.d.ts.map +1 -0
  331. package/dist/lint/process-guard/detect-changes.js +487 -0
  332. package/dist/lint/process-guard/detect-changes.js.map +1 -0
  333. package/dist/lint/process-guard/index.d.ts +35 -0
  334. package/dist/lint/process-guard/index.d.ts.map +1 -0
  335. package/dist/lint/process-guard/index.js +39 -0
  336. package/dist/lint/process-guard/index.js.map +1 -0
  337. package/dist/lint/process-guard/types.d.ts +255 -0
  338. package/dist/lint/process-guard/types.d.ts.map +1 -0
  339. package/dist/lint/process-guard/types.js +31 -0
  340. package/dist/lint/process-guard/types.js.map +1 -0
  341. package/dist/lint/rules.d.ts +147 -0
  342. package/dist/lint/rules.d.ts.map +1 -0
  343. package/dist/lint/rules.js +289 -0
  344. package/dist/lint/rules.js.map +1 -0
  345. package/dist/lint/steps/cross-checks.d.ts +66 -0
  346. package/dist/lint/steps/cross-checks.d.ts.map +1 -0
  347. package/dist/lint/steps/cross-checks.js +290 -0
  348. package/dist/lint/steps/cross-checks.js.map +1 -0
  349. package/dist/lint/steps/feature-checks.d.ts +78 -0
  350. package/dist/lint/steps/feature-checks.d.ts.map +1 -0
  351. package/dist/lint/steps/feature-checks.js +279 -0
  352. package/dist/lint/steps/feature-checks.js.map +1 -0
  353. package/dist/lint/steps/index.d.ts +22 -0
  354. package/dist/lint/steps/index.d.ts.map +1 -0
  355. package/dist/lint/steps/index.js +26 -0
  356. package/dist/lint/steps/index.js.map +1 -0
  357. package/dist/lint/steps/pair-resolver.d.ts +29 -0
  358. package/dist/lint/steps/pair-resolver.d.ts.map +1 -0
  359. package/dist/lint/steps/pair-resolver.js +76 -0
  360. package/dist/lint/steps/pair-resolver.js.map +1 -0
  361. package/dist/lint/steps/runner.d.ts +28 -0
  362. package/dist/lint/steps/runner.d.ts.map +1 -0
  363. package/dist/lint/steps/runner.js +143 -0
  364. package/dist/lint/steps/runner.js.map +1 -0
  365. package/dist/lint/steps/step-checks.d.ts +41 -0
  366. package/dist/lint/steps/step-checks.d.ts.map +1 -0
  367. package/dist/lint/steps/step-checks.js +164 -0
  368. package/dist/lint/steps/step-checks.js.map +1 -0
  369. package/dist/lint/steps/types.d.ts +95 -0
  370. package/dist/lint/steps/types.d.ts.map +1 -0
  371. package/dist/lint/steps/types.js +79 -0
  372. package/dist/lint/steps/types.js.map +1 -0
  373. package/dist/lint/steps/utils.d.ts +22 -0
  374. package/dist/lint/steps/utils.d.ts.map +1 -0
  375. package/dist/lint/steps/utils.js +57 -0
  376. package/dist/lint/steps/utils.js.map +1 -0
  377. package/dist/mcp/file-watcher.d.ts +24 -0
  378. package/dist/mcp/file-watcher.d.ts.map +1 -0
  379. package/dist/mcp/file-watcher.js +75 -0
  380. package/dist/mcp/file-watcher.js.map +1 -0
  381. package/dist/mcp/index.d.ts +19 -0
  382. package/dist/mcp/index.d.ts.map +1 -0
  383. package/dist/mcp/index.js +21 -0
  384. package/dist/mcp/index.js.map +1 -0
  385. package/dist/mcp/pipeline-session.d.ts +33 -0
  386. package/dist/mcp/pipeline-session.d.ts.map +1 -0
  387. package/dist/mcp/pipeline-session.js +149 -0
  388. package/dist/mcp/pipeline-session.js.map +1 -0
  389. package/dist/mcp/server.d.ts +28 -0
  390. package/dist/mcp/server.d.ts.map +1 -0
  391. package/dist/mcp/server.js +197 -0
  392. package/dist/mcp/server.js.map +1 -0
  393. package/dist/mcp/tool-registry.d.ts +4 -0
  394. package/dist/mcp/tool-registry.d.ts.map +1 -0
  395. package/dist/mcp/tool-registry.js +525 -0
  396. package/dist/mcp/tool-registry.js.map +1 -0
  397. package/dist/renderable/codecs/adr.d.ts +4730 -0
  398. package/dist/renderable/codecs/adr.d.ts.map +1 -0
  399. package/dist/renderable/codecs/adr.js +590 -0
  400. package/dist/renderable/codecs/adr.js.map +1 -0
  401. package/dist/renderable/codecs/architecture.d.ts +4760 -0
  402. package/dist/renderable/codecs/architecture.d.ts.map +1 -0
  403. package/dist/renderable/codecs/architecture.js +524 -0
  404. package/dist/renderable/codecs/architecture.js.map +1 -0
  405. package/dist/renderable/codecs/business-rules.d.ts +4777 -0
  406. package/dist/renderable/codecs/business-rules.d.ts.map +1 -0
  407. package/dist/renderable/codecs/business-rules.js +648 -0
  408. package/dist/renderable/codecs/business-rules.js.map +1 -0
  409. package/dist/renderable/codecs/claude-module.d.ts +4710 -0
  410. package/dist/renderable/codecs/claude-module.d.ts.map +1 -0
  411. package/dist/renderable/codecs/claude-module.js +214 -0
  412. package/dist/renderable/codecs/claude-module.js.map +1 -0
  413. package/dist/renderable/codecs/composite.d.ts +84 -0
  414. package/dist/renderable/codecs/composite.d.ts.map +1 -0
  415. package/dist/renderable/codecs/composite.js +124 -0
  416. package/dist/renderable/codecs/composite.js.map +1 -0
  417. package/dist/renderable/codecs/convention-extractor.d.ts +105 -0
  418. package/dist/renderable/codecs/convention-extractor.d.ts.map +1 -0
  419. package/dist/renderable/codecs/convention-extractor.js +353 -0
  420. package/dist/renderable/codecs/convention-extractor.js.map +1 -0
  421. package/dist/renderable/codecs/decision-doc.d.ts +308 -0
  422. package/dist/renderable/codecs/decision-doc.d.ts.map +1 -0
  423. package/dist/renderable/codecs/decision-doc.js +485 -0
  424. package/dist/renderable/codecs/decision-doc.js.map +1 -0
  425. package/dist/renderable/codecs/design-review.d.ts +55 -0
  426. package/dist/renderable/codecs/design-review.d.ts.map +1 -0
  427. package/dist/renderable/codecs/design-review.js +532 -0
  428. package/dist/renderable/codecs/design-review.js.map +1 -0
  429. package/dist/renderable/codecs/diagram-utils.d.ts +62 -0
  430. package/dist/renderable/codecs/diagram-utils.d.ts.map +1 -0
  431. package/dist/renderable/codecs/diagram-utils.js +70 -0
  432. package/dist/renderable/codecs/diagram-utils.js.map +1 -0
  433. package/dist/renderable/codecs/helpers.d.ts +553 -0
  434. package/dist/renderable/codecs/helpers.d.ts.map +1 -0
  435. package/dist/renderable/codecs/helpers.js +913 -0
  436. package/dist/renderable/codecs/helpers.js.map +1 -0
  437. package/dist/renderable/codecs/index-codec.d.ts +4714 -0
  438. package/dist/renderable/codecs/index-codec.d.ts.map +1 -0
  439. package/dist/renderable/codecs/index-codec.js +250 -0
  440. package/dist/renderable/codecs/index-codec.js.map +1 -0
  441. package/dist/renderable/codecs/index.d.ts +46 -0
  442. package/dist/renderable/codecs/index.d.ts.map +1 -0
  443. package/dist/renderable/codecs/index.js +70 -0
  444. package/dist/renderable/codecs/index.js.map +1 -0
  445. package/dist/renderable/codecs/patterns.d.ts +4757 -0
  446. package/dist/renderable/codecs/patterns.d.ts.map +1 -0
  447. package/dist/renderable/codecs/patterns.js +462 -0
  448. package/dist/renderable/codecs/patterns.js.map +1 -0
  449. package/dist/renderable/codecs/planning.d.ts +14055 -0
  450. package/dist/renderable/codecs/planning.d.ts.map +1 -0
  451. package/dist/renderable/codecs/planning.js +449 -0
  452. package/dist/renderable/codecs/planning.js.map +1 -0
  453. package/dist/renderable/codecs/pr-changes.d.ts +4742 -0
  454. package/dist/renderable/codecs/pr-changes.d.ts.map +1 -0
  455. package/dist/renderable/codecs/pr-changes.js +425 -0
  456. package/dist/renderable/codecs/pr-changes.js.map +1 -0
  457. package/dist/renderable/codecs/reference.d.ts +215 -0
  458. package/dist/renderable/codecs/reference.d.ts.map +1 -0
  459. package/dist/renderable/codecs/reference.js +1578 -0
  460. package/dist/renderable/codecs/reference.js.map +1 -0
  461. package/dist/renderable/codecs/reporting.d.ts +14026 -0
  462. package/dist/renderable/codecs/reporting.d.ts.map +1 -0
  463. package/dist/renderable/codecs/reporting.js +365 -0
  464. package/dist/renderable/codecs/reporting.js.map +1 -0
  465. package/dist/renderable/codecs/requirements.d.ts +4743 -0
  466. package/dist/renderable/codecs/requirements.d.ts.map +1 -0
  467. package/dist/renderable/codecs/requirements.js +428 -0
  468. package/dist/renderable/codecs/requirements.js.map +1 -0
  469. package/dist/renderable/codecs/session.d.ts +9410 -0
  470. package/dist/renderable/codecs/session.d.ts.map +1 -0
  471. package/dist/renderable/codecs/session.js +848 -0
  472. package/dist/renderable/codecs/session.js.map +1 -0
  473. package/dist/renderable/codecs/shape-matcher.d.ts +54 -0
  474. package/dist/renderable/codecs/shape-matcher.d.ts.map +1 -0
  475. package/dist/renderable/codecs/shape-matcher.js +106 -0
  476. package/dist/renderable/codecs/shape-matcher.js.map +1 -0
  477. package/dist/renderable/codecs/shared-schema.d.ts +44 -0
  478. package/dist/renderable/codecs/shared-schema.d.ts.map +1 -0
  479. package/dist/renderable/codecs/shared-schema.js +43 -0
  480. package/dist/renderable/codecs/shared-schema.js.map +1 -0
  481. package/dist/renderable/codecs/taxonomy.d.ts +4733 -0
  482. package/dist/renderable/codecs/taxonomy.d.ts.map +1 -0
  483. package/dist/renderable/codecs/taxonomy.js +570 -0
  484. package/dist/renderable/codecs/taxonomy.js.map +1 -0
  485. package/dist/renderable/codecs/timeline.d.ts +14094 -0
  486. package/dist/renderable/codecs/timeline.d.ts.map +1 -0
  487. package/dist/renderable/codecs/timeline.js +906 -0
  488. package/dist/renderable/codecs/timeline.js.map +1 -0
  489. package/dist/renderable/codecs/types/base.d.ts +81 -0
  490. package/dist/renderable/codecs/types/base.d.ts.map +1 -0
  491. package/dist/renderable/codecs/types/base.js +56 -0
  492. package/dist/renderable/codecs/types/base.js.map +1 -0
  493. package/dist/renderable/codecs/types/index.d.ts +5 -0
  494. package/dist/renderable/codecs/types/index.d.ts.map +1 -0
  495. package/dist/renderable/codecs/types/index.js +5 -0
  496. package/dist/renderable/codecs/types/index.js.map +1 -0
  497. package/dist/renderable/codecs/validation-rules.d.ts +4773 -0
  498. package/dist/renderable/codecs/validation-rules.d.ts.map +1 -0
  499. package/dist/renderable/codecs/validation-rules.js +537 -0
  500. package/dist/renderable/codecs/validation-rules.js.map +1 -0
  501. package/dist/renderable/generate.d.ts +338 -0
  502. package/dist/renderable/generate.d.ts.map +1 -0
  503. package/dist/renderable/generate.js +437 -0
  504. package/dist/renderable/generate.js.map +1 -0
  505. package/dist/renderable/index.d.ts +36 -0
  506. package/dist/renderable/index.d.ts.map +1 -0
  507. package/dist/renderable/index.js +58 -0
  508. package/dist/renderable/index.js.map +1 -0
  509. package/dist/renderable/load-preamble.d.ts +56 -0
  510. package/dist/renderable/load-preamble.d.ts.map +1 -0
  511. package/dist/renderable/load-preamble.js +298 -0
  512. package/dist/renderable/load-preamble.js.map +1 -0
  513. package/dist/renderable/render.d.ts +61 -0
  514. package/dist/renderable/render.d.ts.map +1 -0
  515. package/dist/renderable/render.js +346 -0
  516. package/dist/renderable/render.js.map +1 -0
  517. package/dist/renderable/schema.d.ts +194 -0
  518. package/dist/renderable/schema.d.ts.map +1 -0
  519. package/dist/renderable/schema.js +197 -0
  520. package/dist/renderable/schema.js.map +1 -0
  521. package/dist/renderable/utils.d.ts +146 -0
  522. package/dist/renderable/utils.d.ts.map +1 -0
  523. package/dist/renderable/utils.js +362 -0
  524. package/dist/renderable/utils.js.map +1 -0
  525. package/dist/scanner/ast-parser.d.ts +75 -0
  526. package/dist/scanner/ast-parser.d.ts.map +1 -0
  527. package/dist/scanner/ast-parser.js +835 -0
  528. package/dist/scanner/ast-parser.js.map +1 -0
  529. package/dist/scanner/gherkin-ast-parser.d.ts +166 -0
  530. package/dist/scanner/gherkin-ast-parser.d.ts.map +1 -0
  531. package/dist/scanner/gherkin-ast-parser.js +507 -0
  532. package/dist/scanner/gherkin-ast-parser.js.map +1 -0
  533. package/dist/scanner/gherkin-scanner.d.ts +106 -0
  534. package/dist/scanner/gherkin-scanner.d.ts.map +1 -0
  535. package/dist/scanner/gherkin-scanner.js +149 -0
  536. package/dist/scanner/gherkin-scanner.js.map +1 -0
  537. package/dist/scanner/index.d.ts +85 -0
  538. package/dist/scanner/index.d.ts.map +1 -0
  539. package/dist/scanner/index.js +102 -0
  540. package/dist/scanner/index.js.map +1 -0
  541. package/dist/scanner/pattern-scanner.d.ts +83 -0
  542. package/dist/scanner/pattern-scanner.d.ts.map +1 -0
  543. package/dist/scanner/pattern-scanner.js +110 -0
  544. package/dist/scanner/pattern-scanner.js.map +1 -0
  545. package/dist/taxonomy/categories.d.ts +47 -0
  546. package/dist/taxonomy/categories.d.ts.map +1 -0
  547. package/dist/taxonomy/categories.js +175 -0
  548. package/dist/taxonomy/categories.js.map +1 -0
  549. package/dist/taxonomy/claude-section-values.d.ts +12 -0
  550. package/dist/taxonomy/claude-section-values.d.ts.map +1 -0
  551. package/dist/taxonomy/claude-section-values.js +17 -0
  552. package/dist/taxonomy/claude-section-values.js.map +1 -0
  553. package/dist/taxonomy/conventions.d.ts +13 -0
  554. package/dist/taxonomy/conventions.d.ts.map +1 -0
  555. package/dist/taxonomy/conventions.js +27 -0
  556. package/dist/taxonomy/conventions.js.map +1 -0
  557. package/dist/taxonomy/deliverable-status.d.ts +99 -0
  558. package/dist/taxonomy/deliverable-status.d.ts.map +1 -0
  559. package/dist/taxonomy/deliverable-status.js +131 -0
  560. package/dist/taxonomy/deliverable-status.js.map +1 -0
  561. package/dist/taxonomy/format-types.d.ts +17 -0
  562. package/dist/taxonomy/format-types.d.ts.map +1 -0
  563. package/dist/taxonomy/format-types.js +23 -0
  564. package/dist/taxonomy/format-types.js.map +1 -0
  565. package/dist/taxonomy/generator-options.d.ts +67 -0
  566. package/dist/taxonomy/generator-options.d.ts.map +1 -0
  567. package/dist/taxonomy/generator-options.js +75 -0
  568. package/dist/taxonomy/generator-options.js.map +1 -0
  569. package/dist/taxonomy/hierarchy-levels.d.ts +23 -0
  570. package/dist/taxonomy/hierarchy-levels.d.ts.map +1 -0
  571. package/dist/taxonomy/hierarchy-levels.js +22 -0
  572. package/dist/taxonomy/hierarchy-levels.js.map +1 -0
  573. package/dist/taxonomy/index.d.ts +35 -0
  574. package/dist/taxonomy/index.d.ts.map +1 -0
  575. package/dist/taxonomy/index.js +56 -0
  576. package/dist/taxonomy/index.js.map +1 -0
  577. package/dist/taxonomy/layer-types.d.ts +22 -0
  578. package/dist/taxonomy/layer-types.d.ts.map +1 -0
  579. package/dist/taxonomy/layer-types.js +28 -0
  580. package/dist/taxonomy/layer-types.js.map +1 -0
  581. package/dist/taxonomy/normalized-status.d.ts +99 -0
  582. package/dist/taxonomy/normalized-status.d.ts.map +1 -0
  583. package/dist/taxonomy/normalized-status.js +113 -0
  584. package/dist/taxonomy/normalized-status.js.map +1 -0
  585. package/dist/taxonomy/registry-builder.d.ts +104 -0
  586. package/dist/taxonomy/registry-builder.d.ts.map +1 -0
  587. package/dist/taxonomy/registry-builder.js +561 -0
  588. package/dist/taxonomy/registry-builder.js.map +1 -0
  589. package/dist/taxonomy/risk-levels.d.ts +16 -0
  590. package/dist/taxonomy/risk-levels.d.ts.map +1 -0
  591. package/dist/taxonomy/risk-levels.js +15 -0
  592. package/dist/taxonomy/risk-levels.js.map +1 -0
  593. package/dist/taxonomy/severity-types.d.ts +6 -0
  594. package/dist/taxonomy/severity-types.d.ts.map +1 -0
  595. package/dist/taxonomy/severity-types.js +5 -0
  596. package/dist/taxonomy/severity-types.js.map +1 -0
  597. package/dist/taxonomy/status-values.d.ts +39 -0
  598. package/dist/taxonomy/status-values.d.ts.map +1 -0
  599. package/dist/taxonomy/status-values.js +42 -0
  600. package/dist/taxonomy/status-values.js.map +1 -0
  601. package/dist/types/branded.d.ts +89 -0
  602. package/dist/types/branded.d.ts.map +1 -0
  603. package/dist/types/branded.js +57 -0
  604. package/dist/types/branded.js.map +1 -0
  605. package/dist/types/errors.d.ts +342 -0
  606. package/dist/types/errors.d.ts.map +1 -0
  607. package/dist/types/errors.js +251 -0
  608. package/dist/types/errors.js.map +1 -0
  609. package/dist/types/index.d.ts +41 -0
  610. package/dist/types/index.d.ts.map +1 -0
  611. package/dist/types/index.js +5 -0
  612. package/dist/types/index.js.map +1 -0
  613. package/dist/types/result.d.ts +78 -0
  614. package/dist/types/result.d.ts.map +1 -0
  615. package/dist/types/result.js +78 -0
  616. package/dist/types/result.js.map +1 -0
  617. package/dist/utils/collection-utils.d.ts +49 -0
  618. package/dist/utils/collection-utils.d.ts.map +1 -0
  619. package/dist/utils/collection-utils.js +58 -0
  620. package/dist/utils/collection-utils.js.map +1 -0
  621. package/dist/utils/id-utils.d.ts +46 -0
  622. package/dist/utils/id-utils.d.ts.map +1 -0
  623. package/dist/utils/id-utils.js +51 -0
  624. package/dist/utils/id-utils.js.map +1 -0
  625. package/dist/utils/index.d.ts +21 -0
  626. package/dist/utils/index.d.ts.map +1 -0
  627. package/dist/utils/index.js +21 -0
  628. package/dist/utils/index.js.map +1 -0
  629. package/dist/utils/string-utils.d.ts +150 -0
  630. package/dist/utils/string-utils.d.ts.map +1 -0
  631. package/dist/utils/string-utils.js +281 -0
  632. package/dist/utils/string-utils.js.map +1 -0
  633. package/dist/validation/anti-patterns.d.ts +134 -0
  634. package/dist/validation/anti-patterns.d.ts.map +1 -0
  635. package/dist/validation/anti-patterns.js +307 -0
  636. package/dist/validation/anti-patterns.js.map +1 -0
  637. package/dist/validation/dod-validator.d.ts +94 -0
  638. package/dist/validation/dod-validator.d.ts.map +1 -0
  639. package/dist/validation/dod-validator.js +198 -0
  640. package/dist/validation/dod-validator.js.map +1 -0
  641. package/dist/validation/fsm/index.d.ts +59 -0
  642. package/dist/validation/fsm/index.d.ts.map +1 -0
  643. package/dist/validation/fsm/index.js +64 -0
  644. package/dist/validation/fsm/index.js.map +1 -0
  645. package/dist/validation/fsm/states.d.ts +93 -0
  646. package/dist/validation/fsm/states.d.ts.map +1 -0
  647. package/dist/validation/fsm/states.js +98 -0
  648. package/dist/validation/fsm/states.js.map +1 -0
  649. package/dist/validation/fsm/transitions.d.ts +100 -0
  650. package/dist/validation/fsm/transitions.d.ts.map +1 -0
  651. package/dist/validation/fsm/transitions.js +122 -0
  652. package/dist/validation/fsm/transitions.js.map +1 -0
  653. package/dist/validation/fsm/validator.d.ts +163 -0
  654. package/dist/validation/fsm/validator.d.ts.map +1 -0
  655. package/dist/validation/fsm/validator.js +205 -0
  656. package/dist/validation/fsm/validator.js.map +1 -0
  657. package/dist/validation/index.d.ts +23 -0
  658. package/dist/validation/index.d.ts.map +1 -0
  659. package/dist/validation/index.js +25 -0
  660. package/dist/validation/index.js.map +1 -0
  661. package/dist/validation/types.d.ts +136 -0
  662. package/dist/validation/types.d.ts.map +1 -0
  663. package/dist/validation/types.js +56 -0
  664. package/dist/validation/types.js.map +1 -0
  665. package/dist/validation-schemas/codec-utils.d.ts +188 -0
  666. package/dist/validation-schemas/codec-utils.d.ts.map +1 -0
  667. package/dist/validation-schemas/codec-utils.js +258 -0
  668. package/dist/validation-schemas/codec-utils.js.map +1 -0
  669. package/dist/validation-schemas/config.d.ts +99 -0
  670. package/dist/validation-schemas/config.d.ts.map +1 -0
  671. package/dist/validation-schemas/config.js +178 -0
  672. package/dist/validation-schemas/config.js.map +1 -0
  673. package/dist/validation-schemas/doc-directive.d.ts +195 -0
  674. package/dist/validation-schemas/doc-directive.d.ts.map +1 -0
  675. package/dist/validation-schemas/doc-directive.js +239 -0
  676. package/dist/validation-schemas/doc-directive.js.map +1 -0
  677. package/dist/validation-schemas/dual-source.d.ts +167 -0
  678. package/dist/validation-schemas/dual-source.d.ts.map +1 -0
  679. package/dist/validation-schemas/dual-source.js +168 -0
  680. package/dist/validation-schemas/dual-source.js.map +1 -0
  681. package/dist/validation-schemas/export-info.d.ts +53 -0
  682. package/dist/validation-schemas/export-info.d.ts.map +1 -0
  683. package/dist/validation-schemas/export-info.js +101 -0
  684. package/dist/validation-schemas/export-info.js.map +1 -0
  685. package/dist/validation-schemas/extracted-pattern.d.ts +351 -0
  686. package/dist/validation-schemas/extracted-pattern.d.ts.map +1 -0
  687. package/dist/validation-schemas/extracted-pattern.js +459 -0
  688. package/dist/validation-schemas/extracted-pattern.js.map +1 -0
  689. package/dist/validation-schemas/extracted-shape.d.ts +200 -0
  690. package/dist/validation-schemas/extracted-shape.d.ts.map +1 -0
  691. package/dist/validation-schemas/extracted-shape.js +182 -0
  692. package/dist/validation-schemas/extracted-shape.js.map +1 -0
  693. package/dist/validation-schemas/feature.d.ts +554 -0
  694. package/dist/validation-schemas/feature.d.ts.map +1 -0
  695. package/dist/validation-schemas/feature.js +262 -0
  696. package/dist/validation-schemas/feature.js.map +1 -0
  697. package/dist/validation-schemas/index.d.ts +15 -0
  698. package/dist/validation-schemas/index.d.ts.map +1 -0
  699. package/dist/validation-schemas/index.js +32 -0
  700. package/dist/validation-schemas/index.js.map +1 -0
  701. package/dist/validation-schemas/lint.d.ts +46 -0
  702. package/dist/validation-schemas/lint.d.ts.map +1 -0
  703. package/dist/validation-schemas/lint.js +45 -0
  704. package/dist/validation-schemas/lint.js.map +1 -0
  705. package/dist/validation-schemas/master-dataset.d.ts +8299 -0
  706. package/dist/validation-schemas/master-dataset.d.ts.map +1 -0
  707. package/dist/validation-schemas/master-dataset.js +275 -0
  708. package/dist/validation-schemas/master-dataset.js.map +1 -0
  709. package/dist/validation-schemas/output-schemas.d.ts +183 -0
  710. package/dist/validation-schemas/output-schemas.d.ts.map +1 -0
  711. package/dist/validation-schemas/output-schemas.js +149 -0
  712. package/dist/validation-schemas/output-schemas.js.map +1 -0
  713. package/dist/validation-schemas/scenario-ref.d.ts +80 -0
  714. package/dist/validation-schemas/scenario-ref.d.ts.map +1 -0
  715. package/dist/validation-schemas/scenario-ref.js +73 -0
  716. package/dist/validation-schemas/scenario-ref.js.map +1 -0
  717. package/dist/validation-schemas/tag-registry.d.ts +210 -0
  718. package/dist/validation-schemas/tag-registry.d.ts.map +1 -0
  719. package/dist/validation-schemas/tag-registry.js +248 -0
  720. package/dist/validation-schemas/tag-registry.js.map +1 -0
  721. package/dist/validation-schemas/workflow-config.d.ts +125 -0
  722. package/dist/validation-schemas/workflow-config.d.ts.map +1 -0
  723. package/dist/validation-schemas/workflow-config.js +138 -0
  724. package/dist/validation-schemas/workflow-config.js.map +1 -0
  725. package/docs/ANNOTATION-GUIDE.md +271 -0
  726. package/docs/ARCHITECTURE.md +1636 -0
  727. package/docs/CONFIGURATION.md +337 -0
  728. package/docs/DOCS-GAP-ANALYSIS.md +811 -0
  729. package/docs/GHERKIN-PATTERNS.md +366 -0
  730. package/docs/INDEX.md +345 -0
  731. package/docs/MCP-SETUP.md +140 -0
  732. package/docs/METHODOLOGY.md +240 -0
  733. package/docs/PROCESS-API.md +65 -0
  734. package/docs/PROCESS-GUARD.md +341 -0
  735. package/docs/SESSION-GUIDES.md +391 -0
  736. package/docs/TAXONOMY.md +106 -0
  737. package/docs/VALIDATION.md +418 -0
  738. package/docs-live/ARCHITECTURE.md +362 -0
  739. package/docs-live/BUSINESS-RULES.md +24 -0
  740. package/docs-live/CHANGELOG-GENERATED.md +375 -0
  741. package/docs-live/DECISIONS.md +78 -0
  742. package/docs-live/INDEX.md +231 -0
  743. package/docs-live/PRODUCT-AREAS.md +255 -0
  744. package/docs-live/TAXONOMY.md +202 -0
  745. package/docs-live/VALIDATION-RULES.md +119 -0
  746. package/docs-live/_claude-md/annotation/annotation-overview.md +26 -0
  747. package/docs-live/_claude-md/annotation/annotation-reference.md +213 -0
  748. package/docs-live/_claude-md/architecture/architecture-codecs.md +160 -0
  749. package/docs-live/_claude-md/architecture/architecture-types.md +32 -0
  750. package/docs-live/_claude-md/architecture/reference-sample.md +162 -0
  751. package/docs-live/_claude-md/authoring/gherkin-authoring-guide.md +245 -0
  752. package/docs-live/_claude-md/configuration/configuration-guide.md +216 -0
  753. package/docs-live/_claude-md/configuration/configuration-overview.md +37 -0
  754. package/docs-live/_claude-md/core-types/core-types-overview.md +20 -0
  755. package/docs-live/_claude-md/data-api/data-api-overview.md +39 -0
  756. package/docs-live/_claude-md/generation/generation-overview.md +30 -0
  757. package/docs-live/_claude-md/process/process-overview.md +127 -0
  758. package/docs-live/_claude-md/validation/process-guard.md +185 -0
  759. package/docs-live/_claude-md/validation/validation-overview.md +37 -0
  760. package/docs-live/_claude-md/validation/validation-tools-guide.md +242 -0
  761. package/docs-live/_claude-md/workflow/session-workflow-guide.md +141 -0
  762. package/docs-live/business-rules/annotation.md +1462 -0
  763. package/docs-live/business-rules/configuration.md +465 -0
  764. package/docs-live/business-rules/core-types.md +531 -0
  765. package/docs-live/business-rules/data-api.md +1403 -0
  766. package/docs-live/business-rules/generation.md +4726 -0
  767. package/docs-live/business-rules/process.md +122 -0
  768. package/docs-live/business-rules/validation.md +998 -0
  769. package/docs-live/decisions/adr-001-taxonomy-canonical-values.md +197 -0
  770. package/docs-live/decisions/adr-002-gherkin-only-testing.md +57 -0
  771. package/docs-live/decisions/adr-003-source-first-pattern-architecture.md +147 -0
  772. package/docs-live/decisions/adr-004-session-workflow-commands.md +137 -0
  773. package/docs-live/decisions/adr-005-codec-based-markdown-rendering.md +150 -0
  774. package/docs-live/decisions/adr-006-single-read-model-architecture.md +136 -0
  775. package/docs-live/decisions/adr-021-doc-generation-proof-of-concept.md +489 -0
  776. package/docs-live/product-areas/ANNOTATION.md +591 -0
  777. package/docs-live/product-areas/CONFIGURATION.md +1048 -0
  778. package/docs-live/product-areas/CORE-TYPES.md +221 -0
  779. package/docs-live/product-areas/DATA-API.md +850 -0
  780. package/docs-live/product-areas/GENERATION.md +1200 -0
  781. package/docs-live/product-areas/PROCESS.md +351 -0
  782. package/docs-live/product-areas/VALIDATION.md +1135 -0
  783. package/docs-live/reference/ANNOTATION-REFERENCE.md +232 -0
  784. package/docs-live/reference/ARCHITECTURE-CODECS.md +675 -0
  785. package/docs-live/reference/ARCHITECTURE-TYPES.md +436 -0
  786. package/docs-live/reference/CONFIGURATION-GUIDE.md +235 -0
  787. package/docs-live/reference/GHERKIN-AUTHORING-GUIDE.md +270 -0
  788. package/docs-live/reference/PROCESS-API-RECIPES.md +476 -0
  789. package/docs-live/reference/PROCESS-API-REFERENCE.md +63 -0
  790. package/docs-live/reference/PROCESS-GUARD-REFERENCE.md +258 -0
  791. package/docs-live/reference/REFERENCE-SAMPLE.md +1135 -0
  792. package/docs-live/reference/SESSION-WORKFLOW-GUIDE.md +384 -0
  793. package/docs-live/reference/VALIDATION-TOOLS-GUIDE.md +263 -0
  794. package/docs-live/taxonomy/categories.md +33 -0
  795. package/docs-live/taxonomy/format-types.md +67 -0
  796. package/docs-live/taxonomy/metadata-tags.md +693 -0
  797. package/docs-live/validation/error-catalog.md +78 -0
  798. package/docs-live/validation/fsm-transitions.md +50 -0
  799. package/docs-live/validation/protection-levels.md +51 -0
  800. package/package.json +233 -0
@@ -0,0 +1,850 @@
1
+ # DataAPI Overview
2
+
3
+ **Purpose:** DataAPI product area overview
4
+ **Detail Level:** Full reference
5
+
6
+ ---
7
+
8
+ **How do I query process state?** The Data API provides direct terminal access to project state. It replaces reading generated markdown or launching explore agents — targeted queries use 5-10x less context. The `context` command assembles curated bundles tailored to session type (planning, design, implement).
9
+
10
+ ## Key Invariants
11
+
12
+ - One-command context assembly: `context <pattern> --session <type>` returns metadata + file paths + dependency status + architecture position in ~1.5KB
13
+ - Session type tailoring: `planning` (~500B, brief + deps), `design` (~1.5KB, spec + stubs + deps), `implement` (deliverables + FSM + tests)
14
+ - Direct API queries replace doc reading: JSON output is 5-10x smaller than generated docs
15
+
16
+ ---
17
+
18
+ ## Contents
19
+
20
+ - [Key Invariants](#key-invariants)
21
+ - [Shared Pipeline Factory Responsibilities](#shared-pipeline-factory-responsibilities)
22
+ - [8-Step Dataset Build Flow](#8-step-dataset-build-flow)
23
+ - [Consumer Architecture and PipelineOptions Differentiation](#consumer-architecture-and-pipelineoptions-differentiation)
24
+ - [DataAPI Components](#dataapi-components)
25
+ - [API Types](#api-types)
26
+ - [Business Rules](#business-rules)
27
+
28
+ ---
29
+
30
+ ## Shared Pipeline Factory Responsibilities
31
+
32
+ **Invariant:** `buildMasterDataset()` is the shared factory for Steps 1-8 of the architecture pipeline and returns `Result<PipelineResult, PipelineError>` without process-level side effects.
33
+
34
+ **Rationale:** Centralizing scan/extract/merge/transform flow prevents divergence between CLI consumers and preserves a single ADR-006 read-model path.
35
+
36
+ ---
37
+
38
+ ## 8-Step Dataset Build Flow
39
+
40
+ The factory owns: configuration load, TypeScript scan + extraction, Gherkin scan +
41
+ extraction, merge conflict handling, hierarchy child derivation, workflow load,
42
+ and `transformToMasterDataset` with validation summary.
43
+
44
+ ---
45
+
46
+ ## Consumer Architecture and PipelineOptions Differentiation
47
+
48
+ Three consumers share this factory: `process-api`, `validate-patterns`, and the
49
+ generation orchestrator. `PipelineOptions` differentiates behavior by
50
+ `mergeConflictStrategy` (`fatal` vs `concatenate`), `includeValidation` toggles,
51
+ and `failOnScanErrors` policy without forking pipeline logic.
52
+
53
+ ### When to Use
54
+
55
+ - Any consumer needs a MasterDataset without rewriting scan/extract/merge flow
56
+ - CLI consumers require differentiated conflict strategy and validation behavior
57
+ - Orchestrator needs a shared steps 1-8 implementation before codec/file execution
58
+
59
+ ---
60
+
61
+ ## DataAPI Components
62
+
63
+ Scoped architecture diagram showing component relationships:
64
+
65
+ ```mermaid
66
+ graph TB
67
+ subgraph api["Api"]
68
+ MasterDataset[/"MasterDataset"/]
69
+ MCPToolRegistry("MCPToolRegistry")
70
+ MCPServerImpl("MCPServerImpl")
71
+ MCPPipelineSession("MCPPipelineSession")
72
+ MCPModule[/"MCPModule"/]
73
+ MCPFileWatcher[/"MCPFileWatcher"/]
74
+ PatternSummarizerImpl("PatternSummarizerImpl")
75
+ ScopeValidatorImpl("ScopeValidatorImpl")
76
+ ProcessStateAPI("ProcessStateAPI")
77
+ PatternHelpers["PatternHelpers"]
78
+ HandoffGeneratorImpl("HandoffGeneratorImpl")
79
+ FuzzyMatcherImpl("FuzzyMatcherImpl")
80
+ CoverageAnalyzerImpl("CoverageAnalyzerImpl")
81
+ ContextFormatterImpl("ContextFormatterImpl")
82
+ ContextAssemblerImpl("ContextAssemblerImpl")
83
+ ArchQueriesImpl("ArchQueriesImpl")
84
+ end
85
+ subgraph cli["Cli"]
86
+ ReplMode("ReplMode")
87
+ ProcessAPICLIImpl("ProcessAPICLIImpl")
88
+ OutputPipelineImpl("OutputPipelineImpl")
89
+ MCPServerBin[/"MCPServerBin"/]
90
+ DatasetCache[/"DatasetCache"/]
91
+ CLISchema["CLISchema"]
92
+ end
93
+ subgraph related["Related"]
94
+ WorkflowConfigSchema["WorkflowConfigSchema"]:::neighbor
95
+ Pattern_Scanner["Pattern Scanner"]:::neighbor
96
+ ConfigLoader["ConfigLoader"]:::neighbor
97
+ StubResolverImpl["StubResolverImpl"]:::neighbor
98
+ RulesQueryModule["RulesQueryModule"]:::neighbor
99
+ FSMValidator["FSMValidator"]:::neighbor
100
+ PipelineFactory["PipelineFactory"]:::neighbor
101
+ ProcessStateAPICLI["ProcessStateAPICLI"]:::neighbor
102
+ ProcessApiHybridGeneration["ProcessApiHybridGeneration"]:::neighbor
103
+ PhaseStateMachineValidation["PhaseStateMachineValidation"]:::neighbor
104
+ MCPServerIntegration["MCPServerIntegration"]:::neighbor
105
+ DataAPIDesignSessionSupport["DataAPIDesignSessionSupport"]:::neighbor
106
+ DataAPIOutputShaping["DataAPIOutputShaping"]:::neighbor
107
+ DataAPIContextAssembly["DataAPIContextAssembly"]:::neighbor
108
+ DataAPICLIErgonomics["DataAPICLIErgonomics"]:::neighbor
109
+ DataAPIArchitectureQueries["DataAPIArchitectureQueries"]:::neighbor
110
+ end
111
+ MCPToolRegistry -->|uses| ProcessStateAPI
112
+ MCPToolRegistry -->|uses| MCPPipelineSession
113
+ MCPToolRegistry ..->|implements| MCPServerIntegration
114
+ MCPServerImpl -->|uses| MCPPipelineSession
115
+ MCPServerImpl -->|uses| MCPToolRegistry
116
+ MCPServerImpl -->|uses| MCPFileWatcher
117
+ MCPServerImpl ..->|implements| MCPServerIntegration
118
+ MCPPipelineSession -->|uses| PipelineFactory
119
+ MCPPipelineSession -->|uses| ProcessStateAPI
120
+ MCPPipelineSession -->|uses| ConfigLoader
121
+ MCPPipelineSession ..->|implements| MCPServerIntegration
122
+ MCPModule -->|uses| MCPServerImpl
123
+ MCPModule -->|uses| MCPPipelineSession
124
+ MCPModule -->|uses| MCPFileWatcher
125
+ MCPModule -->|uses| MCPToolRegistry
126
+ MCPFileWatcher ..->|implements| MCPServerIntegration
127
+ ReplMode -->|uses| PipelineFactory
128
+ ReplMode -->|uses| ProcessStateAPI
129
+ ReplMode ..->|implements| DataAPICLIErgonomics
130
+ ProcessAPICLIImpl -->|uses| ProcessStateAPI
131
+ ProcessAPICLIImpl -->|uses| MasterDataset
132
+ ProcessAPICLIImpl -->|uses| PipelineFactory
133
+ ProcessAPICLIImpl -->|uses| RulesQueryModule
134
+ ProcessAPICLIImpl -->|uses| PatternSummarizerImpl
135
+ ProcessAPICLIImpl -->|uses| FuzzyMatcherImpl
136
+ ProcessAPICLIImpl -->|uses| OutputPipelineImpl
137
+ ProcessAPICLIImpl ..->|implements| ProcessStateAPICLI
138
+ OutputPipelineImpl -->|uses| PatternSummarizerImpl
139
+ OutputPipelineImpl ..->|implements| DataAPIOutputShaping
140
+ MCPServerBin -->|uses| MCPServerImpl
141
+ MCPServerBin ..->|implements| MCPServerIntegration
142
+ DatasetCache -->|uses| PipelineFactory
143
+ DatasetCache -->|uses| WorkflowConfigSchema
144
+ DatasetCache ..->|implements| DataAPICLIErgonomics
145
+ CLISchema ..->|implements| ProcessApiHybridGeneration
146
+ PatternSummarizerImpl -->|uses| ProcessStateAPI
147
+ PatternSummarizerImpl ..->|implements| DataAPIOutputShaping
148
+ ScopeValidatorImpl -->|uses| ProcessStateAPI
149
+ ScopeValidatorImpl -->|uses| MasterDataset
150
+ ScopeValidatorImpl -->|uses| StubResolverImpl
151
+ ScopeValidatorImpl ..->|implements| DataAPIDesignSessionSupport
152
+ ProcessStateAPI -->|uses| MasterDataset
153
+ ProcessStateAPI -->|uses| FSMValidator
154
+ ProcessStateAPI ..->|implements| PhaseStateMachineValidation
155
+ PatternHelpers ..->|implements| DataAPIOutputShaping
156
+ HandoffGeneratorImpl -->|uses| ProcessStateAPI
157
+ HandoffGeneratorImpl -->|uses| MasterDataset
158
+ HandoffGeneratorImpl -->|uses| ContextFormatterImpl
159
+ HandoffGeneratorImpl ..->|implements| DataAPIDesignSessionSupport
160
+ FuzzyMatcherImpl ..->|implements| DataAPIOutputShaping
161
+ CoverageAnalyzerImpl -->|uses| Pattern_Scanner
162
+ CoverageAnalyzerImpl -->|uses| MasterDataset
163
+ CoverageAnalyzerImpl ..->|implements| DataAPIArchitectureQueries
164
+ ContextFormatterImpl -->|uses| ContextAssemblerImpl
165
+ ContextFormatterImpl ..->|implements| DataAPIContextAssembly
166
+ ContextAssemblerImpl -->|uses| ProcessStateAPI
167
+ ContextAssemblerImpl -->|uses| MasterDataset
168
+ ContextAssemblerImpl -->|uses| PatternSummarizerImpl
169
+ ContextAssemblerImpl -->|uses| FuzzyMatcherImpl
170
+ ContextAssemblerImpl -->|uses| StubResolverImpl
171
+ ContextAssemblerImpl ..->|implements| DataAPIContextAssembly
172
+ ArchQueriesImpl -->|uses| ProcessStateAPI
173
+ ArchQueriesImpl -->|uses| MasterDataset
174
+ ArchQueriesImpl ..->|implements| DataAPIArchitectureQueries
175
+ StubResolverImpl -->|uses| ProcessStateAPI
176
+ FSMValidator ..->|implements| PhaseStateMachineValidation
177
+ PipelineFactory -->|uses| MasterDataset
178
+ MCPServerIntegration -.->|depends on| DataAPICLIErgonomics
179
+ DataAPIDesignSessionSupport -.->|depends on| DataAPIContextAssembly
180
+ DataAPIContextAssembly -.->|depends on| DataAPIOutputShaping
181
+ DataAPIArchitectureQueries -.->|depends on| DataAPIOutputShaping
182
+ classDef neighbor stroke-dasharray: 5 5
183
+ ```
184
+
185
+ ---
186
+
187
+ ## API Types
188
+
189
+ ### PipelineOptions (interface)
190
+
191
+ ```typescript
192
+ /**
193
+ * Options for building a MasterDataset via the shared pipeline.
194
+ *
195
+ * DD-1: Factory lives at src/generators/pipeline/build-pipeline.ts.
196
+ * DD-2: mergeConflictStrategy controls per-consumer conflict handling.
197
+ * DD-3: exclude, contextInferenceRules support future orchestrator
198
+ * migration without breaking changes.
199
+ *
200
+ */
201
+ ```
202
+
203
+ ```typescript
204
+ interface PipelineOptions {
205
+ readonly input: readonly string[];
206
+ readonly features: readonly string[];
207
+ readonly baseDir: string;
208
+ readonly mergeConflictStrategy: 'fatal' | 'concatenate';
209
+ readonly exclude?: readonly string[];
210
+ readonly workflowPath?: string;
211
+ readonly contextInferenceRules?: readonly ContextInferenceRule[];
212
+ /** DD-3: When false, skip validation pass (default true). */
213
+ readonly includeValidation?: boolean;
214
+ /** DD-5: When true, return error on individual scan failures (default false). */
215
+ readonly failOnScanErrors?: boolean;
216
+ }
217
+ ```
218
+
219
+ | Property | Description |
220
+ | ----------------- | -------------------------------------------------------------------------- |
221
+ | includeValidation | DD-3: When false, skip validation pass (default true). |
222
+ | failOnScanErrors | DD-5: When true, return error on individual scan failures (default false). |
223
+
224
+ ### PipelineResult (interface)
225
+
226
+ ```typescript
227
+ /**
228
+ * Successful pipeline result containing the dataset and validation summary.
229
+ *
230
+ */
231
+ ```
232
+
233
+ ```typescript
234
+ interface PipelineResult {
235
+ readonly dataset: RuntimeMasterDataset;
236
+ readonly validation: ValidationSummary;
237
+ readonly warnings: readonly PipelineWarning[];
238
+ readonly scanMetadata: ScanMetadata;
239
+ }
240
+ ```
241
+
242
+ ### MasterDatasetSchema (const)
243
+
244
+ ```typescript
245
+ /**
246
+ * Master Dataset - Unified view of all extracted patterns
247
+ *
248
+ * Contains raw patterns plus pre-computed views and statistics.
249
+ * This is the primary data structure passed to generators and sections.
250
+ *
251
+ */
252
+ ```
253
+
254
+ ```typescript
255
+ MasterDatasetSchema = z.object({
256
+ // ─────────────────────────────────────────────────────────────────────────
257
+ // Raw Data
258
+ // ─────────────────────────────────────────────────────────────────────────
259
+
260
+ /** All extracted patterns (both TypeScript and Gherkin) */
261
+ patterns: z.array(ExtractedPatternSchema),
262
+
263
+ /** Tag registry for category lookups */
264
+ tagRegistry: TagRegistrySchema,
265
+
266
+ // Note: workflow is not in the Zod schema because LoadedWorkflow contains Maps
267
+ // (statusMap, phaseMap) which are not JSON-serializable. When workflow access
268
+ // is needed, get it from SectionContext/GeneratorContext instead.
269
+
270
+ // ─────────────────────────────────────────────────────────────────────────
271
+ // Pre-computed Views
272
+ // ─────────────────────────────────────────────────────────────────────────
273
+
274
+ /** Patterns grouped by normalized status */
275
+ byStatus: StatusGroupsSchema,
276
+
277
+ /** Patterns grouped by phase number (sorted ascending) */
278
+ byPhase: z.array(PhaseGroupSchema),
279
+
280
+ /** Patterns grouped by quarter (e.g., "Q4-2024") */
281
+ byQuarter: z.record(z.string(), z.array(ExtractedPatternSchema)),
282
+
283
+ /** Patterns grouped by category */
284
+ byCategory: z.record(z.string(), z.array(ExtractedPatternSchema)),
285
+
286
+ /** Patterns grouped by source type */
287
+ bySource: SourceViewsSchema,
288
+
289
+ /** Patterns grouped by product area (for O(1) product area lookups) */
290
+ byProductArea: z.record(z.string(), z.array(ExtractedPatternSchema)),
291
+
292
+ // ─────────────────────────────────────────────────────────────────────────
293
+ // Aggregate Statistics
294
+ // ─────────────────────────────────────────────────────────────────────────
295
+
296
+ /** Overall status counts */
297
+ counts: StatusCountsSchema,
298
+
299
+ /** Number of distinct phases */
300
+ phaseCount: z.number().int().nonnegative(),
301
+
302
+ /** Number of distinct categories */
303
+ categoryCount: z.number().int().nonnegative(),
304
+
305
+ // ─────────────────────────────────────────────────────────────────────────
306
+ // Relationship Data (optional)
307
+ // ─────────────────────────────────────────────────────────────────────────
308
+
309
+ /** Optional relationship index for dependency graph */
310
+ relationshipIndex: z.record(z.string(), RelationshipEntrySchema).optional(),
311
+
312
+ // ─────────────────────────────────────────────────────────────────────────
313
+ // Architecture Data (optional)
314
+ // ─────────────────────────────────────────────────────────────────────────
315
+
316
+ /** Optional architecture index for diagram generation */
317
+ archIndex: ArchIndexSchema.optional(),
318
+
319
+ // ─────────────────────────────────────────────────────────────────────────
320
+ // Sequence Data (optional)
321
+ // ─────────────────────────────────────────────────────────────────────────
322
+
323
+ /** Optional sequence index for design review diagram generation */
324
+ sequenceIndex: SequenceIndexSchema.optional(),
325
+ });
326
+ ```
327
+
328
+ ### StatusGroupsSchema (const)
329
+
330
+ ```typescript
331
+ /**
332
+ * Status-based grouping of patterns
333
+ *
334
+ * Patterns are normalized to three canonical states:
335
+ * - completed: completed
336
+ * - active: active
337
+ * - planned: roadmap, deferred, or undefined/unknown
338
+ *
339
+ */
340
+ ```
341
+
342
+ ```typescript
343
+ StatusGroupsSchema = z.object({
344
+ /** Patterns with status 'completed' */
345
+ completed: z.array(ExtractedPatternSchema),
346
+
347
+ /** Patterns with status 'active' */
348
+ active: z.array(ExtractedPatternSchema),
349
+
350
+ /** Patterns with status 'roadmap', 'deferred', or undefined/unknown */
351
+ planned: z.array(ExtractedPatternSchema),
352
+ });
353
+ ```
354
+
355
+ ### StatusCountsSchema (const)
356
+
357
+ ```typescript
358
+ /**
359
+ * Status counts for aggregate statistics
360
+ *
361
+ */
362
+ ```
363
+
364
+ ```typescript
365
+ StatusCountsSchema = z.object({
366
+ /** Number of completed patterns */
367
+ completed: z.number().int().nonnegative(),
368
+
369
+ /** Number of active patterns */
370
+ active: z.number().int().nonnegative(),
371
+
372
+ /** Number of planned patterns */
373
+ planned: z.number().int().nonnegative(),
374
+
375
+ /** Total number of patterns */
376
+ total: z.number().int().nonnegative(),
377
+ });
378
+ ```
379
+
380
+ ### PhaseGroupSchema (const)
381
+
382
+ ```typescript
383
+ /**
384
+ * Phase grouping with patterns and counts
385
+ *
386
+ * Groups patterns by their phase number, with pre-computed
387
+ * status counts for each phase.
388
+ *
389
+ */
390
+ ```
391
+
392
+ ```typescript
393
+ PhaseGroupSchema = z.object({
394
+ /** Phase number (e.g., 1, 2, 3, 14, 39) */
395
+ phaseNumber: z.number().int(),
396
+
397
+ /** Optional phase name from workflow config */
398
+ phaseName: z.string().optional(),
399
+
400
+ /** Patterns in this phase */
401
+ patterns: z.array(ExtractedPatternSchema),
402
+
403
+ /** Pre-computed status counts for this phase */
404
+ counts: StatusCountsSchema,
405
+ });
406
+ ```
407
+
408
+ ### SourceViewsSchema (const)
409
+
410
+ ```typescript
411
+ /**
412
+ * Source-based views for different data origins
413
+ *
414
+ */
415
+ ```
416
+
417
+ ```typescript
418
+ SourceViewsSchema = z.object({
419
+ /** Patterns from TypeScript files (.ts) */
420
+ typescript: z.array(ExtractedPatternSchema),
421
+
422
+ /** Patterns from Gherkin feature files (.feature) */
423
+ gherkin: z.array(ExtractedPatternSchema),
424
+
425
+ /** Patterns with phase metadata (roadmap items) */
426
+ roadmap: z.array(ExtractedPatternSchema),
427
+
428
+ /** Patterns with PRD metadata (productArea, userRole, businessValue) */
429
+ prd: z.array(ExtractedPatternSchema),
430
+ });
431
+ ```
432
+
433
+ ### RelationshipEntrySchema (const)
434
+
435
+ ```typescript
436
+ /**
437
+ * Relationship index for dependency tracking
438
+ *
439
+ * Maps pattern names to their relationship metadata.
440
+ *
441
+ */
442
+ ```
443
+
444
+ ```typescript
445
+ RelationshipEntrySchema = z.object({
446
+ /** Patterns this pattern uses (from @architect-uses) */
447
+ uses: z.array(z.string()),
448
+
449
+ /** Patterns that use this pattern (from @architect-used-by) */
450
+ usedBy: z.array(z.string()),
451
+
452
+ /** Patterns this pattern depends on (from @architect-depends-on) */
453
+ dependsOn: z.array(z.string()),
454
+
455
+ /** Patterns this pattern enables (from @architect-enables) */
456
+ enables: z.array(z.string()),
457
+
458
+ // UML-inspired relationship fields (PatternRelationshipModel)
459
+ /** Patterns this item implements (realization relationship) */
460
+ implementsPatterns: z.array(z.string()),
461
+
462
+ /** Files/patterns that implement this pattern (computed inverse with file paths) */
463
+ implementedBy: z.array(ImplementationRefSchema),
464
+
465
+ /** Pattern this extends (generalization relationship) */
466
+ extendsPattern: z.string().optional(),
467
+
468
+ /** Patterns that extend this pattern (computed inverse) */
469
+ extendedBy: z.array(z.string()),
470
+
471
+ /** Related patterns for cross-reference without dependency (from @architect-see-also tag) */
472
+ seeAlso: z.array(z.string()),
473
+
474
+ /** File paths to implementation APIs (from @architect-api-ref tag) */
475
+ apiRef: z.array(z.string()),
476
+ });
477
+ ```
478
+
479
+ ### ArchIndexSchema (const)
480
+
481
+ ```typescript
482
+ /**
483
+ * Architecture index for diagram generation
484
+ *
485
+ * Groups patterns by architectural metadata for rendering component diagrams.
486
+ */
487
+ ```
488
+
489
+ ```typescript
490
+ ArchIndexSchema = z.object({
491
+ /** Patterns grouped by arch-role (bounded-context, projection, saga, etc.) */
492
+ byRole: z.record(z.string(), z.array(ExtractedPatternSchema)),
493
+
494
+ /** Patterns grouped by arch-context (orders, inventory, etc.) */
495
+ byContext: z.record(z.string(), z.array(ExtractedPatternSchema)),
496
+
497
+ /** Patterns grouped by arch-layer (domain, application, infrastructure) */
498
+ byLayer: z.record(z.string(), z.array(ExtractedPatternSchema)),
499
+
500
+ /** Patterns grouped by include tag (cross-cutting content routing and diagram scoping) */
501
+ byView: z.record(z.string(), z.array(ExtractedPatternSchema)),
502
+
503
+ /** Patterns with any architecture metadata (for diagram generation) */
504
+ all: z.array(ExtractedPatternSchema),
505
+ });
506
+ ```
507
+
508
+ ---
509
+
510
+ ## Business Rules
511
+
512
+ 38 patterns, 146 rules with invariants (146 total)
513
+
514
+ ### Arch Queries Test
515
+
516
+ | Rule | Invariant | Rationale |
517
+ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
518
+ | Neighborhood and comparison views | The architecture query API must provide pattern neighborhood views (direct connections) and cross-context comparison views (shared/unique dependencies), returning undefined for nonexistent patterns. | Neighborhood and comparison views are the primary navigation tools for understanding architecture — without them, developers must manually trace relationship chains across files. |
519
+ | Taxonomy discovery via tags and sources | The API must aggregate tag values with counts across all patterns and categorize source files by type, returning empty reports when no patterns match. | Tag aggregation reveals annotation coverage gaps and source inventory helps teams understand their codebase composition — both are essential for project health monitoring. |
520
+ | Coverage analysis reports annotation completeness | Coverage analysis must detect unused taxonomy entries, cross-context integration points, and include all relationship types (implements, dependsOn, enables) in neighborhood views. | Unused taxonomy entries indicate dead configuration while missing relationship types produce incomplete architecture views — both degrade the reliability of generated documentation. |
521
+
522
+ ### Context Assembler Tests
523
+
524
+ | Rule | Invariant | Rationale |
525
+ | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
526
+ | assembleContext produces session-tailored context bundles | Each session type (design/planning/implement) must include exactly the context sections defined by its profile — no more, no less. | Over-fetching wastes AI context window tokens; under-fetching causes the agent to make uninformed decisions. |
527
+ | buildDepTree walks dependency chains with cycle detection | The dependency tree must walk the full chain up to the depth limit, mark the focal node, and terminate safely on circular references. | Dependency chains reveal implementation prerequisites — cycles and infinite recursion would crash the CLI. |
528
+ | buildOverview provides executive project summary | The overview must include progress counts (completed/active/planned), active phase listing, and blocking dependencies. | The overview is the first command in every session start recipe — it must provide a complete project health snapshot. |
529
+ | buildFileReadingList returns paths by relevance | Primary files (spec, implementation) must always be included; related files (dependency implementations) are included only when requested. | File reading lists power the "what to read" guidance — relevance sorting ensures the most important files are read first within token budgets. |
530
+
531
+ ### Context Formatter Tests
532
+
533
+ | Rule | Invariant | Rationale |
534
+ | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
535
+ | formatContextBundle renders section markers | The context formatter must render section markers for all populated sections in a context bundle, with design bundles rendering all sections and implement bundles focusing on deliverables and FSM. | Section markers enable structured parsing of context output — without them, AI consumers cannot reliably extract specific sections from the formatted bundle. |
536
+ | formatDepTree renders indented tree | The dependency tree formatter must render with indentation arrows and a focal pattern marker to visually distinguish the target pattern from its dependencies. | Visual hierarchy in the dependency tree makes dependency chains scannable at a glance — flat output would require mental parsing to understand depth and relationships. |
537
+ | formatOverview renders progress summary | The overview formatter must render a progress summary line showing completion metrics for the project and point users to the current query script name. | The progress line is the first thing developers see when starting a session — it provides immediate project health awareness, and the follow-up command guidance must be copy-pasteable. |
538
+ | formatFileReadingList renders categorized file paths | The file reading list formatter must categorize paths into primary and dependency sections, producing minimal output when the list is empty. | Categorized file lists tell developers which files to read first (primary) versus reference (dependency) — uncategorized lists waste time on low-priority files. |
539
+
540
+ ### Data API Architecture Queries
541
+
542
+ | Rule | Invariant | Rationale |
543
+ | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
544
+ | Arch subcommand provides neighborhood and comparison views | Architecture queries resolve pattern names to concrete relationships and file paths, not just abstract names. | The current `arch graph <pattern>` returns dependency and relationship names but not the full picture of what surrounds a pattern. Design sessions need to understand: "If I'm working on X, what else is directly connected?" and "How do contexts A and B relate?" |
545
+ | Coverage analysis reports annotation completeness with gaps | Coverage reports identify unannotated files that should have the @architect opt-in marker based on their location and content. | Annotation completeness directly impacts the quality of all generated documentation and API queries. Files without the opt-in marker are invisible to the pipeline. Coverage gaps mean missing patterns in the registry, incomplete dependency graphs, and blind spots in architecture views. |
546
+ | Tags and sources commands provide taxonomy and inventory views | All tag values in use are discoverable without reading configuration files. Source file inventory shows the full scope of annotated and scanned content. | Agents frequently need to know "what categories exist?" or "how many feature files are there?" without reading taxonomy configuration. These are meta-queries about the annotation system itself, essential for writing new annotations correctly and understanding scope. |
547
+
548
+ ### Data API CLI Ergonomics
549
+
550
+ | Rule | Invariant | Rationale |
551
+ | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
552
+ | MasterDataset is cached between invocations with file-change invalidation | Cache is automatically invalidated when any source file (TypeScript or Gherkin) has a modification time newer than the cache. | The pipeline (scan -> extract -> transform) runs fresh on every invocation (~2-5 seconds). Most queries during a session don't need fresh data -- the source files haven't changed between queries. Caching the MasterDataset to a temp file with file-modification-time invalidation makes subsequent queries instant while ensuring staleness is impossible. |
553
+ | REPL mode keeps pipeline loaded for interactive multi-query sessions | REPL mode loads the pipeline once and accepts multiple queries on stdin, with optional tab completion for pattern names and subcommands. | Design sessions often involve 10-20 exploratory queries in sequence (check status, look up pattern, check deps, look up another pattern). REPL mode eliminates per-query pipeline overhead entirely. |
554
+ | Per-subcommand help and diagnostic modes aid discoverability | Every subcommand supports `--help` with usage, flags, and examples. Dry-run shows pipeline scope without executing. | AI agents read `--help` output to discover available commands and flags. Without per-subcommand help, agents must read external documentation. Dry-run mode helps diagnose "why no patterns found?" issues by showing what would be scanned. |
555
+
556
+ ### Data API Context Assembly
557
+
558
+ | Rule | Invariant | Rationale |
559
+ | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
560
+ | Context command assembles curated context for a single pattern | Given a pattern name, `context` returns everything needed to start working on that pattern: metadata, file locations, dependency status, and architecture position -- in ~1.5KB of structured text. | This is the core value proposition. The command crosses five gaps simultaneously: it assembles data from multiple MasterDataset indexes, shapes it compactly, resolves file paths from pattern names, discovers stubs by convention, and tailors output by session type. |
561
+ | Files command returns only file paths organized by relevance | `files` returns the most token-efficient output possible -- just file paths that Claude Code can read directly. | Most context tokens are spent reading actual files, not metadata. The `files` command tells Claude Code _which_ files to read, organized by importance. Claude Code then reads what it needs. This is more efficient than `context` when the agent already knows the pattern and just needs the file list. |
562
+ | Dep-tree command shows recursive dependency chain with status | The dependency tree walks both `dependsOn`/`enables` (planning) and `uses`/`usedBy` (implementation) relationships with configurable depth. | Before starting work on a pattern, agents need to know the full dependency chain: what must be complete first, what this unblocks, and where the current pattern sits in the sequence. A tree visualization with status markers makes blocking relationships immediately visible. |
563
+ | Context command supports multiple patterns with merged output | Multi-pattern context deduplicates shared dependencies and highlights overlap between patterns. | Design sessions often span multiple related patterns (e.g., reviewing DS-2 through DS-5 together). Separate `context` calls would duplicate shared dependencies. Merged context shows the union of all dependencies with overlap analysis. |
564
+ | Overview provides executive project summary | `overview` returns project-wide health in one command. | Planning sessions start with "where are we?" This command answers that question without needing to run multiple queries and mentally aggregate results. Implementation readiness checks for specific patterns live in DataAPIDesignSessionSupport's `scope-validate` command. |
565
+
566
+ ### Data API Design Session Support
567
+
568
+ | Rule | Invariant | Rationale |
569
+ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
570
+ | Scope-validate checks implementation prerequisites before session start | Scope validation surfaces all blocking conditions before committing to a session, preventing wasted effort on unready patterns. | Starting implementation on a pattern with incomplete dependencies wastes an entire session. Starting a design session without prior session deliverables means working with incomplete context. Pre-flight validation catches these issues in seconds rather than discovering them mid-session. |
571
+ | Handoff generates compact session state summary for multi-session work | Handoff documentation captures everything the next session needs to continue work without context loss. | Multi-session work (common for design phases spanning DS-1 through DS-7) requires state transfer between sessions. Without automated handoff, critical information is lost: what was completed, what's in progress, what blockers were discovered, and what should happen next. Manual handoff documentation is inconsistent and often forgotten. |
572
+
573
+ ### Data API Output Shaping
574
+
575
+ | Rule | Invariant | Rationale |
576
+ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
577
+ | List queries return compact pattern summaries by default | List-returning API methods produce summaries, not full ExtractedPattern objects, unless `--full` is explicitly requested. | The single biggest usability problem. `getCurrentWork` returns 3 active patterns at ~3.5KB each = 10.5KB. Summarized: ~300 bytes total. The `directive` field (raw JSDoc AST) and `code` field (full source) are almost never needed for list queries. AI agents need name, status, category, phase, and file path -- nothing more. |
578
+ | Global output modifier flags apply to any list-returning command | Output modifiers are composable and apply uniformly across all list-returning subcommands and query methods. | AI agents frequently need just pattern names (for further queries), just counts (for progress checks), or specific fields (for focused analysis). These are post-processing transforms that should work with any data source. |
579
+ | Output format is configurable with typed response envelope | All CLI output uses the QueryResult envelope for success/error discrimination. The compact format strips empty and null fields. | The existing `QueryResult<T>` types (`QuerySuccess`, `QueryError`) are defined in `src/api/types.ts` but not wired into the CLI output. Agents cannot distinguish success from error without try/catch on JSON parsing. Empty arrays, null values, and empty strings add noise to every response. |
580
+ | List subcommand provides composable filters and fuzzy search | The `list` subcommand replaces the need to call specific `getPatternsByX` methods. Filters are composable via AND logic. The `query` subcommand remains available for programmatic/raw access. | Currently, filtering by status AND category requires calling `getPatternsByCategory` then manually filtering by status. A single `list` command with composable filters eliminates multi-step queries. Fuzzy search reduces agent retry loops when pattern names are approximate. |
581
+ | CLI provides ergonomic defaults and helpful error messages | Common operations require minimal flags. Pattern name typos produce actionable suggestions. Empty results explain why. | Every extra flag and every retry loop costs AI agent context tokens. Config file defaults eliminate repetitive path arguments. Fuzzy matching with suggestions prevents the common "Pattern not found" → retry → still not found loop. Empty result hints guide agents toward productive queries. |
582
+
583
+ ### Data API Platform Integration
584
+
585
+ | Rule | Invariant | Rationale |
586
+ | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
587
+ | ProcessStateAPI is accessible as an MCP server for Claude Code | The MCP server exposes all ProcessStateAPI methods as MCP tools with typed input/output schemas. The pipeline is loaded once on server start and refreshed on source file changes. | MCP is Claude Code's native tool integration protocol. An MCP server eliminates the CLI subprocess overhead (2-5s per query) and enables Claude Code to call process queries as naturally as it calls other tools. Stateful operation means the pipeline loads once and serves many queries. |
588
+ | Process state can be auto-generated as CLAUDE.md context sections | Generated CLAUDE.md sections are additive layers that provide pattern metadata, relationships, and reading lists for specific scopes. | CLAUDE.md is the primary mechanism for providing persistent context to Claude Code sessions. Auto-generating CLAUDE.md sections from process state ensures the context is always fresh and consistent with the source annotations. This applies the "code-first documentation" principle to AI context itself. |
589
+ | Cross-package views show dependencies spanning multiple packages | Cross-package queries aggregate patterns from multiple input sources and resolve cross-package relationships. | In the monorepo, patterns in `platform-core` are used by patterns in `platform-bc`, which are used by the example app. Understanding these cross-package dependencies is essential for release planning and impact analysis. Currently each package must be queried independently with separate input globs. |
590
+ | Process validation integrates with git hooks and file watching | Pre-commit hooks validate annotation consistency. Watch mode re-generates docs on source changes. | Git hooks catch annotation errors at commit time (e.g., new `uses` reference to non-existent pattern, invalid `arch-role` value, stub `@target` to non-existent directory). Watch mode enables live documentation regeneration during implementation sessions. |
591
+
592
+ ### Data API Relationship Graph
593
+
594
+ | Rule | Invariant | Rationale |
595
+ | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
596
+ | Graph command traverses relationships recursively with configurable depth | Graph traversal walks both planning relationships (`dependsOn`, `enables`) and implementation relationships (`uses`, `usedBy`) with cycle detection to prevent infinite loops. | Flat lookups show direct connections. Recursive traversal shows the full picture: transitive dependencies, indirect consumers, and the complete chain from root to leaf. Depth limiting prevents overwhelming output on deeply connected graphs. |
597
+ | Impact analysis shows transitive dependents of a pattern | Impact analysis answers "if I change X, what else is affected?" by walking `usedBy` + `enables` recursively. | Before modifying a completed pattern (which requires unlock), understanding the blast radius prevents unintended breakage. Impact analysis is the reverse of dependency traversal -- it looks forward, not backward. |
598
+ | Path finding discovers relationship chains between two patterns | Path finding returns the shortest chain of relationships connecting two patterns, or indicates no path exists. Traversal considers all relationship types (uses, usedBy, dependsOn, enables). | Understanding how two seemingly unrelated patterns connect helps agents assess indirect dependencies before making changes. When pattern A and pattern D are connected through B and C, modifying A requires understanding that chain. |
599
+ | Graph health commands detect broken references and isolated patterns | Dangling references (pattern names in `uses`/`dependsOn` that don't match any pattern definition) are detectable. Orphan patterns (no relationships at all) are identifiable. | The MasterDataset transformer already computes dangling references during Pass 3 (relationship resolution) but does not expose them via the API. Orphan patterns indicate missing annotations. Both are data quality signals that improve over time with attention. |
600
+
601
+ ### Data API Stub Integration
602
+
603
+ | Rule | Invariant | Rationale |
604
+ | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
605
+ | All stubs are visible to the scanner pipeline | Every stub file in `architect/stubs/` has `@architect` opt-in and `@architect-implements` linking it to its parent pattern. | The scanner requires `@architect` opt-in marker to include a file. Without it, stubs are invisible regardless of other annotations. The `@architect-implements` tag creates the bidirectional link: spec defines the pattern (via `@architect-pattern`), stub implements it. Per PDR-009, stubs must NOT use `@architect-pattern` -- that belongs to the feature file. |
606
+ | Stubs subcommand lists design stubs with implementation status | `stubs` returns stub files with their target paths, design session origins, and whether the target file already exists. | Before implementation, agents need to know: which stubs exist for a pattern, where they should be moved to, and which have already been implemented. The stub-to-implementation resolver compares `@architect-target` paths against actual files to determine status. |
607
+ | Decisions and PDR commands surface design rationale | Design decisions (AD-N items) and PDR references from stub annotations are queryable by pattern name or PDR number. | Design sessions produce numbered decisions (AD-1, AD-2, etc.) and reference PDR decision records (see PDR-012). When reviewing designs or starting implementation, agents need to find these decisions without reading every stub file manually. |
608
+
609
+ ### Fuzzy Match Tests
610
+
611
+ | Rule | Invariant | Rationale |
612
+ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
613
+ | Fuzzy matching uses tiered scoring | Pattern matching must use a tiered scoring system: exact match (1.0) > prefix match (0.9) > substring match (0.7) > Levenshtein distance, with results sorted by score descending and case-insensitive matching. | Tiered scoring ensures the most intuitive match wins — an exact match should always rank above a substring match, preventing surprising suggestions for common pattern names. |
614
+ | findBestMatch returns single suggestion | findBestMatch must return the single highest-scoring match above the threshold, or undefined when no match exceeds the threshold. | A single best suggestion simplifies "did you mean?" prompts in the CLI — returning multiple matches would require additional UI to disambiguate. |
615
+ | Levenshtein distance computation | The Levenshtein distance function must correctly compute edit distance between strings, returning 0 for identical strings. | Levenshtein distance is the fallback matching tier — incorrect distance computation would produce wrong fuzzy match scores for typo correction. |
616
+
617
+ ### Generate Docs Cli
618
+
619
+ | Rule | Invariant | Rationale |
620
+ | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
621
+ | CLI displays help and version information | The --help and -v flags must produce usage/version output and exit successfully without requiring other arguments. | Help and version are universal CLI conventions — they must work standalone so users can discover usage without reading external documentation. |
622
+ | CLI requires input patterns | The generate-docs CLI must fail with a clear error when the --input flag is not provided. | Without input source paths, the generator has nothing to scan — failing early with a clear message prevents confusing "no patterns found" errors downstream. |
623
+ | CLI lists available generators | The --list-generators flag must display all registered generator names without performing any generation, including config-registered reference meta-generators. | Users need to discover available generators before specifying --generator — listing them avoids trial-and-error with invalid generator names and must reflect the project config they are running against. |
624
+ | CLI generates documentation from source files | Given valid input patterns and a generator name, the CLI must scan sources, extract patterns, and produce markdown output files. | This is the core pipeline — the CLI is the primary entry point for transforming annotated source code into generated documentation. |
625
+ | CLI rejects unknown options | Unrecognized CLI flags must cause an error with a descriptive message rather than being silently ignored. | Silent flag ignoring hides typos and misconfigurations — users typing --ouput instead of --output would get unexpected default behavior without realizing their flag was ignored. |
626
+
627
+ ### Handoff Generator Tests
628
+
629
+ | Rule | Invariant | Rationale |
630
+ | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
631
+ | Handoff generates compact session state summary | The handoff generator must produce a compact session state summary including pattern status, discovered items, inferred session type, modified files, and dependency blockers, throwing an error for unknown patterns. | Handoff documents are the bridge between multi-session work — without compact state capture, the next session starts from scratch instead of resuming where the previous one left off. |
632
+ | Formatter produces structured text output | The handoff formatter must produce structured text output with ADR-008 section markers for machine-parseable session state. | ADR-008 markers enable the context assembler to parse handoff output programmatically — unstructured text would require fragile regex parsing. |
633
+
634
+ ### Lint Patterns Cli
635
+
636
+ | Rule | Invariant | Rationale |
637
+ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
638
+ | CLI displays help and version information | The --help and -v flags must produce usage/version output and exit successfully without requiring other arguments. | Help and version are universal CLI conventions — they must work standalone so users can discover usage without reading external documentation. |
639
+ | CLI requires input patterns | The lint-patterns CLI must fail with a clear error when the --input flag is not provided. | Without input paths, the linter has nothing to validate — failing early prevents confusing "no violations" output that falsely implies clean annotations. |
640
+ | Lint passes for valid patterns | Fully annotated patterns with all required tags must pass linting with zero violations. | False positives erode developer trust in the linter — valid annotations must always pass to maintain the tool's credibility. |
641
+ | Lint detects violations in incomplete patterns | Patterns with missing or incomplete annotations must produce specific violation reports identifying what is missing. | Actionable violation messages guide developers to fix annotations — generic "lint failed" messages without specifics waste debugging time. |
642
+ | CLI supports multiple output formats | The CLI must support JSON and pretty (human-readable) output formats, with pretty as the default. | Pretty format serves interactive use while JSON format enables CI/CD pipeline integration and programmatic consumption of lint results. |
643
+ | Strict mode treats warnings as errors | When --strict is enabled, warnings must be promoted to errors causing a non-zero exit code; without --strict, warnings must not cause failure. | CI pipelines need strict enforcement while local development benefits from lenient mode — the flag lets teams choose their enforcement level. |
644
+
645
+ ### Lint Process Cli
646
+
647
+ | Rule | Invariant | Rationale |
648
+ | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
649
+ | CLI displays help and version information | The --help/-h and --version/-v flags must produce usage/version output and exit successfully without requiring other arguments. | Help and version are universal CLI conventions — both short and long flag forms must work for discoverability and scripting compatibility. |
650
+ | CLI requires git repository for validation | The lint-process CLI must fail with a clear error when run outside a git repository in both staged and all modes. | Process guard validation depends on git diff for change detection — running without git produces undefined behavior rather than useful validation results. |
651
+ | CLI validates file mode input | In file mode, the CLI must require at least one file path via positional argument or --file flag, and fail with a clear error when none is provided. | File mode is for targeted validation of specific files — accepting zero files would silently produce a "no violations" result that falsely implies the files are valid. |
652
+ | CLI handles no changes gracefully | When no relevant changes are detected (empty diff), the CLI must exit successfully with a zero exit code. | No changes means no violations are possible — failing on empty diffs would break CI pipelines on commits that only modify non-spec files. |
653
+ | CLI supports multiple output formats | The CLI must support JSON and pretty (human-readable) output formats, with pretty as the default. | Pretty format serves interactive pre-commit use while JSON format enables CI/CD pipeline integration and automated violation processing. |
654
+ | CLI supports debug options | The --show-state flag must display the derived process state (FSM states, protection levels, deliverables) without affecting validation behavior. | Process guard decisions are derived from complex state — exposing the intermediate state helps developers understand why a specific validation passed or failed. |
655
+ | CLI warns about unknown flags | Unrecognized CLI flags must produce a warning message but allow execution to continue. | Process validation is critical-path at commit time — hard-failing on a typo in an optional flag would block commits unnecessarily when the core validation would succeed. |
656
+
657
+ ### MCP Server Integration
658
+
659
+ | Rule | Invariant | Rationale |
660
+ | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
661
+ | MCP server starts via stdio transport and manages its own lifecycle | The MCP server communicates over stdio using JSON-RPC. It builds the pipeline once during initialization, then enters a request-response loop. No non-MCP output is written to stdout (no console.log, no pnpm banners). | MCP defines stdio as the standard transport for local tool servers. Claude Code spawns the process and communicates over stdin/stdout pipes. Any extraneous stdout output corrupts the JSON-RPC stream. Loading the pipeline during initialization ensures the first tool call is fast. |
662
+ | ProcessStateAPI methods and CLI subcommands are registered as MCP tools | Every CLI subcommand is registered as an MCP tool with a JSON Schema describing its input parameters. Tool names use snake*case with a "architect*" prefix to avoid collisions with other MCP servers. | MCP tools are the unit of interaction. Each tool needs a name, description (for LLM tool selection), and JSON Schema for input validation. The "architect\_" prefix prevents collisions in multi-server setups. |
663
+ | MasterDataset is loaded once and reused across all tool invocations | The pipeline runs exactly once during server initialization. All subsequent tool calls read from in-memory MasterDataset. A manual rebuild can be triggered via a "architect_rebuild" tool, and overlapping rebuild requests coalesce so the final in-memory session reflects the newest completed build. | The pipeline costs 2-5 seconds. Running it per tool call negates MCP benefits. Pre-computed views provide O(1) access ideal for a query server. |
664
+ | Source file changes trigger automatic dataset rebuild with debouncing | When --watch is enabled, changes to source files trigger an automatic pipeline rebuild. Multiple rapid changes are debounced into a single rebuild (default 500ms window). | During implementation sessions, source files change frequently. Without auto-rebuild, agents must manually call architect_rebuild. Debouncing prevents redundant rebuilds during rapid-fire saves. |
665
+ | MCP server is configurable via standard client configuration | The server works with .mcp.json (Claude Code), claude_desktop_config.json (Claude Desktop), and any MCP client. It accepts --input, --features, --base-dir args, auto-detects architect.config.ts, and reports the package version accurately through the CLI. | MCP clients discover servers through configuration files. The server must work with sensible defaults (config auto-detection) while supporting explicit overrides for monorepo setups. |
666
+
667
+ ### Output Pipeline Tests
668
+
669
+ | Rule | Invariant | Rationale |
670
+ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
671
+ | Output modifiers apply with correct precedence | Output modifiers (count, names-only, fields, full) must apply to pattern arrays with correct precedence, passing scalar inputs through unchanged, with summaries as the default mode. | Predictable modifier behavior enables composable CLI queries — unexpected precedence or scalar handling would produce confusing output for piped commands. |
672
+ | Modifier conflicts are rejected | Mutually exclusive modifier combinations (full+names-only, full+count, full+fields) and invalid field names must be rejected with clear error messages. | Conflicting modifiers produce ambiguous intent — rejecting early with a clear message is better than silently picking one modifier and ignoring the other. |
673
+ | List filters compose via AND logic | Multiple list filters (status, category) must compose via AND logic, with pagination (limit/offset) applied after filtering and empty results for out-of-range offsets. | AND composition is the intuitive default for filters — "status=active AND category=core" should narrow results, not widen them via OR logic. |
674
+ | Empty stripping removes noise | Null and empty values must be stripped from output objects to reduce noise in API responses. | Empty fields in pattern summaries create visual clutter and waste tokens in AI context windows — stripping them keeps output focused on meaningful data. |
675
+
676
+ ### Pattern Helpers Tests
677
+
678
+ | Rule | Invariant | Rationale |
679
+ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
680
+ | getPatternName uses patternName tag when available | getPatternName must return the patternName tag value when set, falling back to the pattern's name field when the tag is absent. | The patternName tag allows human-friendly display names — without the fallback, patterns missing the tag would display as undefined. |
681
+ | findPatternByName performs case-insensitive matching | findPatternByName must match pattern names case-insensitively, returning undefined when no match exists. | Case-insensitive matching prevents frustrating "not found" errors when developers type "processguard" instead of "ProcessGuard" — both clearly refer to the same pattern. |
682
+ | getRelationships looks up with case-insensitive fallback | getRelationships must first try exact key lookup in the relationship index, then fall back to case-insensitive matching, returning undefined when no match exists. | Exact-first with case-insensitive fallback balances performance (O(1) exact lookup) with usability (tolerates case mismatches in cross-references). |
683
+ | suggestPattern provides fuzzy suggestions | suggestPattern must return fuzzy match suggestions for close pattern names, returning empty results when no close match exists. | Fuzzy suggestions power "did you mean?" UX in the CLI — without them, typos produce unhelpful "pattern not found" messages. |
684
+
685
+ ### Pattern Summarize Tests
686
+
687
+ | Rule | Invariant | Rationale |
688
+ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
689
+ | summarizePattern projects to compact summary | summarizePattern must project a full pattern object to a compact summary containing exactly 6 fields, using the patternName tag over the name field when available and omitting undefined optional fields. | Compact summaries reduce token usage by 80-90% compared to full patterns — they provide enough context for navigation without overwhelming AI context windows. |
690
+ | summarizePatterns batch processes arrays | summarizePatterns must batch-process an array of patterns, returning a correctly-sized array of compact summaries. | Batch processing avoids N individual function calls — the API frequently needs to summarize all patterns matching a query in a single operation. |
691
+
692
+ ### PDR 001 Session Workflow Commands
693
+
694
+ | Rule | Invariant | Rationale |
695
+ | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
696
+ | DD-1 - Text output with section markers | scope-validate and handoff must return plain text with === SECTION === markers, never JSON. | Inconsistent output formats force consumers to detect and branch on format type, breaking the dual output path contract. |
697
+ | DD-2 - Git integration is opt-in via --git flag | Domain logic must never invoke shell commands or depend on git directly. | Shell dependencies in domain logic make functions untestable without git fixtures and break deterministic behavior. |
698
+ | DD-3 - Session type inferred from FSM status | Every FSM status must map to exactly one default session type, overridable by an explicit --session flag. | Ambiguous or missing inference forces users to always specify --session manually, defeating the ergonomic benefit of status-based defaults. |
699
+ | DD-4 - Severity levels match Process Guard model | Scope validation must use exactly three severity levels (PASS, BLOCKED, WARN) consistent with Process Guard. | Divergent severity models cause confusion when the same violation appears in both systems with different severity classifications. |
700
+ | DD-5 - Current date only for handoff | Handoff must always use the current system date with no override mechanism. | A --date flag enables backdating handoff timestamps, which breaks audit trail integrity for multi-session work. |
701
+ | DD-6 - Both positional and flag forms for scope type | scope-validate must accept scope type as both a positional argument and a --type flag. | Supporting only one form creates inconsistency with CLI conventions and forces users to remember which form each subcommand uses. |
702
+ | DD-7 - Co-located formatter functions | Each module must export both its data builder and text formatter as co-located functions. | Splitting builder and formatter across files increases coupling surface and makes it harder to trace data flow through the module. |
703
+
704
+ ### Process Api Cli Cache
705
+
706
+ | Rule | Invariant | Rationale |
707
+ | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
708
+ | MasterDataset is cached between invocations | When source files have not changed between CLI invocations, the second invocation must use the cached MasterDataset and report cache.hit as true with reduced pipelineMs. | The pipeline rebuild costs 2-5 seconds per invocation. Caching eliminates this cost for repeated queries against unchanged sources, which is the common case during interactive AI sessions. |
709
+
710
+ ### Process Api Cli Core
711
+
712
+ | Rule | Invariant | Rationale |
713
+ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
714
+ | CLI displays help and version information | The CLI must always provide discoverable usage and version information via standard flags. | Without accessible help and version output, users cannot self-serve CLI usage or report issues with a specific version. |
715
+ | CLI requires input flag for subcommands | Every data-querying subcommand must receive either an explicit `--input` glob or a project config that provides source globs. | Without an input source, the pipeline has no files to scan and would produce empty or misleading results instead of a clear error, but project config auto-detection should remove that boilerplate when the repo is configured. |
716
+ | CLI status subcommand shows delivery state | The status subcommand must return structured JSON containing delivery progress derived from the MasterDataset. | Consumers depend on machine-readable status output for scripting and CI integration; unstructured output breaks downstream automation. |
717
+ | CLI query subcommand executes API methods | The query subcommand must dispatch to any public Data API method by name and pass positional arguments through. | The CLI is the primary interface for ad-hoc queries; failing to resolve a valid method name or its arguments silently drops the user's request. |
718
+ | CLI pattern subcommand shows pattern detail | The pattern subcommand must return the full JSON detail for an exact pattern name match, or a clear error if not found. | Pattern lookup is the primary debugging tool for annotation issues; ambiguous or silent failures waste investigation time. |
719
+ | CLI arch subcommand queries architecture | The arch subcommand must expose role, bounded context, and layer queries over the MasterDataset's architecture metadata. | Architecture queries replace manual exploration of annotated sources; missing or incorrect results lead to wrong structural assumptions during design sessions. |
720
+ | CLI shows errors for missing subcommand arguments | Subcommands that require arguments must reject invocations with missing arguments and display usage guidance. | Silent acceptance of incomplete input would produce confusing pipeline errors instead of actionable feedback at the CLI boundary. |
721
+ | CLI handles argument edge cases | The CLI must gracefully handle non-standard argument forms including numeric coercion and the `--` pnpm separator. | Real-world invocations via pnpm pass `--` separators and numeric strings; mishandling these causes silent data loss or crashes in automated workflows. |
722
+
723
+ ### Process Api Cli Dry Run
724
+
725
+ | Rule | Invariant | Rationale |
726
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
727
+ | Dry-run shows pipeline scope without processing | The --dry-run flag must display file counts, config status, and cache status without executing the pipeline. Output must contain the DRY RUN marker and must not contain a JSON success envelope. | Dry-run enables users to verify their input patterns resolve to expected files before committing to the 2-5s pipeline cost, which is especially valuable when debugging glob patterns or config auto-detection. |
728
+
729
+ ### Process Api Cli Help
730
+
731
+ | Rule | Invariant | Rationale |
732
+ | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
733
+ | Per-subcommand help shows usage and flags | Running any subcommand with --help must display usage information specific to that subcommand, including applicable flags and examples. Unknown subcommands must fall back to a descriptive message. | Per-subcommand help replaces the need to scroll through full --help output and provides contextual guidance for subcommand-specific flags like --session. |
734
+
735
+ ### Process Api Cli Metadata
736
+
737
+ | Rule | Invariant | Rationale |
738
+ | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
739
+ | Response metadata includes validation summary | Every JSON response envelope must include a metadata.validation object with danglingReferenceCount, malformedPatternCount, unknownStatusCount, and warningCount fields, plus a numeric pipelineMs timing. | Consumers use validation counts to detect annotation quality degradation without running a separate validation pass. Pipeline timing enables performance regression detection in CI. |
740
+
741
+ ### Process Api Cli Modifiers And Rules
742
+
743
+ | Rule | Invariant | Rationale |
744
+ | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
745
+ | Output modifiers work when placed after the subcommand | Output modifiers (--count, --names-only, --fields) produce identical results regardless of position relative to the subcommand and its filters. | Users should not need to memorize argument ordering rules; the CLI should be forgiving. |
746
+ | CLI arch health subcommands detect graph quality issues | Health subcommands (dangling, orphans, blocking) operate on the relationship index, not the architecture index, and return results without requiring arch annotations. | Graph quality issues (broken references, isolated patterns, blocked dependencies) are relationship-level concerns that should be queryable even when no architecture metadata exists. |
747
+ | CLI rules subcommand queries business rules and invariants | The rules subcommand returns structured business rules extracted from Gherkin Rule: blocks, grouped by product area and phase, with parsed invariant and rationale annotations. | Live business rule queries replace static generated markdown, enabling on-demand filtering by product area, pattern, and invariant presence. |
748
+
749
+ ### Process Api Cli Repl
750
+
751
+ | Rule | Invariant | Rationale |
752
+ | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
753
+ | REPL mode accepts multiple queries on a single pipeline load | REPL mode loads the pipeline once and accepts multiple queries on stdin, eliminating per-query pipeline overhead. | Design sessions involve 10-20 exploratory queries in sequence. REPL mode eliminates per-query pipeline overhead entirely. |
754
+ | REPL reload rebuilds the pipeline from fresh sources | The reload command rebuilds the pipeline from fresh sources and subsequent queries use the new dataset. | During implementation sessions, source files change frequently. Reload allows refreshing without restarting the REPL. |
755
+
756
+ ### Process Api Cli Subcommands
757
+
758
+ | Rule | Invariant | Rationale |
759
+ | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
760
+ | CLI list subcommand filters patterns | The list subcommand must return a valid JSON result for valid filters and a non-zero exit code with a descriptive error for invalid filters. | Consumers parse list output programmatically; malformed JSON or silent failures cause downstream tooling to break without diagnosis. |
761
+ | CLI search subcommand finds patterns by fuzzy match | The search subcommand must require a query argument and return only patterns whose names match the query. | Missing query validation would produce unfiltered result sets, defeating the purpose of search and wasting context budget in AI sessions. |
762
+ | CLI context assembly subcommands return text output | Context assembly subcommands (context, overview, dep-tree) must produce non-empty human-readable text containing the requested pattern or summary, and require a pattern argument where applicable. | These subcommands replace manual file reads in AI sessions; empty or off-target output forces expensive explore-agent fallbacks that consume 5-10x more context. |
763
+ | CLI tags and sources subcommands return JSON | The tags and sources subcommands must return valid JSON with the expected top-level structure (data key for tags, array for sources). | Annotation exploration depends on machine-parseable output; invalid JSON prevents automated enrichment workflows from detecting unannotated files and tag gaps. |
764
+ | CLI extended arch subcommands query architecture relationships | Extended arch subcommands (neighborhood, compare, coverage) must return valid JSON reflecting the actual architecture relationships present in the scanned sources. | Architecture queries drive design-session decisions; stale or structurally invalid output leads to incorrect dependency analysis and missed coupling between bounded contexts. |
765
+ | CLI unannotated subcommand finds files without annotations | The unannotated subcommand must return valid JSON listing every TypeScript file that lacks the `@architect` opt-in marker. | Files missing the opt-in marker are invisible to the scanner; without this subcommand, unannotated files silently drop out of generated documentation and validation. |
766
+
767
+ ### Process API Layered Extraction
768
+
769
+ | Rule | Invariant | Rationale |
770
+ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
771
+ | CLI file contains only routing, no domain logic | `process-api.ts` parses arguments, calls the pipeline factory for the MasterDataset, routes subcommands to API modules, and formats output. It does not build Maps, filter patterns, group data, or resolve relationships. Thin view projections (3-5 line `.map()` calls over pre-computed archIndex views) are acceptable as formatting. | Domain logic in the CLI file is only accessible via the command line. Extracting it to `src/api/` makes it programmatically testable, reusable by future consumers (MCP server, watch mode), and aligned with the feature-consumption layer defined in ADR-006. |
772
+ | Pipeline factory is shared across CLI consumers | The scan-extract-transform sequence is defined once in `src/generators/pipeline/build-pipeline.ts`. CLI consumers that need a MasterDataset call the factory rather than wiring the pipeline independently. The factory accepts `mergeConflictStrategy` to handle behavioral differences between consumers. | Three consumers (process-api, validate-patterns, orchestrator) independently wire the same 8-step sequence: loadConfig, scanPatterns, extractPatterns, scanGherkinFiles, extractPatternsFromGherkin, mergePatterns, computeHierarchyChildren, transformToMasterDataset. The only semantic difference is merge-conflict handling (fatal vs concatenate). This is a Parallel Pipeline anti-pattern per ADR-006. |
773
+ | Domain logic lives in API modules | Query logic that operates on MasterDataset lives in `src/api/` modules. The `rules-query.ts` module provides business rules querying with the same grouping logic that was inline in handleRules: filter by product area and pattern, group by area -> phase -> feature -> rules, parse annotations, compute totals. | `handleRules` is 184 lines with 5 Map/Set constructions, codec-layer imports (`parseBusinessRuleAnnotations`, `deduplicateScenarioNames`), and a complex 3-level grouping algorithm. This is the last significant inline domain logic in process-api.ts. Moving it to `src/api/` follows the same pattern as the 12 existing API modules (context-assembler, arch-queries, scope-validator, etc.). |
774
+ | Pipeline factory returns Result for consumer-owned error handling | The factory returns `Result<PipelineResult, PipelineError>` rather than throwing or calling `process.exit()`. Each consumer maps the error to its own strategy: process-api.ts calls `process.exit(1)`, validate-patterns.ts throws, and orchestrator.ts (future) returns `Result.err()`. | The current `buildPipeline()` in process-api.ts calls `process.exit(1)` on errors, making it non-reusable. The factory must work across consumers with different error handling models. The Result monad is the project's established pattern for this (see `src/types/result.ts`). |
775
+ | End-to-end verification confirms behavioral equivalence | After extraction, all CLI commands produce identical output to pre-refactor behavior with zero build, test, lint, and validation errors. | The refactor must not change observable behavior. Full CLI verification confirms the extraction is a pure refactor. |
776
+
777
+ ### Process Api Reference Tests
778
+
779
+ | Rule | Invariant | Rationale |
780
+ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------- |
781
+ | Generated reference file contains all three table sections | PROCESS-API-REFERENCE.md contains Global Options, Output Modifiers, and List Filters tables generated from the CLI schema. | |
782
+ | CLI schema stays in sync with parser | Every flag recognized by parseArgs() has a corresponding entry in the CLI schema. A missing schema entry means the sync test fails. | |
783
+ | showHelp output reflects CLI schema | The help text rendered by showHelp() includes all options from the CLI schema, formatted for terminal display. | |
784
+
785
+ ### Process State API CLI
786
+
787
+ | Rule | Invariant | Rationale |
788
+ | ----------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
789
+ | CLI supports status-based pattern queries | Every ProcessStateAPI status query method is accessible via CLI. | The most common planning question is "what's the current state?" Status queries (active, roadmap, completed) answer this directly without reading docs. Without CLI access, Claude Code must regenerate markdown and parse unstructured text. |
790
+ | CLI supports phase-based queries | Patterns can be filtered by phase number. | Phase 18 (Event Durability) is the current focus per roadmap priorities. Quick phase queries help assess progress and remaining work within a phase. Phase-based planning is the primary organization method for roadmap work. |
791
+ | CLI provides progress summary queries | Overall and per-phase progress is queryable in a single command. | Planning sessions need quick answers to "where are we?" without reading the full PATTERNS.md generated file. Progress metrics drive prioritization and help identify where to focus effort. |
792
+ | CLI supports multiple output formats | JSON output is parseable by AI agents without transformation. | Claude Code can parse JSON directly. Text format is for human reading. JSON format enables scripting and integration with other tools. The primary use case is AI agent parsing where structured output reduces context and errors. |
793
+ | CLI supports individual pattern lookup | Any pattern can be queried by name with full details. | During implementation, Claude Code needs to check specific pattern status, deliverables, and dependencies without reading the full spec file. Pattern lookup is essential for focused implementation work. |
794
+ | CLI provides discoverable help | All flags are documented via --help with examples. | Claude Code can read --help output to understand available queries without needing external documentation. Self-documenting CLIs reduce the need for Claude Code to read additional context files. |
795
+
796
+ ### Process State API Relationship Queries
797
+
798
+ | Rule | Invariant | Rationale |
799
+ | ------------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
800
+ | API provides implementation relationship queries | Every pattern with `implementedBy` entries is discoverable via the API. | Claude Code needs to navigate from abstract patterns to concrete code. Without this, exploration requires manual grep + file reading, wasting context tokens. |
801
+ | API provides inheritance hierarchy queries | Pattern inheritance chains are fully navigable in both directions. | Patterns form specialization hierarchies (e.g., ReactiveProjections extends ProjectionCategories). Claude Code needs to understand what specializes a base pattern and what a specialized pattern inherits from. |
802
+ | API provides combined relationship views | All relationship types are accessible through a unified interface. | Claude Code often needs the complete picture: dependencies AND implementations AND inheritance. A single call reduces round-trips and context switching. |
803
+ | API supports bidirectional traceability queries | Navigation from spec to code and code to spec is symmetric. | Traceability is bidirectional by definition. If a spec links to code, the code should link back to the spec. The API should surface broken links. |
804
+
805
+ ### Process State API Testing
806
+
807
+ | Rule | Invariant | Rationale |
808
+ | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
809
+ | Status queries return correct patterns | Status queries must correctly filter by both normalized status (planned = roadmap + deferred) and FSM status (exact match). | The two-domain status convention requires separate query methods — mixing them produces incorrect filtered results. |
810
+ | Phase queries return correct phase data | Phase queries must return only patterns in the requested phase, with accurate progress counts and completion percentage. | Phase-level queries power the roadmap and session planning views — incorrect counts cascade into wrong progress percentages. |
811
+ | FSM queries expose transition validation | FSM queries must validate transitions against the PDR-005 state machine and expose protection levels per status. | Programmatic FSM access enables tooling to enforce delivery process rules without reimplementing the state machine. |
812
+ | Pattern queries find and retrieve pattern data | Pattern lookup must be case-insensitive by name, and category queries must return only patterns with the requested category. | Case-insensitive search reduces friction in CLI and AI agent usage where exact casing is often unknown. |
813
+ | Timeline queries group patterns by time | Quarter queries must correctly filter by quarter string, and recently completed must be sorted by date descending with limit. | Timeline grouping enables quarterly reporting and session context — recent completions show delivery momentum. |
814
+
815
+ ### Scope Validator Tests
816
+
817
+ | Rule | Invariant | Rationale |
818
+ | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
819
+ | Implementation scope validation checks all prerequisites | Implementation scope validation must check FSM transition validity, dependency completeness, PDR references, and deliverable presence, with strict mode promoting warnings to blockers. | Starting implementation without passing scope validation wastes an entire session — the validator catches all known blockers before any code is written. |
820
+ | Design scope validation checks dependency stubs | Design scope validation must verify that dependencies have corresponding code stubs, producing warnings when stubs are missing. | Design sessions that reference unstubbed dependencies cannot produce actionable interfaces — stub presence indicates the dependency's API surface is at least sketched. |
821
+ | Formatter produces structured text output | The scope validator formatter must produce structured text with ADR-008 markers, showing verdict text for warnings and blocker details for blocked verdicts. | Structured formatter output enables the CLI to display verdicts consistently — unstructured output would vary by validation type and be hard to parse. |
822
+
823
+ ### Stub Resolver Tests
824
+
825
+ | Rule | Invariant | Rationale |
826
+ | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
827
+ | Stubs are identified by path or target metadata | A pattern must be identified as a stub if it resides in the stubs directory OR has a targetPath metadata field. | Dual identification supports both convention-based (directory) and metadata-based (targetPath) stub detection — relying on only one would miss stubs organized differently. |
828
+ | Stubs are resolved against the filesystem | Resolved stubs must show whether their target file exists on the filesystem and must be grouped by the pattern they implement. | Target existence status tells developers whether a stub has been implemented — grouping by pattern enables the "stubs --unresolved" command to show per-pattern implementation gaps. |
829
+ | Decision items are extracted from descriptions | AD-N formatted items must be extracted from pattern description text, with empty descriptions returning no items and malformed items being skipped. | Decision items (AD-1, AD-2, etc.) link stubs to architectural decisions — extracting them enables traceability from code stubs back to the design rationale. |
830
+ | PDR references are found across patterns | The resolver must find all patterns that reference a given PDR identifier, returning empty results when no references exist. | PDR cross-referencing enables impact analysis — knowing which patterns reference a decision helps assess the blast radius of changing that decision. |
831
+
832
+ ### Stub Taxonomy Tag Tests
833
+
834
+ | Rule | Invariant | Rationale |
835
+ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
836
+ | Taxonomy tags are registered in the registry | The target and since stub metadata tags must be registered in the tag registry as recognized taxonomy entries. | Unregistered tags would be flagged as unknown by the linter — registration ensures stub metadata tags pass validation alongside standard annotation tags. |
837
+ | Tags are part of the stub metadata group | The target and since tags must be grouped under the stub metadata domain in the built registry. | Domain grouping enables the taxonomy codec to render stub metadata tags in their own section — ungrouped tags would be lost in the "Other" category. |
838
+
839
+ ### Validate Patterns Cli
840
+
841
+ | Rule | Invariant | Rationale |
842
+ | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
843
+ | CLI displays help and version information | The --help/-h and --version/-v flags must produce usage/version output and exit successfully without requiring other arguments. | Help and version are universal CLI conventions — both short and long flag forms must work for discoverability and scripting compatibility. |
844
+ | CLI requires input and feature patterns | The validate-patterns CLI must fail with clear errors when either --input or --features flags are missing. | Cross-source validation requires both TypeScript and Gherkin inputs — running with only one source would produce incomplete validation that misses cross-source mismatches. |
845
+ | CLI validates patterns across TypeScript and Gherkin sources | The validator must detect mismatches between TypeScript and Gherkin sources including phase and status discrepancies. | Dual-source architecture requires consistency — a pattern with status "active" in TypeScript but "roadmap" in Gherkin creates conflicting truth and broken reports. |
846
+ | CLI supports multiple output formats | The CLI must support JSON and pretty (human-readable) output formats, with pretty as the default. | Pretty format serves interactive use while JSON format enables CI/CD pipeline integration and programmatic consumption of validation results. |
847
+ | Strict mode treats warnings as errors | When --strict is enabled, warnings must be promoted to errors causing a non-zero exit code (exit 2); without --strict, warnings must not cause failure. | CI pipelines need strict enforcement while local development benefits from lenient mode — the flag lets teams choose their enforcement level. |
848
+ | CLI warns about unknown flags | Unrecognized CLI flags must produce a warning message but allow execution to continue. | Pattern validation is non-destructive — warning without failing is more user-friendly than hard errors for minor flag typos, while still surfacing the issue. |
849
+
850
+ ---