@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,1462 @@
1
+ # Annotation Business Rules
2
+
3
+ **Purpose:** Business rules for the Annotation product area
4
+
5
+ ---
6
+
7
+ **90 rules** from 21 features. 90 rules have explicit invariants.
8
+
9
+ ---
10
+
11
+ ## Uncategorized
12
+
13
+ ### Ast Parser Exports
14
+
15
+ _The AST Parser extracts @architect-_ directives from TypeScript source files\*
16
+
17
+ ---
18
+
19
+ #### Export types are correctly identified from TypeScript declarations
20
+
21
+ > **Invariant:** Every exported TypeScript declaration type (function, type, interface, const, class, enum, abstract class, arrow function, async function, generic function, default export, re-export) is correctly classified.
22
+ >
23
+ > **Rationale:** Export type classification drives how codecs render API documentation — misclassifying a function as a const (or vice versa) produces incorrect signatures and misleading docs.
24
+
25
+ **Verified by:**
26
+
27
+ - Parse function export with directive
28
+ - Parse type export with directive
29
+ - Parse interface export with directive
30
+ - Parse const export with directive
31
+ - Parse class export with directive
32
+ - Parse enum export with directive
33
+ - Parse const enum export with directive
34
+ - Parse abstract class export with directive
35
+ - Parse arrow function export with directive
36
+ - Parse async function export with directive
37
+ - Parse generic function export with directive
38
+ - Parse default export with directive
39
+ - Parse re-exports with directive
40
+ - Parse multiple exports in single statement
41
+ - Parse multiple directives in same file
42
+
43
+ _ast-parser-exports.feature_
44
+
45
+ ### Ast Parser Metadata
46
+
47
+ _The AST Parser extracts @architect-_ directives from TypeScript source files\*
48
+
49
+ ---
50
+
51
+ #### Metadata is correctly extracted from JSDoc comments
52
+
53
+ > **Invariant:** Examples, multi-line descriptions, line numbers, function signatures, and standard JSDoc tags are all correctly parsed and separated.
54
+ >
55
+ > **Rationale:** Downstream codecs render each metadata field independently — incorrect parsing causes examples to leak into descriptions or signatures to be lost in generated documentation.
56
+
57
+ **Verified by:**
58
+
59
+ - Extract examples from directive
60
+ - Extract multi-line description
61
+ - Track line numbers correctly
62
+ - Extract function signature information
63
+ - Ignore @param and @returns in description
64
+
65
+ ---
66
+
67
+ #### Tags are extracted only from the directive section, not from description or examples
68
+
69
+ > **Invariant:** Only tags appearing in the directive section (before the description) are extracted. Tags mentioned in description prose or example code blocks are ignored.
70
+ >
71
+ > **Rationale:** Tags control taxonomy classification and pattern routing — extracting them from prose or examples would create phantom patterns and corrupt the registry.
72
+
73
+ **Verified by:**
74
+
75
+ - Extract multiple tags from directive section
76
+ - Extract tag with description on same line
77
+ - NOT extract tags mentioned in description
78
+ - NOT extract tags mentioned in @example sections
79
+
80
+ ---
81
+
82
+ #### When to Use sections are extracted in all supported formats
83
+
84
+ > **Invariant:** When to Use content is extracted from heading format with bullet points, inline bold format, and asterisk bullet format. When no When to Use section exists, the field is undefined.
85
+ >
86
+ > **Rationale:** Generated pattern documentation includes a When to Use section — failing to recognize any supported format means valid guidance silently disappears from output.
87
+
88
+ **Verified by:**
89
+
90
+ - Extract When to Use heading format with bullet points
91
+ - Extract When to use inline format
92
+ - Extract asterisk bullets in When to Use section
93
+ - Not set whenToUse when section is missing
94
+
95
+ _ast-parser-metadata.feature_
96
+
97
+ ### Ast Parser Relationships Edges
98
+
99
+ _The AST Parser extracts @architect-_ directives from TypeScript source files\*
100
+
101
+ ---
102
+
103
+ #### Relationship tags extract uses and usedBy dependencies
104
+
105
+ > **Invariant:** The uses and usedBy relationship arrays are populated from directive tags, not from description content. When no relationship tags exist, the fields are undefined.
106
+ >
107
+ > **Rationale:** Relationship data drives dependency diagrams and impact analysis — extracting from prose would produce false edges from incidental mentions.
108
+
109
+ **Verified by:**
110
+
111
+ - Extract @architect-uses with single value
112
+ - Extract @architect-uses with comma-separated values
113
+ - Extract @architect-used-by with single value
114
+ - Extract @architect-used-by with comma-separated values
115
+ - Extract both uses and usedBy from same directive
116
+ - NOT capture uses/usedBy values in description
117
+ - Not set uses/usedBy when no relationship tags exist
118
+
119
+ ---
120
+
121
+ #### Edge cases and malformed input are handled gracefully
122
+
123
+ > **Invariant:** The parser never crashes on invalid input. Files without directives return empty results. Malformed TypeScript returns a structured error with the file path.
124
+ >
125
+ > **Rationale:** The scanner processes hundreds of files in bulk — a single malformed file must not abort the entire pipeline or produce an undiagnosable crash.
126
+
127
+ **Verified by:**
128
+
129
+ - Skip comments without @architect-\* tags
130
+ - Skip invalid directive with incomplete tag
131
+ - Handle malformed TypeScript gracefully
132
+ - Handle empty file gracefully
133
+ - Handle whitespace-only file
134
+ - Handle file with only comments and no exports
135
+ - Skip inline comments (non-block)
136
+ - Handle unicode characters in descriptions
137
+
138
+ _ast-parser-relationships-edges.feature_
139
+
140
+ ### Claude Metadata Parity
141
+
142
+ _The extractor must preserve Claude routing metadata from TypeScript directives_
143
+
144
+ ---
145
+
146
+ #### TypeScript extraction preserves Claude metadata
147
+
148
+ > **Invariant:** Claude routing metadata from TypeScript directives must be copied onto the extracted pattern.
149
+ >
150
+ > **Rationale:** Generated CLAUDE.md modules depend on the extracted pattern fields, so dropping directive metadata breaks downstream document routing.
151
+
152
+ **Verified by:**
153
+
154
+ - Extracted TypeScript pattern keeps Claude metadata
155
+ - Extracted TypeScript pattern includes claudeModule
156
+ - claudeSection
157
+ - and claudeTags
158
+
159
+ ---
160
+
161
+ #### Gherkin sync and async extraction keep Claude and ADR metadata aligned
162
+
163
+ > **Invariant:** Sync and async Gherkin extraction must produce the same Claude and ADR metadata fields.
164
+ >
165
+ > **Rationale:** The async path is a performance optimization, not a different contract. Diverging metadata fields would make generated docs depend on call path.
166
+
167
+ **Verified by:**
168
+
169
+ - Sync and async Gherkin extraction return the same metadata
170
+ - Sync and async extraction match for claudeModule
171
+ - claudeSection
172
+ - claudeTags
173
+ - adrTheme
174
+ - adrLayer
175
+ - and effortActual
176
+
177
+ _claude-metadata-parity.feature_
178
+
179
+ ### Context Inference
180
+
181
+ _Patterns in standard directories (src/validation/, src/scanner/) should_
182
+
183
+ ---
184
+
185
+ #### matchPattern supports recursive wildcard \*\*
186
+
187
+ > **Invariant:** The `**` wildcard matches files at any nesting depth below the specified directory prefix.
188
+ >
189
+ > **Rationale:** Directory hierarchies vary in depth; recursive matching ensures all nested files inherit context.
190
+
191
+ **Verified by:**
192
+
193
+ - Recursive wildcard matches nested paths
194
+
195
+ ---
196
+
197
+ #### matchPattern supports single-level wildcard /\*
198
+
199
+ > **Invariant:** The `/*` wildcard matches only direct children of the specified directory, not deeper nested files.
200
+ >
201
+ > **Rationale:** Some contexts apply only to a specific directory level, not its entire subtree.
202
+
203
+ **Verified by:**
204
+
205
+ - Single-level wildcard matches direct children only
206
+
207
+ ---
208
+
209
+ #### matchPattern supports prefix matching
210
+
211
+ > **Invariant:** A trailing slash pattern matches any file whose path starts with that directory prefix.
212
+ >
213
+ > **Rationale:** Without prefix matching, users would need separate wildcard patterns for each nesting depth, making rule configuration verbose and error-prone.
214
+
215
+ **Verified by:**
216
+
217
+ - Prefix matching behavior
218
+
219
+ ---
220
+
221
+ #### inferContext returns undefined when no rules match
222
+
223
+ > **Invariant:** When no inference rule matches a file path, the pattern receives no inferred context and is excluded from the byContext index.
224
+ >
225
+ > **Rationale:** Unmatched files must not receive a spurious context assignment; absence of context is a valid state.
226
+
227
+ **Verified by:**
228
+
229
+ - Empty rules array returns undefined
230
+ - File path does not match any rule
231
+
232
+ ---
233
+
234
+ #### inferContext applies first matching rule
235
+
236
+ > **Invariant:** When multiple rules could match a file path, only the first matching rule determines the inferred context.
237
+ >
238
+ > **Rationale:** Deterministic ordering prevents ambiguous context assignment when rules overlap.
239
+
240
+ **Verified by:**
241
+
242
+ - Single matching rule infers context
243
+ - First matching rule wins when multiple could match
244
+
245
+ ---
246
+
247
+ #### Explicit archContext is not overridden
248
+
249
+ > **Invariant:** A pattern with an explicitly annotated archContext retains that value regardless of matching inference rules.
250
+ >
251
+ > **Rationale:** Explicit annotations represent intentional developer decisions that must not be silently overwritten by automation.
252
+
253
+ **Verified by:**
254
+
255
+ - Explicit context takes precedence over inference
256
+
257
+ ---
258
+
259
+ #### Inference works independently of archLayer
260
+
261
+ > **Invariant:** Context inference operates on file path alone; the presence or absence of archLayer does not affect context assignment.
262
+ >
263
+ > **Rationale:** Coupling context inference to archLayer would prevent context-based queries from finding patterns that lack explicit layer annotations.
264
+
265
+ **Verified by:**
266
+
267
+ - Pattern without archLayer is still added to byContext if context is inferred
268
+
269
+ ---
270
+
271
+ #### Default rules map standard directories
272
+
273
+ > **Invariant:** Each standard source directory (validation, scanner, extractor, etc.) maps to a well-known bounded context name via the default rule set.
274
+ >
275
+ > **Rationale:** Convention-based mapping eliminates the need for explicit context annotations on every file in standard directories.
276
+
277
+ **Verified by:**
278
+
279
+ - Default directory mappings
280
+
281
+ _context-inference.feature_
282
+
283
+ ### Declaration Level Shape Tagging
284
+
285
+ _Tests the discoverTaggedShapes function that scans TypeScript source_
286
+
287
+ ---
288
+
289
+ #### Declarations opt in via architect-shape tag
290
+
291
+ > **Invariant:** Only declarations with the architect-shape tag in their immediately preceding JSDoc are collected as tagged shapes.
292
+ >
293
+ > **Rationale:** Extracting shapes without an explicit opt-in tag would surface internal implementation details in generated API documentation, violating information hiding.
294
+
295
+ **Verified by:**
296
+
297
+ - Tagged declaration is extracted as shape
298
+ - Untagged exported declaration is not extracted
299
+ - Group name is captured from tag value
300
+ - Bare tag works without group name
301
+ - Non-exported tagged declaration is extracted
302
+ - Tagged type is found despite same-name const declaration
303
+ - Both same-name declarations tagged produces shapes for each
304
+ - Tagged declaration is extracted
305
+ - Untagged export is ignored
306
+ - Bare tag works without group
307
+
308
+ ---
309
+
310
+ #### Discovery uses existing estree parser with JSDoc comment scanning
311
+
312
+ > **Invariant:** The discoverTaggedShapes function uses the existing typescript-estree parse() and extractPrecedingJsDoc() approach.
313
+ >
314
+ > **Rationale:** Introducing a second parser would create divergent AST behavior — reusing the established parser ensures consistent JSDoc handling and avoids subtle extraction differences.
315
+
316
+ **Verified by:**
317
+
318
+ - All five declaration kinds are discoverable
319
+ - JSDoc with gap larger than MAX_JSDOC_LINE_DISTANCE is not matched
320
+ - Tag as last line before closing JSDoc delimiter
321
+ - Hypothetical architect-shape-extended tag is not matched
322
+ - Tag coexists with other JSDoc content
323
+ - Generic arrow function in non-JSX context parses correctly
324
+ - All 5 declaration kinds supported
325
+ - JSDoc gap enforcement
326
+ - Tag with other JSDoc content
327
+
328
+ _declaration-level-shape-tagging.feature_
329
+
330
+ ### Depends On Tag
331
+
332
+ _Tests extraction of @architect-depends-on and @architect-enables_
333
+
334
+ ---
335
+
336
+ #### Depends-on tag is defined in taxonomy registry
337
+
338
+ > **Invariant:** The depends-on and enables tags must exist in the taxonomy registry with CSV format.
339
+ >
340
+ > **Rationale:** Without registry definitions, the data-driven AST parser cannot discover or extract these planning dependency tags from source files.
341
+
342
+ **Verified by:**
343
+
344
+ - Depends-on tag exists in registry
345
+ - Enables tag exists in registry
346
+
347
+ ---
348
+
349
+ #### Depends-on tag is extracted from Gherkin files
350
+
351
+ > **Invariant:** The Gherkin parser must extract depends-on values from feature file tags, including CSV multi-value lists.
352
+ >
353
+ > **Rationale:** Missing dependency extraction causes the dependency tree and blocking-pattern queries to return incomplete results.
354
+
355
+ **Verified by:**
356
+
357
+ - Depends-on extracted from feature file
358
+ - Multiple depends-on values extracted as CSV
359
+
360
+ ---
361
+
362
+ #### Depends-on in TypeScript triggers anti-pattern warning
363
+
364
+ > **Invariant:** The depends-on tag must only appear in Gherkin files; its presence in TypeScript is an anti-pattern.
365
+ >
366
+ > **Rationale:** Depends-on represents planning dependencies owned by Gherkin specs, not runtime dependencies owned by TypeScript.
367
+
368
+ **Verified by:**
369
+
370
+ - Depends-on in TypeScript is detected by lint rule
371
+ - Depends-on in TypeScript is detected by lint rule
372
+
373
+ The depends-on tag is for planning dependencies and belongs in feature
374
+ files
375
+
376
+ - not TypeScript code. TypeScript files should use "uses" for
377
+ runtime dependencies.
378
+
379
+ ---
380
+
381
+ #### Enables tag is extracted from Gherkin files
382
+
383
+ > **Invariant:** The Gherkin parser must extract enables values from feature file tags, including CSV multi-value lists.
384
+ >
385
+ > **Rationale:** Missing enables extraction breaks forward-looking dependency queries, hiding which patterns are unblocked when a prerequisite completes.
386
+
387
+ **Verified by:**
388
+
389
+ - Enables extracted from feature file
390
+ - Multiple enables values extracted as CSV
391
+
392
+ ---
393
+
394
+ #### Planning dependencies are stored in relationship index
395
+
396
+ > **Invariant:** The relationship index must store dependsOn and enables relationships extracted from pattern metadata.
397
+ >
398
+ > **Rationale:** Omitting planning dependencies from the index causes blocking-pattern and critical-path queries to return incomplete results.
399
+
400
+ **Verified by:**
401
+
402
+ - DependsOn relationships stored in relationship index
403
+ - Enables relationships stored explicitly
404
+ - Enables relationships stored explicitly
405
+
406
+ The relationship index stores dependsOn and enables relationships
407
+ directly from pattern metadata. These are explicit declarations.
408
+
409
+ _depends-on-tag.feature_
410
+
411
+ ### Directive Detection
412
+
413
+ _- Full AST parsing of every TypeScript file is expensive and slow_
414
+
415
+ ---
416
+
417
+ #### hasDocDirectives detects @architect-\* section directives
418
+
419
+ > **Invariant:** hasDocDirectives must return true if and only if the source contains at least one @architect-{suffix} directive (case-sensitive, @ required, suffix required).
420
+ >
421
+ > **Rationale:** This is the first-pass filter in the scanner pipeline; false negatives cause patterns to be silently missed, while false positives only waste AST parsing time.
422
+
423
+ **Verified by:**
424
+
425
+ - Detect @architect-core directive in JSDoc block
426
+ - Detect various @architect-\* directives
427
+ - Detect directive anywhere in file content
428
+ - Detect multiple directives on same line
429
+ - Detect directive in inline comment
430
+ - Return false for content without directives
431
+ - Return false for empty content in hasDocDirectives
432
+ - Reject similar but non-matching patterns
433
+
434
+ ---
435
+
436
+ #### hasFileOptIn detects file-level @architect marker
437
+
438
+ > **Invariant:** hasFileOptIn must return true if and only if the source contains a bare @architect tag (not followed by a hyphen) inside a JSDoc block comment; line comments and @architect-\* suffixed tags must not match.
439
+ >
440
+ > **Rationale:** File-level opt-in is the gate for including a file in the scanner pipeline; confusing @architect-core (a section tag) with @architect (file opt-in) would either miss files or over-include them.
441
+
442
+ **Verified by:**
443
+
444
+ - Detect @architect in JSDoc block comment
445
+ - Detect @architect with description on same line
446
+ - Detect @architect in multi-line JSDoc
447
+ - Detect @architect anywhere in file
448
+ - Detect @architect combined with section tags
449
+ - Return false when only section tags present
450
+ - Return false for multiple section tags without opt-in
451
+ - Return false for empty content in hasFileOptIn
452
+ - Return false for @architect in line comment
453
+ - Not confuse @architect-\* with @architect opt-in
454
+
455
+ _directive-detection.feature_
456
+
457
+ ### Doc String Media Type
458
+
459
+ _DocString language hints (mediaType) should be preserved through the parsing_
460
+
461
+ ---
462
+
463
+ #### Parser preserves DocString mediaType during extraction
464
+
465
+ > **Invariant:** The Gherkin parser must retain the mediaType annotation from DocString delimiters through to the parsed AST; DocStrings without a mediaType have undefined mediaType.
466
+ >
467
+ > **Rationale:** Losing the mediaType causes downstream renderers to apply incorrect escaping or default language hints, corrupting code block output.
468
+
469
+ **Verified by:**
470
+
471
+ - Parse DocString with typescript mediaType
472
+ - Parse DocString with json mediaType
473
+ - Parse DocString with jsdoc mediaType
474
+ - DocString without mediaType has undefined mediaType
475
+
476
+ ---
477
+
478
+ #### MediaType is used when rendering code blocks
479
+
480
+ > **Invariant:** The rendered code block language must match the DocString mediaType; when mediaType is absent, the renderer falls back to a caller-specified default language.
481
+ >
482
+ > **Rationale:** Using the wrong language hint causes syntax highlighters to misrender code blocks, and losing mediaType entirely can trigger incorrect escaping (e.g., asterisks in JSDoc).
483
+
484
+ **Verified by:**
485
+
486
+ - TypeScript mediaType renders as typescript code block
487
+ - JSDoc mediaType prevents asterisk escaping
488
+ - Missing mediaType falls back to default language
489
+
490
+ ---
491
+
492
+ #### renderDocString handles both string and object formats
493
+
494
+ > **Invariant:** renderDocString accepts both plain string and object DocString formats; when an object has a mediaType, it takes precedence over the caller-supplied language parameter.
495
+ >
496
+ > **Rationale:** Legacy callers pass raw strings while newer code passes structured objects — the renderer must handle both without breaking existing usage.
497
+
498
+ **Verified by:**
499
+
500
+ - String docString renders correctly (legacy format)
501
+ - Object docString with mediaType takes precedence
502
+
503
+ _docstring-mediatype.feature_
504
+
505
+ ### Dual Source Extractor
506
+
507
+ _- Pattern data split across code stubs and feature files_
508
+
509
+ ---
510
+
511
+ #### Process metadata is extracted from feature tags
512
+
513
+ > **Invariant:** A feature file must have both @pattern and @phase tags to produce valid process metadata; missing either yields null.
514
+ >
515
+ > **Rationale:** Pattern name and phase are the minimum identifiers for placing a pattern in the roadmap — without both, the pattern cannot be tracked.
516
+
517
+ **Verified by:**
518
+
519
+ - Complete process metadata extraction
520
+ - Minimal required tags extraction
521
+ - Missing pattern tag returns null
522
+ - Missing phase tag returns null
523
+
524
+ ---
525
+
526
+ #### Deliverables are extracted from Background tables
527
+
528
+ > **Invariant:** Deliverables are sourced exclusively from Background tables; features without a Background produce an empty deliverable list.
529
+ >
530
+ > **Rationale:** The Background table is the single source of truth for deliverable tracking — extracting from other locations would create ambiguity.
531
+
532
+ **Verified by:**
533
+
534
+ - Standard deliverables table extraction
535
+ - Extended deliverables with Finding and Release
536
+ - Feature without background returns empty
537
+ - Tests column handles various formats
538
+
539
+ ---
540
+
541
+ #### Code and feature patterns are combined into dual-source patterns
542
+
543
+ > **Invariant:** A combined pattern is produced only when both a code stub and a feature file exist for the same pattern name; unmatched sources are tracked separately as code-only or feature-only.
544
+ >
545
+ > **Rationale:** Dual-source combination ensures documentation reflects both implementation intent (code) and specification (Gherkin) — mismatches signal inconsistency.
546
+
547
+ **Verified by:**
548
+
549
+ - Matching code and feature are combined
550
+ - Code-only pattern has no matching feature
551
+ - Feature-only pattern has no matching code
552
+ - Phase mismatch creates validation error
553
+ - Pattern name collision merges sources
554
+
555
+ ---
556
+
557
+ #### Dual-source results are validated for consistency
558
+
559
+ > **Invariant:** Cross-source validation reports errors for metadata mismatches and warnings for orphaned patterns that are still in roadmap status.
560
+ >
561
+ > **Rationale:** Inconsistencies between code stubs and feature files indicate drift — errors catch conflicts while warnings surface missing counterparts that may be intentional.
562
+
563
+ **Verified by:**
564
+
565
+ - Clean results have no errors
566
+ - Cross-validation errors are reported
567
+ - Orphaned roadmap code stubs produce warnings
568
+ - Feature-only roadmap patterns produce warnings
569
+
570
+ ---
571
+
572
+ #### Include tags are extracted from Gherkin feature tags
573
+
574
+ > **Invariant:** Include tags are parsed as comma-separated values; absence of the tag means the pattern has no includes.
575
+ >
576
+ > **Rationale:** Include tags control which patterns appear in scoped diagrams — incorrect parsing drops patterns from diagrams or includes unrelated ones.
577
+
578
+ **Verified by:**
579
+
580
+ - Single include tag is extracted
581
+ - CSV include tag produces multiple values
582
+ - Feature without include tag has no include field
583
+
584
+ _dual-source-extraction.feature_
585
+
586
+ ### Extends Tag
587
+
588
+ _Tests for the @architect-extends tag which establishes generalization_
589
+
590
+ ---
591
+
592
+ #### Extends tag is defined in taxonomy registry
593
+
594
+ > **Invariant:** The extends tag must exist in the taxonomy registry with single-value format.
595
+ >
596
+ > **Rationale:** Without a registry definition, the data-driven AST parser cannot discover or extract the extends tag from source files.
597
+
598
+ **Verified by:**
599
+
600
+ - Extends tag exists in registry
601
+
602
+ ---
603
+
604
+ #### Patterns can extend exactly one base pattern
605
+
606
+ > **Invariant:** A pattern may extend at most one base pattern, enforced by single-value tag format.
607
+ >
608
+ > **Rationale:** Single inheritance avoids diamond-problem ambiguity in pattern generalization hierarchies.
609
+
610
+ **Verified by:**
611
+
612
+ - Parse extends from feature file
613
+ - Extends preserved through extraction pipeline
614
+ - Extends preserved through extraction pipeline
615
+
616
+ Extends uses single-value format because pattern inheritance should be
617
+ single-inheritance to avoid diamond problems.
618
+
619
+ ---
620
+
621
+ #### Transform builds extendedBy reverse lookup
622
+
623
+ > **Invariant:** The transform must compute an extendedBy reverse index so base patterns know which patterns extend them.
624
+ >
625
+ > **Rationale:** Without the reverse index, base patterns cannot discover their extensions, breaking generalization hierarchy navigation in generated docs.
626
+
627
+ **Verified by:**
628
+
629
+ - Extended pattern knows its extensions
630
+
631
+ ---
632
+
633
+ #### Linter detects circular inheritance chains
634
+
635
+ > **Invariant:** Circular inheritance chains (direct or transitive) must be detected and reported as errors.
636
+ >
637
+ > **Rationale:** Circular extends relationships create infinite resolution loops and undefined behavior.
638
+
639
+ **Verified by:**
640
+
641
+ - Direct circular inheritance detected
642
+ - Transitive circular inheritance detected
643
+
644
+ _extends-tag.feature_
645
+
646
+ ### Extraction Pipeline Enhancements
647
+
648
+ _Validates extraction pipeline capabilities for ReferenceDocShowcase:_
649
+
650
+ ---
651
+
652
+ #### Function signatures surface full parameter types in ExportInfo
653
+
654
+ > **Invariant:** ExportInfo.signature shows full parameter types and return type instead of the placeholder value.
655
+ >
656
+ > **Rationale:** Reference documentation renders signatures verbatim — placeholder values instead of real types make the API docs unusable for consumers.
657
+
658
+ **Verified by:**
659
+
660
+ - Simple function signature is extracted with full types
661
+ - Async function keeps async prefix in signature
662
+ - Multi-parameter function has all types in signature
663
+ - Function with object parameter type preserves braces
664
+ - Simple function signature
665
+ - Async function keeps async prefix
666
+ - Multi-parameter function
667
+ - Function with object parameter type
668
+
669
+ ---
670
+
671
+ #### Property-level JSDoc preserves full multi-line content
672
+
673
+ > **Invariant:** Property-level JSDoc preserves full multi-line content without first-line truncation.
674
+ >
675
+ > **Rationale:** Truncated property descriptions lose important behavioral details (defaults, units, constraints) that consumers rely on when integrating with the API.
676
+
677
+ **Verified by:**
678
+
679
+ - Multi-line property JSDoc is fully preserved
680
+ - Single-line property JSDoc still works
681
+ - Multi-line property JSDoc preserved
682
+ - Single-line property JSDoc unchanged
683
+
684
+ ---
685
+
686
+ #### Param returns and throws tags are extracted from function JSDoc
687
+
688
+ > **Invariant:** JSDoc param, returns, and throws tags are extracted and stored on ExtractedShape for function-kind shapes.
689
+ >
690
+ > **Rationale:** Function reference docs require parameter, return, and exception documentation — missing extraction means consumers must read source code instead of generated docs.
691
+
692
+ **Verified by:**
693
+
694
+ - Param tags are extracted from function JSDoc
695
+ - Returns tag is extracted from function JSDoc
696
+ - Throws tags are extracted from function JSDoc
697
+ - JSDoc params with braces type syntax are parsed
698
+ - Param tags extracted
699
+ - Returns tag extracted
700
+ - Throws tags extracted
701
+ - TypeScript-style params without braces
702
+
703
+ ---
704
+
705
+ #### Auto-shape discovery extracts all exported types via wildcard
706
+
707
+ > **Invariant:** When extract-shapes tag value is the wildcard character, all exported declarations are extracted without listing names.
708
+ >
709
+ > **Rationale:** Requiring explicit names for every export creates maintenance burden and stale annotations — wildcard discovery keeps shape docs in sync as exports are added or removed.
710
+
711
+ **Verified by:**
712
+
713
+ - Wildcard extracts all exported declarations
714
+ - Mixed wildcard and names produces warning
715
+ - Same-name type and const exports produce one shape
716
+ - Wildcard extracts all exports
717
+ - Non-exported declarations excluded
718
+ - Mixed wildcard and names rejected
719
+
720
+ _extraction-pipeline-enhancements.feature_
721
+
722
+ ### File Discovery
723
+
724
+ _The file discovery system uses glob patterns to find TypeScript files_
725
+
726
+ ---
727
+
728
+ #### Glob patterns match TypeScript source files
729
+
730
+ > **Invariant:** findFilesToScan must return absolute paths for all files matching the configured glob patterns.
731
+ >
732
+ > **Rationale:** Downstream pipeline stages (AST parser, extractor) require absolute paths to read file contents; relative paths would break when baseDir differs from cwd.
733
+
734
+ **Verified by:**
735
+
736
+ - Find TypeScript files matching glob patterns
737
+ - Return absolute paths
738
+ - Support multiple glob patterns
739
+
740
+ ---
741
+
742
+ #### Default exclusions filter non-source files
743
+
744
+ > **Invariant:** node_modules, dist, .test.ts, .spec.ts, and .d.ts files must be excluded by default without explicit configuration.
745
+ >
746
+ > **Rationale:** Scanning generated output (dist), third-party code (node_modules), or test files would produce false positives in the pattern registry and waste processing time.
747
+
748
+ **Verified by:**
749
+
750
+ - Exclude node_modules by default
751
+ - Exclude dist directory by default
752
+ - Exclude test files by default
753
+ - Exclude .d.ts declaration files
754
+
755
+ ---
756
+
757
+ #### Custom configuration extends discovery behavior
758
+
759
+ > **Invariant:** User-provided exclude patterns must be applied in addition to (not replacing) the default exclusions.
760
+ >
761
+ > **Rationale:** Replacing defaults with custom patterns would silently re-include node_modules and dist, causing false positives in the pattern registry.
762
+
763
+ **Verified by:**
764
+
765
+ - Respect custom exclude patterns
766
+ - Return empty array when no files match
767
+ - Handle nested directory structures
768
+
769
+ _file-discovery.feature_
770
+
771
+ ### Gherkin Ast Parser
772
+
773
+ _The Gherkin AST parser extracts feature metadata, scenarios, and steps_
774
+
775
+ ---
776
+
777
+ #### Successful feature file parsing extracts complete metadata
778
+
779
+ > **Invariant:** A valid feature file must produce a ParsedFeature with name, description, language, tags, and all nested scenarios with their steps.
780
+ >
781
+ > **Rationale:** Downstream generators (timeline, business rules) depend on complete AST extraction; missing fields cause silent gaps in generated documentation.
782
+
783
+ **Verified by:**
784
+
785
+ - Parse valid feature file with pattern metadata
786
+ - Parse multiple scenarios
787
+ - Handle feature without tags
788
+
789
+ ---
790
+
791
+ #### Invalid Gherkin produces structured errors
792
+
793
+ > **Invariant:** Malformed or incomplete Gherkin input must return a Result.err with the source file path and a descriptive error message.
794
+ >
795
+ > **Rationale:** The scanner processes many feature files in batch; structured errors allow graceful degradation and per-file error reporting rather than aborting the entire scan.
796
+
797
+ **Verified by:**
798
+
799
+ - Return error for malformed Gherkin
800
+ - Return error for file without feature
801
+
802
+ _gherkin-parser.feature_
803
+
804
+ ### Implements Tag Processing
805
+
806
+ _Tests for the @architect-implements tag which links implementation files_
807
+
808
+ ---
809
+
810
+ #### Implements tag is defined in taxonomy registry
811
+
812
+ > **Invariant:** The implements tag must exist in the taxonomy registry with CSV format.
813
+ >
814
+ > **Rationale:** Without a registry definition, the data-driven AST parser cannot discover or extract the implements tag from source files.
815
+
816
+ **Verified by:**
817
+
818
+ - Implements tag exists in registry
819
+ - Implements tag exists in registry
820
+
821
+ The tag registry defines `implements` with CSV format
822
+
823
+ - enabling the
824
+ data-driven AST parser to automatically extract it.
825
+
826
+ ---
827
+
828
+ #### Files can implement a single pattern
829
+
830
+ > **Invariant:** The AST parser must extract a single implements value and preserve it through the extraction pipeline.
831
+ >
832
+ > **Rationale:** Lost implements values sever the link between implementation files and their roadmap specs, breaking traceability.
833
+
834
+ **Verified by:**
835
+
836
+ - Parse implements with single pattern
837
+ - Implements preserved through extraction pipeline
838
+
839
+ ---
840
+
841
+ #### Files can implement multiple patterns using CSV format
842
+
843
+ > **Invariant:** The AST parser must split CSV implements values into individual pattern references with whitespace trimming.
844
+ >
845
+ > **Rationale:** Unsplit or untrimmed CSV values produce invalid pattern references that fail relationship index lookups.
846
+
847
+ **Verified by:**
848
+
849
+ - Parse implements with multiple patterns
850
+ - CSV values are trimmed
851
+
852
+ ---
853
+
854
+ #### Transform builds implementedBy reverse lookup
855
+
856
+ > **Invariant:** The transform must compute an implementedBy reverse index so spec patterns know which files implement them.
857
+ >
858
+ > **Rationale:** Without the reverse index, roadmap specs cannot discover their implementation files, breaking traceability and DoD validation.
859
+
860
+ **Verified by:**
861
+
862
+ - Single implementation creates reverse lookup
863
+ - Multiple implementations aggregate
864
+
865
+ ---
866
+
867
+ #### Schemas validate implements field correctly
868
+
869
+ > **Invariant:** The Zod schemas must accept implements and implementedBy fields with correct array-of-string types.
870
+ >
871
+ > **Rationale:** Schema rejection of valid implements/implementedBy values causes runtime parse failures that silently drop traceability links.
872
+
873
+ **Verified by:**
874
+
875
+ - DocDirective schema accepts implements
876
+ - RelationshipEntry schema accepts implementedBy
877
+
878
+ _implements-tag.feature_
879
+
880
+ ### Layer Inference
881
+
882
+ _- Manual layer annotation in every feature file is tedious and error-prone_
883
+
884
+ ---
885
+
886
+ #### Timeline layer is detected from /timeline/ directory segments
887
+
888
+ > **Invariant:** Any feature file path containing a /timeline/ directory segment is classified as timeline layer.
889
+ >
890
+ > **Rationale:** Timeline features track phased delivery progress and must be grouped separately for roadmap generation and phase filtering.
891
+
892
+ **Verified by:**
893
+
894
+ - Detect timeline features from /timeline/ path
895
+ - Detect timeline features regardless of parent directories
896
+ - Detect timeline features in Architect package
897
+
898
+ ---
899
+
900
+ #### Domain layer is detected from business context directory segments
901
+
902
+ > **Invariant:** Feature files in /deciders/, /orders/, or /inventory/ directories are classified as domain layer.
903
+ >
904
+ > **Rationale:** Domain features define core business rules and must be distinguished from infrastructure tests for accurate coverage reporting.
905
+
906
+ **Verified by:**
907
+
908
+ - Detect decider features as domain
909
+ - Detect orders features as domain
910
+ - Detect inventory features as domain
911
+
912
+ ---
913
+
914
+ #### Integration layer is detected and takes priority over domain directories
915
+
916
+ > **Invariant:** Paths containing /integration-features/ or /integration/ are classified as integration, even when they also contain domain directory names.
917
+ >
918
+ > **Rationale:** Integration tests nested under domain directories (e.g., /integration/orders/) would be misclassified as domain without explicit priority, skewing layer coverage metrics.
919
+
920
+ **Verified by:**
921
+
922
+ - Detect integration-features directory as integration
923
+ - Detect /integration/ directory as integration
924
+ - Integration takes priority over orders subdirectory
925
+ - Integration takes priority over inventory subdirectory
926
+
927
+ ---
928
+
929
+ #### E2E layer is detected from /e2e/ directory segments
930
+
931
+ > **Invariant:** Any feature file path containing an /e2e/ directory segment is classified as e2e layer.
932
+ >
933
+ > **Rationale:** E2E tests require separate execution infrastructure and longer timeouts; misclassification would mix them into faster test suites.
934
+
935
+ **Verified by:**
936
+
937
+ - Detect e2e features from /e2e/ path
938
+ - Detect e2e features in frontend app
939
+ - Detect e2e-journeys as e2e
940
+
941
+ ---
942
+
943
+ #### Component layer is detected from tool-specific directory segments
944
+
945
+ > **Invariant:** Feature files in /scanner/ or /lint/ directories are classified as component layer.
946
+ >
947
+ > **Rationale:** Tool-specific features test internal pipeline stages and must be isolated from business domain and integration layers in documentation grouping.
948
+
949
+ **Verified by:**
950
+
951
+ - Detect scanner features as component
952
+ - Detect lint features as component
953
+
954
+ ---
955
+
956
+ #### Unknown layer is the fallback for unclassified paths
957
+
958
+ > **Invariant:** Any feature file path that does not match a known layer pattern is classified as unknown.
959
+ >
960
+ > **Rationale:** Silently dropping unclassified features would create invisible gaps in test coverage; the unknown fallback ensures every feature is accounted for.
961
+
962
+ **Verified by:**
963
+
964
+ - Return unknown for unclassified paths
965
+ - Return unknown for root-level features
966
+ - Return unknown for generic test paths
967
+
968
+ ---
969
+
970
+ #### Path normalization handles cross-platform and case differences
971
+
972
+ > **Invariant:** Layer inference produces correct results regardless of path separators, case, or absolute vs relative paths.
973
+ >
974
+ > **Rationale:** The consumer monorepo runs on multiple platforms; platform-dependent classification would produce inconsistent documentation across developer machines and CI.
975
+
976
+ **Verified by:**
977
+
978
+ - Handle Windows-style paths with backslashes
979
+ - Be case-insensitive
980
+ - Handle mixed path separators
981
+ - Handle absolute Unix paths
982
+ - Handle Windows absolute paths
983
+ - Timeline in filename only should not match
984
+ - Timeline detected even with deep nesting
985
+
986
+ ---
987
+
988
+ #### FEATURE_LAYERS constant provides validated layer enumeration
989
+
990
+ > **Invariant:** FEATURE_LAYERS is a readonly array containing exactly all 6 valid layer values.
991
+ >
992
+ > **Rationale:** Consumers iterate over FEATURE_LAYERS for exhaustive layer handling; a mutable or incomplete array would cause missed layers at runtime.
993
+
994
+ **Verified by:**
995
+
996
+ - FEATURE_LAYERS contains all valid layer values
997
+ - FEATURE_LAYERS has exactly 6 layers
998
+ - FEATURE_LAYERS is a readonly array
999
+
1000
+ _layer-inference.feature_
1001
+
1002
+ ### Pattern Tag Extraction
1003
+
1004
+ _- Gherkin tags are flat strings needing semantic interpretation_
1005
+
1006
+ ---
1007
+
1008
+ #### Single value tags produce scalar metadata fields
1009
+
1010
+ > **Invariant:** Each single-value tag (pattern, phase, status, brief) maps to exactly one metadata field with the correct type.
1011
+ >
1012
+ > **Rationale:** Incorrect type coercion (e.g., phase as string instead of number) causes downstream pipeline failures in filtering and sorting.
1013
+
1014
+ **Verified by:**
1015
+
1016
+ - Extract pattern name tag
1017
+ - Extract phase number tag
1018
+ - Extract status roadmap tag
1019
+ - Extract status deferred tag
1020
+ - Extract status completed tag
1021
+ - Extract status active tag
1022
+ - Extract brief path tag
1023
+
1024
+ ---
1025
+
1026
+ #### Array value tags accumulate into list metadata fields
1027
+
1028
+ > **Invariant:** Tags for depends-on and enables split comma-separated values and accumulate across multiple tag occurrences.
1029
+ >
1030
+ > **Rationale:** Missing a dependency value silently breaks the dependency graph, causing incorrect build ordering and orphaned pattern references.
1031
+
1032
+ **Verified by:**
1033
+
1034
+ - Extract single dependency
1035
+ - Extract comma-separated dependencies
1036
+ - Extract comma-separated enables
1037
+
1038
+ ---
1039
+
1040
+ #### Category tags are colon-free tags filtered against known non-categories
1041
+
1042
+ > **Invariant:** Tags without colons become categories, except known non-category tags (acceptance-criteria, happy-path) and the architect opt-in marker.
1043
+ >
1044
+ > **Rationale:** Including test-control tags (acceptance-criteria, happy-path) as categories pollutes the pattern taxonomy with non-semantic values.
1045
+
1046
+ **Verified by:**
1047
+
1048
+ - Extract category tags (no colon)
1049
+ - architect opt-in marker is NOT a category
1050
+
1051
+ ---
1052
+
1053
+ #### Complex tag lists produce fully populated metadata
1054
+
1055
+ > **Invariant:** All tag types (scalar, array, category) are correctly extracted from a single mixed tag list.
1056
+ >
1057
+ > **Rationale:** Real feature files combine many tag types; extraction must handle all types simultaneously without interference between parsers.
1058
+
1059
+ **Verified by:**
1060
+
1061
+ - Extract all metadata from complex tag list
1062
+
1063
+ ---
1064
+
1065
+ #### Edge cases produce safe defaults
1066
+
1067
+ > **Invariant:** Empty or invalid inputs produce empty metadata or omit invalid fields rather than throwing errors.
1068
+ >
1069
+ > **Rationale:** Throwing on malformed tags would abort extraction for the entire file, losing valid metadata from well-formed tags.
1070
+
1071
+ **Verified by:**
1072
+
1073
+ - Empty tag list returns empty metadata
1074
+ - Invalid phase number is ignored
1075
+
1076
+ ---
1077
+
1078
+ #### Convention tags support CSV values with whitespace trimming
1079
+
1080
+ > **Invariant:** Convention tags split comma-separated values and trim whitespace from each value.
1081
+ >
1082
+ > **Rationale:** Untrimmed whitespace creates distinct values for the same convention, causing false negatives in convention-based filtering and validation.
1083
+
1084
+ **Verified by:**
1085
+
1086
+ - Extract single convention tag
1087
+ - Extract CSV convention tags
1088
+ - Convention tag trims whitespace in CSV values
1089
+
1090
+ ---
1091
+
1092
+ #### Registry-driven extraction handles enums, transforms, and value constraints
1093
+
1094
+ > **Invariant:** Tags defined in the registry use data-driven extraction with enum validation, CSV accumulation, value transforms, and constraint checking.
1095
+ >
1096
+ > **Rationale:** Hard-coded if/else branches for each tag type cannot scale; registry-driven extraction ensures new tags are supported by configuration, not code changes.
1097
+
1098
+ **Verified by:**
1099
+
1100
+ - Registry-driven enum tag without prior if/else branch
1101
+ - Registry-driven enum rejects invalid value
1102
+ - Registry-driven CSV tag accumulates values
1103
+ - Transform applies hyphen-to-space on business value
1104
+ - Transform applies ADR number padding
1105
+ - Transform strips quotes from title tag
1106
+ - Repeatable value tag accumulates multiple occurrences
1107
+ - CSV with values constraint rejects invalid values
1108
+
1109
+ _pattern-tag-extraction.feature_
1110
+
1111
+ ### Scanner Core
1112
+
1113
+ _- Need to scan entire codebases for documentation directives efficiently_
1114
+
1115
+ ---
1116
+
1117
+ #### scanPatterns extracts directives from TypeScript files
1118
+
1119
+ > **Invariant:** Every file with a valid opt-in marker and JSDoc directives produces a complete ScannedFile with tags, description, examples, and exports.
1120
+ >
1121
+ > **Rationale:** Downstream generators depend on complete directive data; partial extraction causes silent documentation gaps across the monorepo.
1122
+
1123
+ **Verified by:**
1124
+
1125
+ - Scan files and extract directives
1126
+ - Skip files without directives
1127
+ - Extract complete directive information
1128
+
1129
+ ---
1130
+
1131
+ #### scanPatterns collects errors without aborting
1132
+
1133
+ > **Invariant:** A parse failure in one file never prevents other files from being scanned; the result is always Ok with errors collected separately.
1134
+ >
1135
+ > **Rationale:** In a monorepo with hundreds of files, a single syntax error must not block the entire documentation pipeline.
1136
+
1137
+ **Verified by:**
1138
+
1139
+ - Collect errors for files that fail to parse
1140
+ - Always return Ok result even with broken files
1141
+
1142
+ ---
1143
+
1144
+ #### Pattern matching and exclusion filtering
1145
+
1146
+ > **Invariant:** Glob patterns control file discovery and exclusion patterns remove matched files before scanning.
1147
+ >
1148
+ > **Rationale:** Without exclusion filtering, internal directories and generated files would pollute the pattern registry with false positives and slow down scanning.
1149
+
1150
+ **Verified by:**
1151
+
1152
+ - Return empty results when no patterns match
1153
+ - Respect exclusion patterns
1154
+ - Handle multiple files with multiple directives each
1155
+
1156
+ ---
1157
+
1158
+ #### File opt-in requirement gates scanning
1159
+
1160
+ > **Invariant:** Only files containing a standalone @architect marker (not @architect-\*) are eligible for directive extraction.
1161
+ >
1162
+ > **Rationale:** Without opt-in gating, every TypeScript file in the monorepo would be parsed, wasting processing time on files that have no documentation directives.
1163
+
1164
+ **Verified by:**
1165
+
1166
+ - Handle files with quick directive check optimization
1167
+ - Skip files without @architect file-level opt-in
1168
+ - Not confuse @architect-\* with @architect opt-in
1169
+ - Detect @architect opt-in combined with section tags
1170
+
1171
+ _scanner-core.feature_
1172
+
1173
+ ### Shape Extraction Rendering
1174
+
1175
+ _Validates the shape extraction system that extracts TypeScript type_
1176
+
1177
+ ---
1178
+
1179
+ #### Multiple shapes are extracted in specified order
1180
+
1181
+ > **Invariant:** Extracted shapes appear in the order specified by the tag list, not in source file declaration order.
1182
+ >
1183
+ > **Rationale:** Documentation consumers rely on tag-specified ordering for consistent, predictable layout regardless of how source files are organized.
1184
+
1185
+ **Verified by:**
1186
+
1187
+ - Shapes appear in tag order not source order
1188
+ - Mixed shape types in specified order
1189
+
1190
+ ---
1191
+
1192
+ #### Extracted shapes render as fenced code blocks
1193
+
1194
+ > **Invariant:** Every extracted shape renders as a fenced TypeScript code block in the markdown output.
1195
+ >
1196
+ > **Rationale:** Fenced code blocks provide syntax highlighting and preserve type definition formatting, which is essential for readable API documentation.
1197
+
1198
+ **Verified by:**
1199
+
1200
+ - Render shapes as markdown
1201
+
1202
+ ---
1203
+
1204
+ #### Imported and re-exported shapes are tracked separately
1205
+
1206
+ > **Invariant:** Shapes resolved via import or re-export statements are classified distinctly from locally declared shapes.
1207
+ >
1208
+ > **Rationale:** Silently extracting imported types as if they were local declarations would produce duplicate or misleading documentation, since the canonical definition lives in another file.
1209
+
1210
+ **Verified by:**
1211
+
1212
+ - Imported shape produces warning
1213
+ - Re-exported shape produces re-export entry
1214
+
1215
+ ---
1216
+
1217
+ #### Invalid TypeScript produces error result
1218
+
1219
+ > **Invariant:** Malformed TypeScript source returns an error Result instead of throwing or producing partial shapes.
1220
+ >
1221
+ > **Rationale:** Unhandled parse exceptions would crash the pipeline mid-run, preventing all subsequent files from being processed.
1222
+
1223
+ **Verified by:**
1224
+
1225
+ - Malformed TypeScript returns error
1226
+
1227
+ ---
1228
+
1229
+ #### Shape rendering supports grouping options
1230
+
1231
+ > **Invariant:** The `groupInSingleBlock` option controls whether shapes render in one combined code fence or in separate per-shape code fences.
1232
+ >
1233
+ > **Rationale:** Different documentation layouts require different grouping strategies; a single block provides compact overviews while separate blocks allow per-type commentary.
1234
+
1235
+ **Verified by:**
1236
+
1237
+ - Grouped rendering in single code block
1238
+ - Separate rendering with multiple code blocks
1239
+
1240
+ ---
1241
+
1242
+ #### Annotation tags are stripped from extracted JSDoc while preserving standard tags
1243
+
1244
+ > **Invariant:** Extracted shapes never contain @architect-\* annotation lines in their jsDoc field.
1245
+ >
1246
+ > **Rationale:** Shape JSDoc is rendered in documentation output. Annotation tags are metadata for the extraction pipeline, not user-visible documentation content.
1247
+
1248
+ **Verified by:**
1249
+
1250
+ - JSDoc with only annotation tags produces no jsDoc
1251
+ - Mixed JSDoc preserves standard tags and strips annotation tags
1252
+ - Single-line annotation-only JSDoc produces no jsDoc
1253
+ - Consecutive empty lines after tag removal are collapsed
1254
+
1255
+ ---
1256
+
1257
+ #### Large source files are rejected to prevent memory exhaustion
1258
+
1259
+ > **Invariant:** Source files exceeding 5MB are rejected before parsing begins.
1260
+ >
1261
+ > **Rationale:** Feeding unbounded input to the TypeScript parser risks out-of-memory crashes that would halt the entire extraction pipeline.
1262
+
1263
+ **Verified by:**
1264
+
1265
+ - Source code exceeding 5MB limit returns error
1266
+
1267
+ _shape-extraction-rendering.feature_
1268
+
1269
+ ### Shape Extraction Types
1270
+
1271
+ _Validates the shape extraction system that extracts TypeScript type_
1272
+
1273
+ ---
1274
+
1275
+ #### extract-shapes tag exists in registry with CSV format
1276
+
1277
+ > **Invariant:** The `extract-shapes` tag must be registered with CSV format so multiple shape names can be specified in a single annotation.
1278
+ >
1279
+ > **Rationale:** Without CSV format registration, the tag parser cannot split comma-separated shape lists, causing only the first shape to be extracted.
1280
+
1281
+ **Verified by:**
1282
+
1283
+ - Tag registry contains extract-shapes with correct format
1284
+
1285
+ ---
1286
+
1287
+ #### Interfaces are extracted from TypeScript AST
1288
+
1289
+ > **Invariant:** Every named interface declaration in a TypeScript source file must be extractable as a shape with kind `interface`, including generics, extends clauses, and JSDoc.
1290
+ >
1291
+ > **Rationale:** Interfaces are the primary API surface for TypeScript libraries; failing to extract them leaves the most important type contracts undocumented.
1292
+
1293
+ **Verified by:**
1294
+
1295
+ - Extract simple interface
1296
+ - Extract interface with JSDoc
1297
+ - Extract interface with generics
1298
+ - Extract interface with extends
1299
+ - Non-existent shape produces not-found entry
1300
+
1301
+ ---
1302
+
1303
+ #### Property-level JSDoc is extracted for interface properties
1304
+
1305
+ > **Invariant:** Property-level JSDoc must be attributed only to the immediately adjacent property, never inherited from the parent interface declaration.
1306
+ >
1307
+ > **Rationale:** Misattributing interface-level JSDoc to the first property produces incorrect per-field documentation and misleads consumers about individual property semantics. The extractor uses strict adjacency (gap = 1 line) to prevent interface-level JSDoc from being misattributed to the first property.
1308
+
1309
+ **Verified by:**
1310
+
1311
+ - Extract properties with adjacent JSDoc
1312
+ - Interface JSDoc not attributed to first property
1313
+ - Mixed documented and undocumented properties
1314
+
1315
+ ---
1316
+
1317
+ #### Type aliases are extracted from TypeScript AST
1318
+
1319
+ > **Invariant:** Union types, mapped types, and conditional types must all be extractable as shapes with kind `type`, preserving their full type expression.
1320
+ >
1321
+ > **Rationale:** Type aliases encode domain constraints (e.g., discriminated unions, mapped utilities) that are essential for API documentation; omitting them hides the type-level design.
1322
+
1323
+ **Verified by:**
1324
+
1325
+ - Extract union type alias
1326
+ - Extract mapped type
1327
+ - Extract conditional type
1328
+
1329
+ ---
1330
+
1331
+ #### Enums are extracted from TypeScript AST
1332
+
1333
+ > **Invariant:** Both regular and const enums must be extractable as shapes with kind `enum`, including their member values.
1334
+ >
1335
+ > **Rationale:** Enums define finite value sets used in validation and serialization; missing them from documentation forces consumers to read source code to discover valid values.
1336
+
1337
+ **Verified by:**
1338
+
1339
+ - Extract string enum
1340
+ - Extract const enum
1341
+
1342
+ ---
1343
+
1344
+ #### Function signatures are extracted with body omitted
1345
+
1346
+ > **Invariant:** Extracted function shapes must include the full signature (name, parameters, return type, async modifier) but never the implementation body.
1347
+ >
1348
+ > **Rationale:** Including function bodies in documentation exposes implementation details, inflates output size, and creates a maintenance burden when internals change without signature changes.
1349
+
1350
+ **Verified by:**
1351
+
1352
+ - Extract function signature
1353
+ - Extract async function signature
1354
+
1355
+ ---
1356
+
1357
+ #### Const declarations are extracted from TypeScript AST
1358
+
1359
+ > **Invariant:** Const declarations must be extractable as shapes with kind `const`, whether or not they carry an explicit type annotation.
1360
+ >
1361
+ > **Rationale:** Constants define configuration defaults, version strings, and sentinel values that consumers depend on; excluding them creates documentation gaps for public API surface.
1362
+
1363
+ **Verified by:**
1364
+
1365
+ - Extract const with type annotation
1366
+ - Extract const without type annotation
1367
+
1368
+ ---
1369
+
1370
+ #### Non-exported shapes are extractable
1371
+
1372
+ > **Invariant:** Shape extraction must succeed for declarations regardless of export status, with the `exported` flag accurately reflecting visibility.
1373
+ >
1374
+ > **Rationale:** Internal types often define the core domain model; restricting extraction to exports only would omit types that are essential for understanding module internals.
1375
+
1376
+ **Verified by:**
1377
+
1378
+ - Extract non-exported interface
1379
+ - Re-export marks internal shape as exported
1380
+
1381
+ _shape-extraction-types.feature_
1382
+
1383
+ ### Uses Tag
1384
+
1385
+ _Tests extraction and processing of @architect-uses and @architect-used-by_
1386
+
1387
+ ---
1388
+
1389
+ #### Uses tag is defined in taxonomy registry
1390
+
1391
+ > **Invariant:** The uses and used-by tags must be registered in the taxonomy with CSV format and dependency-related purpose descriptions.
1392
+ >
1393
+ > **Rationale:** Without registry definitions, the data-driven AST parser cannot discover or extract these tags from source files.
1394
+
1395
+ **Verified by:**
1396
+
1397
+ - Uses tag exists in registry
1398
+ - Used-by tag exists in registry
1399
+
1400
+ ---
1401
+
1402
+ #### Uses tag is extracted from TypeScript files
1403
+
1404
+ > **Invariant:** The AST parser must extract single and comma-separated uses values from TypeScript JSDoc annotations.
1405
+ >
1406
+ > **Rationale:** Missing or malformed uses extraction breaks runtime dependency tracking and produces incomplete relationship diagrams.
1407
+
1408
+ **Verified by:**
1409
+
1410
+ - Single uses value extracted
1411
+ - Multiple uses values extracted as CSV
1412
+
1413
+ ---
1414
+
1415
+ #### Used-by tag is extracted from TypeScript files
1416
+
1417
+ > **Invariant:** The AST parser must extract single and comma-separated used-by values from TypeScript JSDoc annotations.
1418
+ >
1419
+ > **Rationale:** Missing used-by extraction prevents reverse dependency lookups, leaving consumers unable to discover which patterns depend on them.
1420
+
1421
+ **Verified by:**
1422
+
1423
+ - Single used-by value extracted
1424
+ - Multiple used-by values extracted as CSV
1425
+
1426
+ ---
1427
+
1428
+ #### Uses relationships are stored in relationship index
1429
+
1430
+ > **Invariant:** All declared uses and usedBy relationships must be stored in the relationship index as explicitly declared entries.
1431
+ >
1432
+ > **Rationale:** Omitting relationships from the index causes dependency diagrams and impact-analysis queries to silently miss connections.
1433
+
1434
+ **Verified by:**
1435
+
1436
+ - Uses relationships stored in relationship index
1437
+ - UsedBy relationships stored explicitly
1438
+ - UsedBy relationships stored explicitly
1439
+
1440
+ The relationship index stores uses and usedBy relationships directly
1441
+ from pattern metadata. Unlike implements
1442
+
1443
+ - these are explicit declarations.
1444
+
1445
+ ---
1446
+
1447
+ #### Schemas validate uses field correctly
1448
+
1449
+ > **Invariant:** DocDirective and RelationshipEntry schemas must accept uses and usedBy fields as valid CSV string values.
1450
+ >
1451
+ > **Rationale:** Schema rejection of valid uses/usedBy values causes runtime parse failures that silently drop relationship data.
1452
+
1453
+ **Verified by:**
1454
+
1455
+ - DocDirective schema accepts uses
1456
+ - RelationshipEntry schema accepts usedBy
1457
+
1458
+ _uses-tag.feature_
1459
+
1460
+ ---
1461
+
1462
+ [← Back to Business Rules](../BUSINESS-RULES.md)