@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,1403 @@
1
+ # Data API Business Rules
2
+
3
+ **Purpose:** Business rules for the Data API product area
4
+
5
+ ---
6
+
7
+ **90 rules** from 25 features. 90 rules have explicit invariants.
8
+
9
+ ---
10
+
11
+ ## Phase 25
12
+
13
+ ### Pattern Helpers Tests
14
+
15
+ ---
16
+
17
+ #### getPatternName uses patternName tag when available
18
+
19
+ > **Invariant:** getPatternName must return the patternName tag value when set, falling back to the pattern's name field when the tag is absent.
20
+ >
21
+ > **Rationale:** The patternName tag allows human-friendly display names — without the fallback, patterns missing the tag would display as undefined.
22
+
23
+ **Verified by:**
24
+
25
+ - Returns patternName when set
26
+ - Falls back to name when patternName is absent
27
+
28
+ ---
29
+
30
+ #### findPatternByName performs case-insensitive matching
31
+
32
+ > **Invariant:** findPatternByName must match pattern names case-insensitively, returning undefined when no match exists.
33
+ >
34
+ > **Rationale:** Case-insensitive matching prevents frustrating "not found" errors when developers type "processguard" instead of "ProcessGuard" — both clearly refer to the same pattern.
35
+
36
+ **Verified by:**
37
+
38
+ - Exact case match
39
+ - Case-insensitive match
40
+ - No match returns undefined
41
+
42
+ ---
43
+
44
+ #### getRelationships looks up with case-insensitive fallback
45
+
46
+ > **Invariant:** getRelationships must first try exact key lookup in the relationship index, then fall back to case-insensitive matching, returning undefined when no match exists.
47
+ >
48
+ > **Rationale:** Exact-first with case-insensitive fallback balances performance (O(1) exact lookup) with usability (tolerates case mismatches in cross-references).
49
+
50
+ **Verified by:**
51
+
52
+ - Exact key match in relationship index
53
+ - Case-insensitive fallback match
54
+ - Missing relationship index returns undefined
55
+
56
+ ---
57
+
58
+ #### suggestPattern provides fuzzy suggestions
59
+
60
+ > **Invariant:** suggestPattern must return fuzzy match suggestions for close pattern names, returning empty results when no close match exists.
61
+ >
62
+ > **Rationale:** Fuzzy suggestions power "did you mean?" UX in the CLI — without them, typos produce unhelpful "pattern not found" messages.
63
+
64
+ **Verified by:**
65
+
66
+ - Suggests close match
67
+ - No close match returns empty
68
+
69
+ _pattern-helpers.feature_
70
+
71
+ ---
72
+
73
+ ## Uncategorized
74
+
75
+ ### Arch Queries Test
76
+
77
+ ---
78
+
79
+ #### Neighborhood and comparison views
80
+
81
+ > **Invariant:** The architecture query API must provide pattern neighborhood views (direct connections) and cross-context comparison views (shared/unique dependencies), returning undefined for nonexistent patterns.
82
+ >
83
+ > **Rationale:** Neighborhood and comparison views are the primary navigation tools for understanding architecture — without them, developers must manually trace relationship chains across files.
84
+
85
+ **Verified by:**
86
+
87
+ - Pattern neighborhood shows direct connections
88
+ - Cross-context comparison shows shared and unique dependencies
89
+ - Neighborhood for nonexistent pattern returns undefined
90
+
91
+ ---
92
+
93
+ #### Taxonomy discovery via tags and sources
94
+
95
+ > **Invariant:** The API must aggregate tag values with counts across all patterns and categorize source files by type, returning empty reports when no patterns match.
96
+ >
97
+ > **Rationale:** Tag aggregation reveals annotation coverage gaps and source inventory helps teams understand their codebase composition — both are essential for project health monitoring.
98
+
99
+ **Verified by:**
100
+
101
+ - Tag aggregation counts values across patterns
102
+ - Source inventory categorizes files by type
103
+ - Tags with no patterns returns empty report
104
+
105
+ ---
106
+
107
+ #### Coverage analysis reports annotation completeness
108
+
109
+ > **Invariant:** Coverage analysis must detect unused taxonomy entries, cross-context integration points, and include all relationship types (implements, dependsOn, enables) in neighborhood views.
110
+ >
111
+ > **Rationale:** Unused taxonomy entries indicate dead configuration while missing relationship types produce incomplete architecture views — both degrade the reliability of generated documentation.
112
+
113
+ **Verified by:**
114
+
115
+ - Unused taxonomy detection
116
+ - Cross-context comparison with integration points
117
+ - Neighborhood includes implements relationships
118
+ - Neighborhood includes dependsOn and enables relationships
119
+
120
+ _arch-queries.feature_
121
+
122
+ ### Context Assembler Tests
123
+
124
+ _Tests for assembleContext(), buildDepTree(), buildFileReadingList(), and_
125
+
126
+ ---
127
+
128
+ #### assembleContext produces session-tailored context bundles
129
+
130
+ > **Invariant:** Each session type (design/planning/implement) must include exactly the context sections defined by its profile — no more, no less.
131
+ >
132
+ > **Rationale:** Over-fetching wastes AI context window tokens; under-fetching causes the agent to make uninformed decisions.
133
+
134
+ **Verified by:**
135
+
136
+ - Design session includes stubs, consumers, and architecture
137
+ - Planning session includes only metadata and dependencies
138
+ - Implement session includes deliverables and FSM
139
+ - Multi-pattern context merges metadata from both patterns
140
+ - Pattern not found returns error with suggestion
141
+ - Description preserves Problem and Solution structure
142
+ - Solution text with inline bold is not truncated
143
+ - Design session includes stubs
144
+ - consumers
145
+ - and architecture
146
+
147
+ ---
148
+
149
+ #### buildDepTree walks dependency chains with cycle detection
150
+
151
+ > **Invariant:** The dependency tree must walk the full chain up to the depth limit, mark the focal node, and terminate safely on circular references.
152
+ >
153
+ > **Rationale:** Dependency chains reveal implementation prerequisites — cycles and infinite recursion would crash the CLI.
154
+
155
+ **Verified by:**
156
+
157
+ - Dependency tree shows chain with status markers
158
+ - Depth limit truncates branches
159
+ - Circular dependencies are handled safely
160
+ - Standalone pattern returns single-node tree
161
+
162
+ ---
163
+
164
+ #### buildOverview provides executive project summary
165
+
166
+ > **Invariant:** The overview must include progress counts (completed/active/planned), active phase listing, and blocking dependencies.
167
+ >
168
+ > **Rationale:** The overview is the first command in every session start recipe — it must provide a complete project health snapshot.
169
+
170
+ **Verified by:**
171
+
172
+ - Overview shows progress, active phases, and blocking
173
+ - Empty dataset returns zero-state overview
174
+ - Overview shows progress
175
+ - active phases
176
+ - and blocking
177
+
178
+ ---
179
+
180
+ #### buildFileReadingList returns paths by relevance
181
+
182
+ > **Invariant:** Primary files (spec, implementation) must always be included; related files (dependency implementations) are included only when requested.
183
+ >
184
+ > **Rationale:** File reading lists power the "what to read" guidance — relevance sorting ensures the most important files are read first within token budgets.
185
+
186
+ **Verified by:**
187
+
188
+ - File list includes primary and related files
189
+ - File list includes implementation files for completed dependencies
190
+ - File list without related returns only primary
191
+
192
+ _context-assembler.feature_
193
+
194
+ ### Context Formatter Tests
195
+
196
+ _Tests for formatContextBundle(), formatDepTree(), formatFileReadingList(),_
197
+
198
+ ---
199
+
200
+ #### formatContextBundle renders section markers
201
+
202
+ > **Invariant:** 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.
203
+ >
204
+ > **Rationale:** Section markers enable structured parsing of context output — without them, AI consumers cannot reliably extract specific sections from the formatted bundle.
205
+
206
+ **Verified by:**
207
+
208
+ - Design bundle renders all populated sections
209
+ - Implement bundle renders deliverables and FSM
210
+
211
+ ---
212
+
213
+ #### formatDepTree renders indented tree
214
+
215
+ > **Invariant:** The dependency tree formatter must render with indentation arrows and a focal pattern marker to visually distinguish the target pattern from its dependencies.
216
+ >
217
+ > **Rationale:** Visual hierarchy in the dependency tree makes dependency chains scannable at a glance — flat output would require mental parsing to understand depth and relationships.
218
+
219
+ **Verified by:**
220
+
221
+ - Tree renders with arrows and focal marker
222
+
223
+ ---
224
+
225
+ #### formatOverview renders progress summary
226
+
227
+ > **Invariant:** The overview formatter must render a progress summary line showing completion metrics for the project and point users to the current query script name.
228
+ >
229
+ > **Rationale:** 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.
230
+
231
+ **Verified by:**
232
+
233
+ - Overview renders progress line
234
+ - Overview renders architect query guidance
235
+
236
+ ---
237
+
238
+ #### formatFileReadingList renders categorized file paths
239
+
240
+ > **Invariant:** The file reading list formatter must categorize paths into primary and dependency sections, producing minimal output when the list is empty.
241
+ >
242
+ > **Rationale:** Categorized file lists tell developers which files to read first (primary) versus reference (dependency) — uncategorized lists waste time on low-priority files.
243
+
244
+ **Verified by:**
245
+
246
+ - File list renders primary and dependency sections
247
+ - Empty file reading list renders minimal output
248
+
249
+ _context-formatter.feature_
250
+
251
+ ### Fuzzy Match Tests
252
+
253
+ _Validates tiered fuzzy matching: exact > prefix > substring > Levenshtein._
254
+
255
+ ---
256
+
257
+ #### Fuzzy matching uses tiered scoring
258
+
259
+ > **Invariant:** 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.
260
+ >
261
+ > **Rationale:** 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.
262
+
263
+ **Verified by:**
264
+
265
+ - Exact match scores 1.0
266
+ - Exact match is case-insensitive
267
+ - Prefix match scores above 0.9
268
+ - Substring match scores 0.7
269
+ - Levenshtein match for close typos
270
+ - Results are sorted by score descending
271
+ - Prefix matches rank shorter names higher
272
+ - Prefix match scores reflect query coverage
273
+ - Empty query matches all patterns as prefix
274
+ - No candidate patterns returns no results
275
+
276
+ ---
277
+
278
+ #### findBestMatch returns single suggestion
279
+
280
+ > **Invariant:** findBestMatch must return the single highest-scoring match above the threshold, or undefined when no match exceeds the threshold.
281
+ >
282
+ > **Rationale:** A single best suggestion simplifies "did you mean?" prompts in the CLI — returning multiple matches would require additional UI to disambiguate.
283
+
284
+ **Verified by:**
285
+
286
+ - Best match returns suggestion above threshold
287
+ - No match returns undefined when below threshold
288
+
289
+ ---
290
+
291
+ #### Levenshtein distance computation
292
+
293
+ > **Invariant:** The Levenshtein distance function must correctly compute edit distance between strings, returning 0 for identical strings.
294
+ >
295
+ > **Rationale:** Levenshtein distance is the fallback matching tier — incorrect distance computation would produce wrong fuzzy match scores for typo correction.
296
+
297
+ **Verified by:**
298
+
299
+ - Identical strings have distance 0
300
+ - Single character difference
301
+
302
+ _fuzzy-match.feature_
303
+
304
+ ### Generate Docs Cli
305
+
306
+ _Command-line interface for generating documentation from annotated TypeScript._
307
+
308
+ ---
309
+
310
+ #### CLI displays help and version information
311
+
312
+ > **Invariant:** The --help and -v flags must produce usage/version output and exit successfully without requiring other arguments.
313
+ >
314
+ > **Rationale:** Help and version are universal CLI conventions — they must work standalone so users can discover usage without reading external documentation.
315
+
316
+ **Verified by:**
317
+
318
+ - Display help with --help flag
319
+ - Display version with -v flag
320
+
321
+ ---
322
+
323
+ #### CLI requires input patterns
324
+
325
+ > **Invariant:** The generate-docs CLI must fail with a clear error when the --input flag is not provided.
326
+ >
327
+ > **Rationale:** Without input source paths, the generator has nothing to scan — failing early with a clear message prevents confusing "no patterns found" errors downstream.
328
+
329
+ **Verified by:**
330
+
331
+ - Fail without --input flag
332
+
333
+ ---
334
+
335
+ #### CLI lists available generators
336
+
337
+ > **Invariant:** The --list-generators flag must display all registered generator names without performing any generation, including config-registered reference meta-generators.
338
+ >
339
+ > **Rationale:** 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.
340
+
341
+ **Verified by:**
342
+
343
+ - List generators with --list-generators
344
+ - List generators includes config-registered reference meta-generators
345
+
346
+ ---
347
+
348
+ #### CLI generates documentation from source files
349
+
350
+ > **Invariant:** Given valid input patterns and a generator name, the CLI must scan sources, extract patterns, and produce markdown output files.
351
+ >
352
+ > **Rationale:** This is the core pipeline — the CLI is the primary entry point for transforming annotated source code into generated documentation.
353
+
354
+ **Verified by:**
355
+
356
+ - Generate patterns documentation
357
+ - Use default generator (patterns) when not specified
358
+
359
+ ---
360
+
361
+ #### CLI rejects unknown options
362
+
363
+ > **Invariant:** Unrecognized CLI flags must cause an error with a descriptive message rather than being silently ignored.
364
+ >
365
+ > **Rationale:** Silent flag ignoring hides typos and misconfigurations — users typing --ouput instead of --output would get unexpected default behavior without realizing their flag was ignored.
366
+
367
+ **Verified by:**
368
+
369
+ - Unknown option causes error
370
+
371
+ _generate-docs.feature_
372
+
373
+ ### Handoff Generator Tests
374
+
375
+ _Multi-session work loses critical state between sessions when handoff_
376
+
377
+ ---
378
+
379
+ #### Handoff generates compact session state summary
380
+
381
+ > **Invariant:** 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.
382
+ >
383
+ > **Rationale:** 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.
384
+
385
+ **Verified by:**
386
+
387
+ - Generate handoff for in-progress pattern
388
+ - Handoff captures discovered items
389
+ - Session type is inferred from status
390
+ - Completed pattern infers review session type
391
+ - Deferred pattern infers design session type
392
+ - Files modified section included when provided
393
+ - Blockers section shows incomplete dependencies
394
+ - Pattern not found throws error
395
+
396
+ ---
397
+
398
+ #### Formatter produces structured text output
399
+
400
+ > **Invariant:** The handoff formatter must produce structured text output with ADR-008 section markers for machine-parseable session state.
401
+ >
402
+ > **Rationale:** ADR-008 markers enable the context assembler to parse handoff output programmatically — unstructured text would require fragile regex parsing.
403
+
404
+ **Verified by:**
405
+
406
+ - Handoff formatter produces markers per ADR-008
407
+
408
+ _handoff-generator.feature_
409
+
410
+ ### Lint Patterns Cli
411
+
412
+ _Command-line interface for validating pattern annotation quality._
413
+
414
+ ---
415
+
416
+ #### CLI displays help and version information
417
+
418
+ > **Invariant:** The --help and -v flags must produce usage/version output and exit successfully without requiring other arguments.
419
+ >
420
+ > **Rationale:** Help and version are universal CLI conventions — they must work standalone so users can discover usage without reading external documentation.
421
+
422
+ **Verified by:**
423
+
424
+ - Display help with --help flag
425
+ - Display version with -v flag
426
+
427
+ ---
428
+
429
+ #### CLI requires input patterns
430
+
431
+ > **Invariant:** The lint-patterns CLI must fail with a clear error when the --input flag is not provided.
432
+ >
433
+ > **Rationale:** Without input paths, the linter has nothing to validate — failing early prevents confusing "no violations" output that falsely implies clean annotations.
434
+
435
+ **Verified by:**
436
+
437
+ - Fail without --input flag
438
+
439
+ ---
440
+
441
+ #### Lint passes for valid patterns
442
+
443
+ > **Invariant:** Fully annotated patterns with all required tags must pass linting with zero violations.
444
+ >
445
+ > **Rationale:** False positives erode developer trust in the linter — valid annotations must always pass to maintain the tool's credibility.
446
+
447
+ **Verified by:**
448
+
449
+ - Lint passes for complete annotations
450
+
451
+ ---
452
+
453
+ #### Lint detects violations in incomplete patterns
454
+
455
+ > **Invariant:** Patterns with missing or incomplete annotations must produce specific violation reports identifying what is missing.
456
+ >
457
+ > **Rationale:** Actionable violation messages guide developers to fix annotations — generic "lint failed" messages without specifics waste debugging time.
458
+
459
+ **Verified by:**
460
+
461
+ - Report violations for incomplete annotations
462
+
463
+ ---
464
+
465
+ #### CLI supports multiple output formats
466
+
467
+ > **Invariant:** The CLI must support JSON and pretty (human-readable) output formats, with pretty as the default.
468
+ >
469
+ > **Rationale:** Pretty format serves interactive use while JSON format enables CI/CD pipeline integration and programmatic consumption of lint results.
470
+
471
+ **Verified by:**
472
+
473
+ - JSON output format
474
+ - Pretty output format is default
475
+
476
+ ---
477
+
478
+ #### Strict mode treats warnings as errors
479
+
480
+ > **Invariant:** When --strict is enabled, warnings must be promoted to errors causing a non-zero exit code; without --strict, warnings must not cause failure.
481
+ >
482
+ > **Rationale:** CI pipelines need strict enforcement while local development benefits from lenient mode — the flag lets teams choose their enforcement level.
483
+
484
+ **Verified by:**
485
+
486
+ - Strict mode fails on warnings
487
+ - Non-strict mode passes with warnings
488
+
489
+ _lint-patterns.feature_
490
+
491
+ ### Lint Process Cli
492
+
493
+ _Command-line interface for validating changes against delivery process rules._
494
+
495
+ ---
496
+
497
+ #### CLI displays help and version information
498
+
499
+ > **Invariant:** The --help/-h and --version/-v flags must produce usage/version output and exit successfully without requiring other arguments.
500
+ >
501
+ > **Rationale:** Help and version are universal CLI conventions — both short and long flag forms must work for discoverability and scripting compatibility.
502
+
503
+ **Verified by:**
504
+
505
+ - Display help with --help flag
506
+ - Display help with -h flag
507
+ - Display version with --version flag
508
+ - Display version with -v flag
509
+
510
+ ---
511
+
512
+ #### CLI requires git repository for validation
513
+
514
+ > **Invariant:** The lint-process CLI must fail with a clear error when run outside a git repository in both staged and all modes.
515
+ >
516
+ > **Rationale:** Process guard validation depends on git diff for change detection — running without git produces undefined behavior rather than useful validation results.
517
+
518
+ **Verified by:**
519
+
520
+ - Fail without git repository in staged mode
521
+ - Fail without git repository in all mode
522
+
523
+ ---
524
+
525
+ #### CLI validates file mode input
526
+
527
+ > **Invariant:** 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.
528
+ >
529
+ > **Rationale:** 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.
530
+
531
+ **Verified by:**
532
+
533
+ - Fail when files mode has no files
534
+ - Accept file via positional argument
535
+ - Accept file via --file flag
536
+
537
+ ---
538
+
539
+ #### CLI handles no changes gracefully
540
+
541
+ > **Invariant:** When no relevant changes are detected (empty diff), the CLI must exit successfully with a zero exit code.
542
+ >
543
+ > **Rationale:** No changes means no violations are possible — failing on empty diffs would break CI pipelines on commits that only modify non-spec files.
544
+
545
+ **Verified by:**
546
+
547
+ - No changes detected exits successfully
548
+
549
+ ---
550
+
551
+ #### CLI supports multiple output formats
552
+
553
+ > **Invariant:** The CLI must support JSON and pretty (human-readable) output formats, with pretty as the default.
554
+ >
555
+ > **Rationale:** Pretty format serves interactive pre-commit use while JSON format enables CI/CD pipeline integration and automated violation processing.
556
+
557
+ **Verified by:**
558
+
559
+ - JSON output format
560
+ - Pretty output format is default
561
+
562
+ ---
563
+
564
+ #### CLI supports debug options
565
+
566
+ > **Invariant:** The --show-state flag must display the derived process state (FSM states, protection levels, deliverables) without affecting validation behavior.
567
+ >
568
+ > **Rationale:** Process guard decisions are derived from complex state — exposing the intermediate state helps developers understand why a specific validation passed or failed.
569
+
570
+ **Verified by:**
571
+
572
+ - Show state flag displays derived state
573
+
574
+ ---
575
+
576
+ #### CLI warns about unknown flags
577
+
578
+ > **Invariant:** Unrecognized CLI flags must produce a warning message but allow execution to continue.
579
+ >
580
+ > **Rationale:** 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.
581
+
582
+ **Verified by:**
583
+
584
+ - Warn on unknown flag but continue
585
+
586
+ _lint-process.feature_
587
+
588
+ ### Output Pipeline Tests
589
+
590
+ _Validates the output pipeline transforms: summarization, modifiers,_
591
+
592
+ ---
593
+
594
+ #### Output modifiers apply with correct precedence
595
+
596
+ > **Invariant:** 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.
597
+ >
598
+ > **Rationale:** Predictable modifier behavior enables composable CLI queries — unexpected precedence or scalar handling would produce confusing output for piped commands.
599
+
600
+ **Verified by:**
601
+
602
+ - Default mode returns summaries for pattern arrays
603
+ - Count modifier returns integer
604
+ - Names-only modifier returns string array
605
+ - Fields modifier picks specific fields
606
+ - Full modifier bypasses summarization
607
+ - Scalar input passes through unchanged
608
+ - Fields with single field returns objects with one key
609
+
610
+ ---
611
+
612
+ #### Modifier conflicts are rejected
613
+
614
+ > **Invariant:** Mutually exclusive modifier combinations (full+names-only, full+count, full+fields) and invalid field names must be rejected with clear error messages.
615
+ >
616
+ > **Rationale:** Conflicting modifiers produce ambiguous intent — rejecting early with a clear message is better than silently picking one modifier and ignoring the other.
617
+
618
+ **Verified by:**
619
+
620
+ - Full combined with names-only is rejected
621
+ - Full combined with count is rejected
622
+ - Full combined with fields is rejected
623
+ - Invalid field name is rejected
624
+
625
+ ---
626
+
627
+ #### List filters compose via AND logic
628
+
629
+ > **Invariant:** 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.
630
+ >
631
+ > **Rationale:** AND composition is the intuitive default for filters — "status=active AND category=core" should narrow results, not widen them via OR logic.
632
+
633
+ **Verified by:**
634
+
635
+ - Filter by status returns matching patterns
636
+ - Filter by status and category narrows results
637
+ - Pagination with limit and offset
638
+ - Offset beyond array length returns empty results
639
+
640
+ ---
641
+
642
+ #### Empty stripping removes noise
643
+
644
+ > **Invariant:** Null and empty values must be stripped from output objects to reduce noise in API responses.
645
+ >
646
+ > **Rationale:** Empty fields in pattern summaries create visual clutter and waste tokens in AI context windows — stripping them keeps output focused on meaningful data.
647
+
648
+ **Verified by:**
649
+
650
+ - Null and empty values are stripped
651
+
652
+ _output-pipeline.feature_
653
+
654
+ ### Pattern Summarize Tests
655
+
656
+ _Validates that summarizePattern() projects ExtractedPattern (~3.5KB) to_
657
+
658
+ ---
659
+
660
+ #### summarizePattern projects to compact summary
661
+
662
+ > **Invariant:** 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.
663
+ >
664
+ > **Rationale:** Compact summaries reduce token usage by 80-90% compared to full patterns — they provide enough context for navigation without overwhelming AI context windows.
665
+
666
+ **Verified by:**
667
+
668
+ - Summary includes all 6 fields for a TypeScript pattern
669
+ - Summary includes all 6 fields for a Gherkin pattern
670
+ - Summary uses patternName tag over name field
671
+ - Summary omits undefined optional fields
672
+
673
+ ---
674
+
675
+ #### summarizePatterns batch processes arrays
676
+
677
+ > **Invariant:** summarizePatterns must batch-process an array of patterns, returning a correctly-sized array of compact summaries.
678
+ >
679
+ > **Rationale:** Batch processing avoids N individual function calls — the API frequently needs to summarize all patterns matching a query in a single operation.
680
+
681
+ **Verified by:**
682
+
683
+ - Batch summarization returns correct count
684
+
685
+ _summarize.feature_
686
+
687
+ ### Process Api Cli Cache
688
+
689
+ _MasterDataset caching between CLI invocations: cache hits, mtime invalidation, and --no-cache bypass._
690
+
691
+ ---
692
+
693
+ #### MasterDataset is cached between invocations
694
+
695
+ > **Invariant:** 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.
696
+ >
697
+ > **Rationale:** 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.
698
+
699
+ **Verified by:**
700
+
701
+ - Second query uses cached dataset
702
+ - Cache invalidated on source file change
703
+ - No-cache flag bypasses cache
704
+
705
+ _data-api-cache.feature_
706
+
707
+ ### Process Api Cli Core
708
+
709
+ _Core CLI infrastructure: help, version, input validation, status, query, pattern, arch basics, missing args, edge cases._
710
+
711
+ ---
712
+
713
+ #### CLI displays help and version information
714
+
715
+ > **Invariant:** The CLI must always provide discoverable usage and version information via standard flags.
716
+ >
717
+ > **Rationale:** Without accessible help and version output, users cannot self-serve CLI usage or report issues with a specific version.
718
+
719
+ **Verified by:**
720
+
721
+ - Display help with --help flag
722
+ - Display version with -v flag
723
+ - No subcommand shows help
724
+
725
+ ---
726
+
727
+ #### CLI requires input flag for subcommands
728
+
729
+ > **Invariant:** Every data-querying subcommand must receive either an explicit `--input` glob or a project config that provides source globs.
730
+ >
731
+ > **Rationale:** 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.
732
+
733
+ **Verified by:**
734
+
735
+ - Fail without --input flag when running status
736
+ - Use architect.config.js sources when --input is omitted
737
+ - Reject unknown options
738
+
739
+ ---
740
+
741
+ #### CLI status subcommand shows delivery state
742
+
743
+ > **Invariant:** The status subcommand must return structured JSON containing delivery progress derived from the MasterDataset.
744
+ >
745
+ > **Rationale:** Consumers depend on machine-readable status output for scripting and CI integration; unstructured output breaks downstream automation.
746
+
747
+ **Verified by:**
748
+
749
+ - Status shows counts and completion percentage
750
+
751
+ ---
752
+
753
+ #### CLI query subcommand executes API methods
754
+
755
+ > **Invariant:** The query subcommand must dispatch to any public Data API method by name and pass positional arguments through.
756
+ >
757
+ > **Rationale:** 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.
758
+
759
+ **Verified by:**
760
+
761
+ - Query getStatusCounts returns count object
762
+ - Query isValidTransition with arguments
763
+ - Unknown API method shows error
764
+
765
+ ---
766
+
767
+ #### CLI pattern subcommand shows pattern detail
768
+
769
+ > **Invariant:** The pattern subcommand must return the full JSON detail for an exact pattern name match, or a clear error if not found.
770
+ >
771
+ > **Rationale:** Pattern lookup is the primary debugging tool for annotation issues; ambiguous or silent failures waste investigation time.
772
+
773
+ **Verified by:**
774
+
775
+ - Pattern lookup returns full detail
776
+ - Pattern not found shows error
777
+
778
+ ---
779
+
780
+ #### CLI arch subcommand queries architecture
781
+
782
+ > **Invariant:** The arch subcommand must expose role, bounded context, and layer queries over the MasterDataset's architecture metadata.
783
+ >
784
+ > **Rationale:** Architecture queries replace manual exploration of annotated sources; missing or incorrect results lead to wrong structural assumptions during design sessions.
785
+
786
+ **Verified by:**
787
+
788
+ - Arch roles lists roles with counts
789
+ - Arch context filters to bounded context
790
+ - Arch layer lists layers with counts
791
+
792
+ ---
793
+
794
+ #### CLI shows errors for missing subcommand arguments
795
+
796
+ > **Invariant:** Subcommands that require arguments must reject invocations with missing arguments and display usage guidance.
797
+ >
798
+ > **Rationale:** Silent acceptance of incomplete input would produce confusing pipeline errors instead of actionable feedback at the CLI boundary.
799
+
800
+ **Verified by:**
801
+
802
+ - Query without method name shows error
803
+ - Pattern without name shows error
804
+ - Unknown subcommand shows error
805
+
806
+ ---
807
+
808
+ #### CLI handles argument edge cases
809
+
810
+ > **Invariant:** The CLI must gracefully handle non-standard argument forms including numeric coercion and the `--` pnpm separator.
811
+ >
812
+ > **Rationale:** Real-world invocations via pnpm pass `--` separators and numeric strings; mishandling these causes silent data loss or crashes in automated workflows.
813
+
814
+ **Verified by:**
815
+
816
+ - Integer arguments are coerced for phase queries
817
+ - Double-dash separator is handled gracefully
818
+
819
+ _process-api-core.feature_
820
+
821
+ ### Process Api Cli Dry Run
822
+
823
+ _Dry-run mode shows pipeline scope without processing data._
824
+
825
+ ---
826
+
827
+ #### Dry-run shows pipeline scope without processing
828
+
829
+ > **Invariant:** 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.
830
+ >
831
+ > **Rationale:** 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.
832
+
833
+ **Verified by:**
834
+
835
+ - Dry-run shows file counts
836
+ - Dry-run reports architect.config.js auto-detection
837
+
838
+ _data-api-dryrun.feature_
839
+
840
+ ### Process Api Cli Help
841
+
842
+ _Per-subcommand help displays usage, flags, and examples for individual subcommands._
843
+
844
+ ---
845
+
846
+ #### Per-subcommand help shows usage and flags
847
+
848
+ > **Invariant:** 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.
849
+ >
850
+ > **Rationale:** Per-subcommand help replaces the need to scroll through full --help output and provides contextual guidance for subcommand-specific flags like --session.
851
+
852
+ **Verified by:**
853
+
854
+ - Per-subcommand help for context
855
+ - Global help still works
856
+ - Unknown subcommand help
857
+
858
+ _data-api-help.feature_
859
+
860
+ ### Process Api Cli Metadata
861
+
862
+ _Response metadata includes validation summary and pipeline timing for diagnostics._
863
+
864
+ ---
865
+
866
+ #### Response metadata includes validation summary
867
+
868
+ > **Invariant:** Every JSON response envelope must include a metadata.validation object with danglingReferenceCount, malformedPatternCount, unknownStatusCount, and warningCount fields, plus a numeric pipelineMs timing.
869
+ >
870
+ > **Rationale:** Consumers use validation counts to detect annotation quality degradation without running a separate validation pass. Pipeline timing enables performance regression detection in CI.
871
+
872
+ **Verified by:**
873
+
874
+ - Validation summary in response metadata
875
+ - Pipeline timing in metadata
876
+
877
+ _data-api-metadata.feature_
878
+
879
+ ### Process Api Cli Modifiers And Rules
880
+
881
+ _Output modifiers, arch health, and rules subcommand._
882
+
883
+ ---
884
+
885
+ #### Output modifiers work when placed after the subcommand
886
+
887
+ > **Invariant:** Output modifiers (--count, --names-only, --fields) produce identical results regardless of position relative to the subcommand and its filters.
888
+ >
889
+ > **Rationale:** Users should not need to memorize argument ordering rules; the CLI should be forgiving.
890
+
891
+ **Verified by:**
892
+
893
+ - Count modifier after list subcommand returns count
894
+ - Names-only modifier after list subcommand returns names
895
+ - Count modifier combined with list filter
896
+
897
+ ---
898
+
899
+ #### CLI arch health subcommands detect graph quality issues
900
+
901
+ > **Invariant:** Health subcommands (dangling, orphans, blocking) operate on the relationship index, not the architecture index, and return results without requiring arch annotations.
902
+ >
903
+ > **Rationale:** Graph quality issues (broken references, isolated patterns, blocked dependencies) are relationship-level concerns that should be queryable even when no architecture metadata exists.
904
+
905
+ **Verified by:**
906
+
907
+ - Arch dangling returns broken references
908
+ - Arch orphans returns isolated patterns
909
+ - Arch blocking returns blocked patterns
910
+
911
+ ---
912
+
913
+ #### CLI rules subcommand queries business rules and invariants
914
+
915
+ > **Invariant:** The rules subcommand returns structured business rules extracted from Gherkin Rule: blocks, grouped by product area and phase, with parsed invariant and rationale annotations.
916
+ >
917
+ > **Rationale:** Live business rule queries replace static generated markdown, enabling on-demand filtering by product area, pattern, and invariant presence.
918
+
919
+ **Verified by:**
920
+
921
+ - Rules returns business rules from feature files
922
+ - Rules filters by product area
923
+ - Rules with count modifier returns totals
924
+ - Rules with names-only returns flat array
925
+ - Rules filters by pattern name
926
+ - Rules with only-invariants excludes rules without invariants
927
+ - Rules product area filter excludes non-matching areas
928
+ - Rules for non-existent product area returns hint
929
+ - Rules combines product area and only-invariants filters
930
+
931
+ _process-api-modifiers-rules.feature_
932
+
933
+ ### Process Api Cli Repl
934
+
935
+ _Interactive REPL mode keeps the pipeline loaded for multi-query sessions and supports reload._
936
+
937
+ ---
938
+
939
+ #### REPL mode accepts multiple queries on a single pipeline load
940
+
941
+ > **Invariant:** REPL mode loads the pipeline once and accepts multiple queries on stdin, eliminating per-query pipeline overhead.
942
+ >
943
+ > **Rationale:** Design sessions involve 10-20 exploratory queries in sequence. REPL mode eliminates per-query pipeline overhead entirely.
944
+
945
+ **Verified by:**
946
+
947
+ - REPL accepts multiple queries
948
+ - REPL shows help output
949
+
950
+ ---
951
+
952
+ #### REPL reload rebuilds the pipeline from fresh sources
953
+
954
+ > **Invariant:** The reload command rebuilds the pipeline from fresh sources and subsequent queries use the new dataset.
955
+ >
956
+ > **Rationale:** During implementation sessions, source files change frequently. Reload allows refreshing without restarting the REPL.
957
+
958
+ **Verified by:**
959
+
960
+ - REPL reloads pipeline on command
961
+
962
+ _data-api-repl.feature_
963
+
964
+ ### Process Api Cli Subcommands
965
+
966
+ _Discovery subcommands: list, search, context assembly, tags/sources, extended arch, unannotated._
967
+
968
+ ---
969
+
970
+ #### CLI list subcommand filters patterns
971
+
972
+ > **Invariant:** 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.
973
+ >
974
+ > **Rationale:** Consumers parse list output programmatically; malformed JSON or silent failures cause downstream tooling to break without diagnosis.
975
+
976
+ **Verified by:**
977
+
978
+ - List all patterns returns JSON array
979
+ - List with invalid phase shows error
980
+
981
+ ---
982
+
983
+ #### CLI search subcommand finds patterns by fuzzy match
984
+
985
+ > **Invariant:** The search subcommand must require a query argument and return only patterns whose names match the query.
986
+ >
987
+ > **Rationale:** Missing query validation would produce unfiltered result sets, defeating the purpose of search and wasting context budget in AI sessions.
988
+
989
+ **Verified by:**
990
+
991
+ - Search returns matching patterns
992
+ - Search without query shows error
993
+
994
+ ---
995
+
996
+ #### CLI context assembly subcommands return text output
997
+
998
+ > **Invariant:** 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.
999
+ >
1000
+ > **Rationale:** 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.
1001
+
1002
+ **Verified by:**
1003
+
1004
+ - Context returns curated text bundle
1005
+ - Context without pattern name shows error
1006
+ - Overview returns executive summary text
1007
+ - Dep-tree returns dependency tree text
1008
+
1009
+ ---
1010
+
1011
+ #### CLI tags and sources subcommands return JSON
1012
+
1013
+ > **Invariant:** The tags and sources subcommands must return valid JSON with the expected top-level structure (data key for tags, array for sources).
1014
+ >
1015
+ > **Rationale:** Annotation exploration depends on machine-parseable output; invalid JSON prevents automated enrichment workflows from detecting unannotated files and tag gaps.
1016
+
1017
+ **Verified by:**
1018
+
1019
+ - Tags returns tag usage counts
1020
+ - Sources returns file inventory
1021
+
1022
+ ---
1023
+
1024
+ #### CLI extended arch subcommands query architecture relationships
1025
+
1026
+ > **Invariant:** Extended arch subcommands (neighborhood, compare, coverage) must return valid JSON reflecting the actual architecture relationships present in the scanned sources.
1027
+ >
1028
+ > **Rationale:** Architecture queries drive design-session decisions; stale or structurally invalid output leads to incorrect dependency analysis and missed coupling between bounded contexts.
1029
+
1030
+ **Verified by:**
1031
+
1032
+ - Arch neighborhood returns pattern relationships
1033
+ - Arch compare returns context comparison
1034
+ - Arch coverage returns annotation coverage
1035
+
1036
+ ---
1037
+
1038
+ #### CLI unannotated subcommand finds files without annotations
1039
+
1040
+ > **Invariant:** The unannotated subcommand must return valid JSON listing every TypeScript file that lacks the `@architect` opt-in marker.
1041
+ >
1042
+ > **Rationale:** Files missing the opt-in marker are invisible to the scanner; without this subcommand, unannotated files silently drop out of generated documentation and validation.
1043
+
1044
+ **Verified by:**
1045
+
1046
+ - Unannotated finds files missing architect marker
1047
+
1048
+ _process-api-subcommands.feature_
1049
+
1050
+ ### Process Api Reference Tests
1051
+
1052
+ _Verifies that the declarative CLI schema drives reference table generation_
1053
+
1054
+ ---
1055
+
1056
+ #### Generated reference file contains all three table sections
1057
+
1058
+ > **Invariant:** PROCESS-API-REFERENCE.md contains Global Options, Output Modifiers, and List Filters tables generated from the CLI schema.
1059
+
1060
+ **Verified by:**
1061
+
1062
+ - Generated file contains Global Options table
1063
+ - Generated file contains Output Modifiers table
1064
+ - Generated file contains List Filters table
1065
+ - Generated file includes inter-table prose
1066
+
1067
+ ---
1068
+
1069
+ #### CLI schema stays in sync with parser
1070
+
1071
+ > **Invariant:** Every flag recognized by parseArgs() has a corresponding entry in the CLI schema. A missing schema entry means the sync test fails.
1072
+
1073
+ **Verified by:**
1074
+
1075
+ - Schema covers all global option flags
1076
+ - Schema covers all output modifier flags
1077
+ - Schema covers all list filter flags
1078
+ - Schema covers session option
1079
+
1080
+ ---
1081
+
1082
+ #### showHelp output reflects CLI schema
1083
+
1084
+ > **Invariant:** The help text rendered by showHelp() includes all options from the CLI schema, formatted for terminal display.
1085
+
1086
+ **Verified by:**
1087
+
1088
+ - Help text includes schema-defined options
1089
+
1090
+ _process-api-reference.feature_
1091
+
1092
+ ### Process State API
1093
+
1094
+ _- Markdown generation is not ideal for programmatic access_
1095
+
1096
+ ---
1097
+
1098
+ #### Status queries return correct patterns
1099
+
1100
+ > **Invariant:** Status queries must correctly filter by both normalized status (planned = roadmap + deferred) and FSM status (exact match).
1101
+ >
1102
+ > **Rationale:** The two-domain status convention requires separate query methods — mixing them produces incorrect filtered results.
1103
+
1104
+ **Verified by:**
1105
+
1106
+ - Get patterns by normalized status
1107
+ - Get patterns by FSM status
1108
+ - Get current work returns active patterns
1109
+ - Get roadmap items returns roadmap and deferred
1110
+ - Get status counts
1111
+ - Get completion percentage
1112
+
1113
+ ---
1114
+
1115
+ #### Phase queries return correct phase data
1116
+
1117
+ > **Invariant:** Phase queries must return only patterns in the requested phase, with accurate progress counts and completion percentage.
1118
+ >
1119
+ > **Rationale:** Phase-level queries power the roadmap and session planning views — incorrect counts cascade into wrong progress percentages.
1120
+
1121
+ **Verified by:**
1122
+
1123
+ - Get patterns by phase
1124
+ - Get phase progress
1125
+ - Get nonexistent phase returns undefined
1126
+ - Get active phases
1127
+
1128
+ ---
1129
+
1130
+ #### FSM queries expose transition validation
1131
+
1132
+ > **Invariant:** FSM queries must validate transitions against the PDR-005 state machine and expose protection levels per status.
1133
+ >
1134
+ > **Rationale:** Programmatic FSM access enables tooling to enforce delivery process rules without reimplementing the state machine.
1135
+
1136
+ **Verified by:**
1137
+
1138
+ - Check valid transition
1139
+ - Check invalid transition
1140
+ - Get valid transitions from status
1141
+ - Get protection info
1142
+
1143
+ ---
1144
+
1145
+ #### Pattern queries find and retrieve pattern data
1146
+
1147
+ > **Invariant:** Pattern lookup must be case-insensitive by name, and category queries must return only patterns with the requested category.
1148
+ >
1149
+ > **Rationale:** Case-insensitive search reduces friction in CLI and AI agent usage where exact casing is often unknown.
1150
+
1151
+ **Verified by:**
1152
+
1153
+ - Find pattern by name (case insensitive)
1154
+ - Find nonexistent pattern returns undefined
1155
+ - Get patterns by category
1156
+ - Get all categories with counts
1157
+
1158
+ ---
1159
+
1160
+ #### Timeline queries group patterns by time
1161
+
1162
+ > **Invariant:** Quarter queries must correctly filter by quarter string, and recently completed must be sorted by date descending with limit.
1163
+ >
1164
+ > **Rationale:** Timeline grouping enables quarterly reporting and session context — recent completions show delivery momentum.
1165
+
1166
+ **Verified by:**
1167
+
1168
+ - Get patterns by quarter
1169
+ - Get all quarters
1170
+ - Get recently completed sorted by date
1171
+
1172
+ _process-state-api.feature_
1173
+
1174
+ ### Scope Validator Tests
1175
+
1176
+ _Starting an implementation or design session without checking prerequisites_
1177
+
1178
+ ---
1179
+
1180
+ #### Implementation scope validation checks all prerequisites
1181
+
1182
+ > **Invariant:** Implementation scope validation must check FSM transition validity, dependency completeness, PDR references, and deliverable presence, with strict mode promoting warnings to blockers.
1183
+ >
1184
+ > **Rationale:** Starting implementation without passing scope validation wastes an entire session — the validator catches all known blockers before any code is written.
1185
+
1186
+ **Verified by:**
1187
+
1188
+ - All implementation checks pass
1189
+ - Incomplete dependency blocks implementation
1190
+ - FSM transition from completed blocks implementation
1191
+ - Active pattern passes FSM check for implementation
1192
+ - Missing PDR references produce WARN
1193
+ - No deliverables blocks implementation
1194
+ - Strict mode promotes WARN to BLOCKED
1195
+ - Pattern not found throws error
1196
+
1197
+ ---
1198
+
1199
+ #### Design scope validation checks dependency stubs
1200
+
1201
+ > **Invariant:** Design scope validation must verify that dependencies have corresponding code stubs, producing warnings when stubs are missing.
1202
+ >
1203
+ > **Rationale:** Design sessions that reference unstubbed dependencies cannot produce actionable interfaces — stub presence indicates the dependency's API surface is at least sketched.
1204
+
1205
+ **Verified by:**
1206
+
1207
+ - Design session with no dependencies passes
1208
+ - Design session with dependencies lacking stubs produces WARN
1209
+
1210
+ ---
1211
+
1212
+ #### Formatter produces structured text output
1213
+
1214
+ > **Invariant:** The scope validator formatter must produce structured text with ADR-008 markers, showing verdict text for warnings and blocker details for blocked verdicts.
1215
+ >
1216
+ > **Rationale:** Structured formatter output enables the CLI to display verdicts consistently — unstructured output would vary by validation type and be hard to parse.
1217
+
1218
+ **Verified by:**
1219
+
1220
+ - Formatter produces markers per ADR-008
1221
+ - Formatter shows warnings verdict text
1222
+ - Formatter shows blocker details for blocked verdict
1223
+
1224
+ _scope-validator.feature_
1225
+
1226
+ ### Stub Resolver Tests
1227
+
1228
+ _Design session stubs need structured discovery and resolution_
1229
+
1230
+ ---
1231
+
1232
+ #### Stubs are identified by path or target metadata
1233
+
1234
+ > **Invariant:** A pattern must be identified as a stub if it resides in the stubs directory OR has a targetPath metadata field.
1235
+ >
1236
+ > **Rationale:** Dual identification supports both convention-based (directory) and metadata-based (targetPath) stub detection — relying on only one would miss stubs organized differently.
1237
+
1238
+ **Verified by:**
1239
+
1240
+ - Patterns in stubs directory are identified as stubs
1241
+ - Patterns with targetPath are identified as stubs
1242
+
1243
+ ---
1244
+
1245
+ #### Stubs are resolved against the filesystem
1246
+
1247
+ > **Invariant:** Resolved stubs must show whether their target file exists on the filesystem and must be grouped by the pattern they implement.
1248
+ >
1249
+ > **Rationale:** 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.
1250
+
1251
+ **Verified by:**
1252
+
1253
+ - Resolved stubs show target existence status
1254
+ - Stubs are grouped by implementing pattern
1255
+
1256
+ ---
1257
+
1258
+ #### Decision items are extracted from descriptions
1259
+
1260
+ > **Invariant:** AD-N formatted items must be extracted from pattern description text, with empty descriptions returning no items and malformed items being skipped.
1261
+ >
1262
+ > **Rationale:** Decision items (AD-1, AD-2, etc.) link stubs to architectural decisions — extracting them enables traceability from code stubs back to the design rationale.
1263
+
1264
+ **Verified by:**
1265
+
1266
+ - AD-N items are extracted from description text
1267
+ - Empty description returns no decision items
1268
+ - Malformed AD items are skipped
1269
+
1270
+ ---
1271
+
1272
+ #### PDR references are found across patterns
1273
+
1274
+ > **Invariant:** The resolver must find all patterns that reference a given PDR identifier, returning empty results when no references exist.
1275
+ >
1276
+ > **Rationale:** PDR cross-referencing enables impact analysis — knowing which patterns reference a decision helps assess the blast radius of changing that decision.
1277
+
1278
+ **Verified by:**
1279
+
1280
+ - Patterns referencing a PDR are found
1281
+ - No references returns empty result
1282
+
1283
+ _stub-resolver.feature_
1284
+
1285
+ ### Stub Taxonomy Tag Tests
1286
+
1287
+ _Stub metadata (target path, design session) was stored as plain text_
1288
+
1289
+ ---
1290
+
1291
+ #### Taxonomy tags are registered in the registry
1292
+
1293
+ > **Invariant:** The target and since stub metadata tags must be registered in the tag registry as recognized taxonomy entries.
1294
+ >
1295
+ > **Rationale:** Unregistered tags would be flagged as unknown by the linter — registration ensures stub metadata tags pass validation alongside standard annotation tags.
1296
+
1297
+ **Verified by:**
1298
+
1299
+ - Target and since tags exist in registry
1300
+
1301
+ ---
1302
+
1303
+ #### Tags are part of the stub metadata group
1304
+
1305
+ > **Invariant:** The target and since tags must be grouped under the stub metadata domain in the built registry.
1306
+ >
1307
+ > **Rationale:** Domain grouping enables the taxonomy codec to render stub metadata tags in their own section — ungrouped tags would be lost in the "Other" category.
1308
+
1309
+ **Verified by:**
1310
+
1311
+ - Built registry groups target and since as stub tags
1312
+
1313
+ _taxonomy-tags.feature_
1314
+
1315
+ ### Validate Patterns Cli
1316
+
1317
+ _Command-line interface for cross-validating TypeScript patterns vs Gherkin feature files._
1318
+
1319
+ ---
1320
+
1321
+ #### CLI displays help and version information
1322
+
1323
+ > **Invariant:** The --help/-h and --version/-v flags must produce usage/version output and exit successfully without requiring other arguments.
1324
+ >
1325
+ > **Rationale:** Help and version are universal CLI conventions — both short and long flag forms must work for discoverability and scripting compatibility.
1326
+
1327
+ **Verified by:**
1328
+
1329
+ - Display help with --help flag
1330
+ - Display help with -h flag
1331
+ - Display version with --version flag
1332
+ - Display version with -v flag
1333
+
1334
+ ---
1335
+
1336
+ #### CLI requires input and feature patterns
1337
+
1338
+ > **Invariant:** The validate-patterns CLI must fail with clear errors when either --input or --features flags are missing.
1339
+ >
1340
+ > **Rationale:** Cross-source validation requires both TypeScript and Gherkin inputs — running with only one source would produce incomplete validation that misses cross-source mismatches.
1341
+
1342
+ **Verified by:**
1343
+
1344
+ - Fail without --input flag
1345
+ - Fail without --features flag
1346
+
1347
+ ---
1348
+
1349
+ #### CLI validates patterns across TypeScript and Gherkin sources
1350
+
1351
+ > **Invariant:** The validator must detect mismatches between TypeScript and Gherkin sources including phase and status discrepancies.
1352
+ >
1353
+ > **Rationale:** Dual-source architecture requires consistency — a pattern with status "active" in TypeScript but "roadmap" in Gherkin creates conflicting truth and broken reports.
1354
+
1355
+ **Verified by:**
1356
+
1357
+ - Validation passes for matching patterns
1358
+ - Detect phase mismatch between sources
1359
+ - Detect status mismatch between sources
1360
+
1361
+ ---
1362
+
1363
+ #### CLI supports multiple output formats
1364
+
1365
+ > **Invariant:** The CLI must support JSON and pretty (human-readable) output formats, with pretty as the default.
1366
+ >
1367
+ > **Rationale:** Pretty format serves interactive use while JSON format enables CI/CD pipeline integration and programmatic consumption of validation results.
1368
+
1369
+ **Verified by:**
1370
+
1371
+ - JSON output format
1372
+ - Pretty output format is default
1373
+
1374
+ ---
1375
+
1376
+ #### Strict mode treats warnings as errors
1377
+
1378
+ > **Invariant:** 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.
1379
+ >
1380
+ > **Rationale:** CI pipelines need strict enforcement while local development benefits from lenient mode — the flag lets teams choose their enforcement level.
1381
+
1382
+ **Verified by:**
1383
+
1384
+ - Strict mode exits with code 2 on warnings
1385
+ - Non-strict mode passes with warnings
1386
+
1387
+ ---
1388
+
1389
+ #### CLI warns about unknown flags
1390
+
1391
+ > **Invariant:** Unrecognized CLI flags must produce a warning message but allow execution to continue.
1392
+ >
1393
+ > **Rationale:** Pattern validation is non-destructive — warning without failing is more user-friendly than hard errors for minor flag typos, while still surfacing the issue.
1394
+
1395
+ **Verified by:**
1396
+
1397
+ - Warn on unknown flag but continue
1398
+
1399
+ _validate-patterns.feature_
1400
+
1401
+ ---
1402
+
1403
+ [← Back to Business Rules](../BUSINESS-RULES.md)