spectra-cli 4.1.1 → 4.3.0

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 (682) hide show
  1. package/README.md +12 -5
  2. package/dist/.spectra-build-meta.json +9 -0
  3. package/dist/adapters/go-adapter.d.ts.map +1 -1
  4. package/dist/adapters/go-adapter.js +2 -0
  5. package/dist/adapters/go-adapter.js.map +1 -1
  6. package/dist/adapters/index.d.ts +1 -1
  7. package/dist/adapters/index.d.ts.map +1 -1
  8. package/dist/adapters/java-adapter.d.ts.map +1 -1
  9. package/dist/adapters/java-adapter.js +2 -0
  10. package/dist/adapters/java-adapter.js.map +1 -1
  11. package/dist/adapters/language-adapter.d.ts +42 -9
  12. package/dist/adapters/language-adapter.d.ts.map +1 -1
  13. package/dist/adapters/python-adapter.d.ts +34 -6
  14. package/dist/adapters/python-adapter.d.ts.map +1 -1
  15. package/dist/adapters/python-adapter.js +168 -61
  16. package/dist/adapters/python-adapter.js.map +1 -1
  17. package/dist/adapters/ts-js-adapter.d.ts +13 -5
  18. package/dist/adapters/ts-js-adapter.d.ts.map +1 -1
  19. package/dist/adapters/ts-js-adapter.js +55 -14
  20. package/dist/adapters/ts-js-adapter.js.map +1 -1
  21. package/dist/batch/batch-orchestrator.d.ts +74 -5
  22. package/dist/batch/batch-orchestrator.d.ts.map +1 -1
  23. package/dist/batch/batch-orchestrator.js +583 -70
  24. package/dist/batch/batch-orchestrator.js.map +1 -1
  25. package/dist/batch/delta-regenerator.d.ts +2 -2
  26. package/dist/batch/delta-regenerator.d.ts.map +1 -1
  27. package/dist/batch/delta-regenerator.js +21 -28
  28. package/dist/batch/delta-regenerator.js.map +1 -1
  29. package/dist/batch/module-grouper.d.ts +9 -2
  30. package/dist/batch/module-grouper.d.ts.map +1 -1
  31. package/dist/batch/module-grouper.js +3 -1
  32. package/dist/batch/module-grouper.js.map +1 -1
  33. package/dist/batch/regen-plan.d.ts +78 -0
  34. package/dist/batch/regen-plan.d.ts.map +1 -0
  35. package/dist/batch/regen-plan.js +93 -0
  36. package/dist/batch/regen-plan.js.map +1 -0
  37. package/dist/cli/commands/batch.d.ts.map +1 -1
  38. package/dist/cli/commands/batch.js +36 -8
  39. package/dist/cli/commands/batch.js.map +1 -1
  40. package/dist/cli/commands/graph.js +1 -1
  41. package/dist/cli/commands/graph.js.map +1 -1
  42. package/dist/cli/commands/index.d.ts +8 -0
  43. package/dist/cli/commands/index.d.ts.map +1 -0
  44. package/dist/cli/commands/index.js +274 -0
  45. package/dist/cli/commands/index.js.map +1 -0
  46. package/dist/cli/commands/query.d.ts.map +1 -1
  47. package/dist/cli/commands/query.js +3 -1
  48. package/dist/cli/commands/query.js.map +1 -1
  49. package/dist/cli/commands/scaffold-kb.d.ts +9 -0
  50. package/dist/cli/commands/scaffold-kb.d.ts.map +1 -0
  51. package/dist/cli/commands/scaffold-kb.js +179 -0
  52. package/dist/cli/commands/scaffold-kb.js.map +1 -0
  53. package/dist/cli/index.js +33 -14
  54. package/dist/cli/index.js.map +1 -1
  55. package/dist/cli/utils/error-handler.d.ts +0 -6
  56. package/dist/cli/utils/error-handler.d.ts.map +1 -1
  57. package/dist/cli/utils/error-handler.js +0 -13
  58. package/dist/cli/utils/error-handler.js.map +1 -1
  59. package/dist/cli/utils/parse-args.d.ts +55 -3
  60. package/dist/cli/utils/parse-args.d.ts.map +1 -1
  61. package/dist/cli/utils/parse-args.js +176 -13
  62. package/dist/cli/utils/parse-args.js.map +1 -1
  63. package/dist/cli/version-meta.d.ts +16 -0
  64. package/dist/cli/version-meta.d.ts.map +1 -0
  65. package/dist/cli/version-meta.js +28 -0
  66. package/dist/cli/version-meta.js.map +1 -0
  67. package/dist/core/ast-analyzer.d.ts.map +1 -1
  68. package/dist/core/ast-analyzer.js +75 -5
  69. package/dist/core/ast-analyzer.js.map +1 -1
  70. package/dist/core/import-resolver.d.ts +93 -0
  71. package/dist/core/import-resolver.d.ts.map +1 -0
  72. package/dist/core/import-resolver.js +414 -0
  73. package/dist/core/import-resolver.js.map +1 -0
  74. package/dist/core/query-mappers/base-mapper.d.ts +13 -0
  75. package/dist/core/query-mappers/base-mapper.d.ts.map +1 -1
  76. package/dist/core/query-mappers/go-mapper.d.ts +68 -0
  77. package/dist/core/query-mappers/go-mapper.d.ts.map +1 -1
  78. package/dist/core/query-mappers/go-mapper.js +421 -0
  79. package/dist/core/query-mappers/go-mapper.js.map +1 -1
  80. package/dist/core/query-mappers/java-mapper.d.ts +196 -0
  81. package/dist/core/query-mappers/java-mapper.d.ts.map +1 -1
  82. package/dist/core/query-mappers/java-mapper.js +600 -0
  83. package/dist/core/query-mappers/java-mapper.js.map +1 -1
  84. package/dist/core/query-mappers/python-mapper.d.ts +55 -0
  85. package/dist/core/query-mappers/python-mapper.d.ts.map +1 -1
  86. package/dist/core/query-mappers/python-mapper.js +273 -0
  87. package/dist/core/query-mappers/python-mapper.js.map +1 -1
  88. package/dist/core/query-mappers/typescript-mapper.d.ts +102 -0
  89. package/dist/core/query-mappers/typescript-mapper.d.ts.map +1 -1
  90. package/dist/core/query-mappers/typescript-mapper.js +470 -0
  91. package/dist/core/query-mappers/typescript-mapper.js.map +1 -1
  92. package/dist/core/single-spec-orchestrator.d.ts +21 -0
  93. package/dist/core/single-spec-orchestrator.d.ts.map +1 -1
  94. package/dist/core/single-spec-orchestrator.js +187 -23
  95. package/dist/core/single-spec-orchestrator.js.map +1 -1
  96. package/dist/core/skeleton-hash.d.ts +33 -0
  97. package/dist/core/skeleton-hash.d.ts.map +1 -0
  98. package/dist/core/skeleton-hash.js +76 -0
  99. package/dist/core/skeleton-hash.js.map +1 -0
  100. package/dist/core/tree-sitter-analyzer.d.ts +7 -0
  101. package/dist/core/tree-sitter-analyzer.d.ts.map +1 -1
  102. package/dist/core/tree-sitter-analyzer.js +32 -1
  103. package/dist/core/tree-sitter-analyzer.js.map +1 -1
  104. package/dist/core/tree-sitter-fallback.d.ts +12 -4
  105. package/dist/core/tree-sitter-fallback.d.ts.map +1 -1
  106. package/dist/core/tree-sitter-fallback.js +160 -12
  107. package/dist/core/tree-sitter-fallback.js.map +1 -1
  108. package/dist/extraction/extraction-types.d.ts +25 -25
  109. package/dist/extraction/image-extractor.d.ts.map +1 -1
  110. package/dist/extraction/image-extractor.js +3 -1
  111. package/dist/extraction/image-extractor.js.map +1 -1
  112. package/dist/extraction/markdown-extractor.d.ts.map +1 -1
  113. package/dist/extraction/markdown-extractor.js +3 -1
  114. package/dist/extraction/markdown-extractor.js.map +1 -1
  115. package/dist/generator/frontmatter.d.ts +5 -0
  116. package/dist/generator/frontmatter.d.ts.map +1 -1
  117. package/dist/generator/frontmatter.js +4 -0
  118. package/dist/generator/frontmatter.js.map +1 -1
  119. package/dist/generator/index-generator.d.ts +3 -3
  120. package/dist/generator/index-generator.d.ts.map +1 -1
  121. package/dist/generator/index-generator.js +1 -1
  122. package/dist/generator/index-generator.js.map +1 -1
  123. package/dist/graph/directory-graph.d.ts +14 -4
  124. package/dist/graph/directory-graph.d.ts.map +1 -1
  125. package/dist/graph/directory-graph.js +71 -128
  126. package/dist/graph/directory-graph.js.map +1 -1
  127. package/dist/graph/mermaid-renderer.d.ts +8 -5
  128. package/dist/graph/mermaid-renderer.d.ts.map +1 -1
  129. package/dist/graph/mermaid-renderer.js +3 -3
  130. package/dist/graph/mermaid-renderer.js.map +1 -1
  131. package/dist/graph/topological-sort.d.ts +13 -6
  132. package/dist/graph/topological-sort.d.ts.map +1 -1
  133. package/dist/graph/topological-sort.js +2 -2
  134. package/dist/graph/topological-sort.js.map +1 -1
  135. package/dist/kb-mcp/index.d.ts +14 -0
  136. package/dist/kb-mcp/index.d.ts.map +1 -0
  137. package/dist/kb-mcp/index.js +24 -0
  138. package/dist/kb-mcp/index.js.map +1 -0
  139. package/dist/kb-mcp/lib/kb-error.d.ts +21 -0
  140. package/dist/kb-mcp/lib/kb-error.d.ts.map +1 -0
  141. package/dist/kb-mcp/lib/kb-error.js +28 -0
  142. package/dist/kb-mcp/lib/kb-error.js.map +1 -0
  143. package/dist/kb-mcp/lib/kb-locator.d.ts +58 -0
  144. package/dist/kb-mcp/lib/kb-locator.d.ts.map +1 -0
  145. package/dist/kb-mcp/lib/kb-locator.js +85 -0
  146. package/dist/kb-mcp/lib/kb-locator.js.map +1 -0
  147. package/dist/kb-mcp/lib/result-merger.d.ts +35 -0
  148. package/dist/kb-mcp/lib/result-merger.d.ts.map +1 -0
  149. package/dist/kb-mcp/lib/result-merger.js +64 -0
  150. package/dist/kb-mcp/lib/result-merger.js.map +1 -0
  151. package/dist/kb-mcp/server.d.ts +12 -0
  152. package/dist/kb-mcp/server.d.ts.map +1 -0
  153. package/dist/kb-mcp/server.js +29 -0
  154. package/dist/kb-mcp/server.js.map +1 -0
  155. package/dist/kb-mcp/tools/kb-api-lookup.d.ts +28 -0
  156. package/dist/kb-mcp/tools/kb-api-lookup.d.ts.map +1 -0
  157. package/dist/kb-mcp/tools/kb-api-lookup.js +237 -0
  158. package/dist/kb-mcp/tools/kb-api-lookup.js.map +1 -0
  159. package/dist/kb-mcp/tools/kb-doc-lookup.d.ts +20 -0
  160. package/dist/kb-mcp/tools/kb-doc-lookup.d.ts.map +1 -0
  161. package/dist/kb-mcp/tools/kb-doc-lookup.js +92 -0
  162. package/dist/kb-mcp/tools/kb-doc-lookup.js.map +1 -0
  163. package/dist/kb-mcp/tools/kb-search.d.ts +23 -0
  164. package/dist/kb-mcp/tools/kb-search.d.ts.map +1 -0
  165. package/dist/kb-mcp/tools/kb-search.js +126 -0
  166. package/dist/kb-mcp/tools/kb-search.js.map +1 -0
  167. package/dist/knowledge-graph/call-resolver.d.ts +64 -0
  168. package/dist/knowledge-graph/call-resolver.d.ts.map +1 -0
  169. package/dist/knowledge-graph/call-resolver.js +323 -0
  170. package/dist/knowledge-graph/call-resolver.js.map +1 -0
  171. package/dist/knowledge-graph/import-resolver.d.ts +39 -0
  172. package/dist/knowledge-graph/import-resolver.d.ts.map +1 -0
  173. package/dist/knowledge-graph/import-resolver.js +214 -0
  174. package/dist/knowledge-graph/import-resolver.js.map +1 -0
  175. package/dist/knowledge-graph/incremental.d.ts +131 -0
  176. package/dist/knowledge-graph/incremental.d.ts.map +1 -0
  177. package/dist/knowledge-graph/incremental.js +432 -0
  178. package/dist/knowledge-graph/incremental.js.map +1 -0
  179. package/dist/knowledge-graph/index.d.ts +85 -0
  180. package/dist/knowledge-graph/index.d.ts.map +1 -0
  181. package/dist/knowledge-graph/index.js +198 -0
  182. package/dist/knowledge-graph/index.js.map +1 -0
  183. package/dist/knowledge-graph/module-derivation.d.ts +252 -0
  184. package/dist/knowledge-graph/module-derivation.d.ts.map +1 -0
  185. package/dist/knowledge-graph/module-derivation.js +418 -0
  186. package/dist/knowledge-graph/module-derivation.js.map +1 -0
  187. package/dist/knowledge-graph/persistence.d.ts +310 -0
  188. package/dist/knowledge-graph/persistence.d.ts.map +1 -0
  189. package/dist/knowledge-graph/persistence.js +280 -0
  190. package/dist/knowledge-graph/persistence.js.map +1 -0
  191. package/dist/knowledge-graph/query-helpers.d.ts +191 -0
  192. package/dist/knowledge-graph/query-helpers.d.ts.map +1 -0
  193. package/dist/knowledge-graph/query-helpers.js +559 -0
  194. package/dist/knowledge-graph/query-helpers.js.map +1 -0
  195. package/dist/knowledge-graph/relativize.d.ts +51 -0
  196. package/dist/knowledge-graph/relativize.d.ts.map +1 -0
  197. package/dist/knowledge-graph/relativize.js +104 -0
  198. package/dist/knowledge-graph/relativize.js.map +1 -0
  199. package/dist/knowledge-graph/unified-graph.d.ts +310 -0
  200. package/dist/knowledge-graph/unified-graph.d.ts.map +1 -0
  201. package/dist/knowledge-graph/unified-graph.js +182 -0
  202. package/dist/knowledge-graph/unified-graph.js.map +1 -0
  203. package/dist/mcp/agent-context-tools.d.ts +53 -0
  204. package/dist/mcp/agent-context-tools.d.ts.map +1 -0
  205. package/dist/mcp/agent-context-tools.js +806 -0
  206. package/dist/mcp/agent-context-tools.js.map +1 -0
  207. package/dist/mcp/file-nav-tools.d.ts +42 -0
  208. package/dist/mcp/file-nav-tools.d.ts.map +1 -0
  209. package/dist/mcp/file-nav-tools.js +318 -0
  210. package/dist/mcp/file-nav-tools.js.map +1 -0
  211. package/dist/mcp/graph-tools.d.ts +22 -0
  212. package/dist/mcp/graph-tools.d.ts.map +1 -1
  213. package/dist/mcp/graph-tools.js +204 -133
  214. package/dist/mcp/graph-tools.js.map +1 -1
  215. package/dist/mcp/lib/file-nav-helpers.d.ts +128 -0
  216. package/dist/mcp/lib/file-nav-helpers.d.ts.map +1 -0
  217. package/dist/mcp/lib/file-nav-helpers.js +305 -0
  218. package/dist/mcp/lib/file-nav-helpers.js.map +1 -0
  219. package/dist/mcp/lib/response-helpers.d.ts +67 -0
  220. package/dist/mcp/lib/response-helpers.d.ts.map +1 -0
  221. package/dist/mcp/lib/response-helpers.js +103 -0
  222. package/dist/mcp/lib/response-helpers.js.map +1 -0
  223. package/dist/mcp/lib/telemetry.d.ts +69 -0
  224. package/dist/mcp/lib/telemetry.d.ts.map +1 -0
  225. package/dist/mcp/lib/telemetry.js +113 -0
  226. package/dist/mcp/lib/telemetry.js.map +1 -0
  227. package/dist/mcp/lib/tool-response.d.ts +46 -0
  228. package/dist/mcp/lib/tool-response.d.ts.map +1 -0
  229. package/dist/mcp/lib/tool-response.js +83 -0
  230. package/dist/mcp/lib/tool-response.js.map +1 -0
  231. package/dist/mcp/server.d.ts +14 -1
  232. package/dist/mcp/server.d.ts.map +1 -1
  233. package/dist/mcp/server.js +216 -158
  234. package/dist/mcp/server.js.map +1 -1
  235. package/dist/models/call-site.d.ts +68 -0
  236. package/dist/models/call-site.d.ts.map +1 -0
  237. package/dist/models/call-site.js +60 -0
  238. package/dist/models/call-site.js.map +1 -0
  239. package/dist/models/code-skeleton.d.ts +80 -6
  240. package/dist/models/code-skeleton.d.ts.map +1 -1
  241. package/dist/models/code-skeleton.js +30 -0
  242. package/dist/models/code-skeleton.js.map +1 -1
  243. package/dist/models/drift-item.d.ts +4 -4
  244. package/dist/models/module-spec.d.ts +173 -94
  245. package/dist/models/module-spec.d.ts.map +1 -1
  246. package/dist/models/module-spec.js +6 -0
  247. package/dist/models/module-spec.js.map +1 -1
  248. package/dist/panoramic/adr-decision-pipeline.d.ts +53 -0
  249. package/dist/panoramic/adr-decision-pipeline.d.ts.map +1 -0
  250. package/dist/panoramic/adr-decision-pipeline.js +685 -0
  251. package/dist/panoramic/adr-decision-pipeline.js.map +1 -0
  252. package/dist/panoramic/api-surface-generator.d.ts +56 -0
  253. package/dist/panoramic/api-surface-generator.d.ts.map +1 -0
  254. package/dist/panoramic/api-surface-generator.js +1671 -0
  255. package/dist/panoramic/api-surface-generator.js.map +1 -0
  256. package/dist/panoramic/architecture-ir-builder.d.ts +19 -0
  257. package/dist/panoramic/architecture-ir-builder.d.ts.map +1 -0
  258. package/dist/panoramic/architecture-ir-builder.js +561 -0
  259. package/dist/panoramic/architecture-ir-builder.js.map +1 -0
  260. package/dist/panoramic/architecture-ir-exporters.d.ts +7 -0
  261. package/dist/panoramic/architecture-ir-exporters.d.ts.map +1 -0
  262. package/dist/panoramic/architecture-ir-exporters.js +183 -0
  263. package/dist/panoramic/architecture-ir-exporters.js.map +1 -0
  264. package/dist/panoramic/architecture-ir-generator.d.ts +36 -0
  265. package/dist/panoramic/architecture-ir-generator.d.ts.map +1 -0
  266. package/dist/panoramic/architecture-ir-generator.js +51 -0
  267. package/dist/panoramic/architecture-ir-generator.js.map +1 -0
  268. package/dist/panoramic/architecture-ir-mermaid-adapter.d.ts +6 -0
  269. package/dist/panoramic/architecture-ir-mermaid-adapter.d.ts.map +1 -0
  270. package/dist/panoramic/architecture-ir-mermaid-adapter.js +98 -0
  271. package/dist/panoramic/architecture-ir-mermaid-adapter.js.map +1 -0
  272. package/dist/panoramic/architecture-ir-model.d.ts +87 -0
  273. package/dist/panoramic/architecture-ir-model.d.ts.map +1 -0
  274. package/dist/panoramic/architecture-ir-model.js +20 -0
  275. package/dist/panoramic/architecture-ir-model.js.map +1 -0
  276. package/dist/panoramic/architecture-narrative.d.ts +68 -0
  277. package/dist/panoramic/architecture-narrative.d.ts.map +1 -0
  278. package/dist/panoramic/architecture-narrative.js +401 -0
  279. package/dist/panoramic/architecture-narrative.js.map +1 -0
  280. package/dist/panoramic/architecture-overview-generator.d.ts +31 -0
  281. package/dist/panoramic/architecture-overview-generator.d.ts.map +1 -0
  282. package/dist/panoramic/architecture-overview-generator.js +454 -0
  283. package/dist/panoramic/architecture-overview-generator.js.map +1 -0
  284. package/dist/panoramic/architecture-overview-model.d.ts +77 -0
  285. package/dist/panoramic/architecture-overview-model.d.ts.map +1 -0
  286. package/dist/panoramic/architecture-overview-model.js +31 -0
  287. package/dist/panoramic/architecture-overview-model.js.map +1 -0
  288. package/dist/panoramic/batch-project-docs.d.ts.map +1 -1
  289. package/dist/panoramic/batch-project-docs.js +4 -2
  290. package/dist/panoramic/batch-project-docs.js.map +1 -1
  291. package/dist/panoramic/builders/component-view-builder.d.ts +25 -1
  292. package/dist/panoramic/builders/component-view-builder.d.ts.map +1 -1
  293. package/dist/panoramic/builders/component-view-builder.js +83 -3
  294. package/dist/panoramic/builders/component-view-builder.js.map +1 -1
  295. package/dist/panoramic/builders/doc-graph-builder.d.ts +15 -2
  296. package/dist/panoramic/builders/doc-graph-builder.d.ts.map +1 -1
  297. package/dist/panoramic/builders/doc-graph-builder.js +20 -0
  298. package/dist/panoramic/builders/doc-graph-builder.js.map +1 -1
  299. package/dist/panoramic/component-view-builder.d.ts +17 -0
  300. package/dist/panoramic/component-view-builder.d.ts.map +1 -0
  301. package/dist/panoramic/component-view-builder.js +652 -0
  302. package/dist/panoramic/component-view-builder.js.map +1 -0
  303. package/dist/panoramic/component-view-model.d.ts +127 -0
  304. package/dist/panoramic/component-view-model.d.ts.map +1 -0
  305. package/dist/panoramic/component-view-model.js +65 -0
  306. package/dist/panoramic/component-view-model.js.map +1 -0
  307. package/dist/panoramic/config-reference-generator.d.ts +78 -0
  308. package/dist/panoramic/config-reference-generator.d.ts.map +1 -0
  309. package/dist/panoramic/config-reference-generator.js +199 -0
  310. package/dist/panoramic/config-reference-generator.js.map +1 -0
  311. package/dist/panoramic/coverage-auditor.d.ts +95 -0
  312. package/dist/panoramic/coverage-auditor.d.ts.map +1 -0
  313. package/dist/panoramic/coverage-auditor.js +290 -0
  314. package/dist/panoramic/coverage-auditor.js.map +1 -0
  315. package/dist/panoramic/cross-package-analyzer.d.ts +112 -0
  316. package/dist/panoramic/cross-package-analyzer.d.ts.map +1 -0
  317. package/dist/panoramic/cross-package-analyzer.js +258 -0
  318. package/dist/panoramic/cross-package-analyzer.js.map +1 -0
  319. package/dist/panoramic/data-model-generator.d.ts +528 -0
  320. package/dist/panoramic/data-model-generator.d.ts.map +1 -0
  321. package/dist/panoramic/data-model-generator.js +647 -0
  322. package/dist/panoramic/data-model-generator.js.map +1 -0
  323. package/dist/panoramic/doc-graph-builder.d.ts +80 -0
  324. package/dist/panoramic/doc-graph-builder.d.ts.map +1 -0
  325. package/dist/panoramic/doc-graph-builder.js +352 -0
  326. package/dist/panoramic/doc-graph-builder.js.map +1 -0
  327. package/dist/panoramic/docs-bundle-manifest-reader.d.ts +26 -0
  328. package/dist/panoramic/docs-bundle-manifest-reader.d.ts.map +1 -0
  329. package/dist/panoramic/docs-bundle-manifest-reader.js +106 -0
  330. package/dist/panoramic/docs-bundle-manifest-reader.js.map +1 -0
  331. package/dist/panoramic/docs-bundle-orchestrator.d.ts +14 -0
  332. package/dist/panoramic/docs-bundle-orchestrator.d.ts.map +1 -0
  333. package/dist/panoramic/docs-bundle-orchestrator.js +538 -0
  334. package/dist/panoramic/docs-bundle-orchestrator.js.map +1 -0
  335. package/dist/panoramic/docs-bundle-profiles.d.ts +4 -0
  336. package/dist/panoramic/docs-bundle-profiles.d.ts.map +1 -0
  337. package/dist/panoramic/docs-bundle-profiles.js +82 -0
  338. package/dist/panoramic/docs-bundle-profiles.js.map +1 -0
  339. package/dist/panoramic/docs-bundle-types.d.ts +94 -0
  340. package/dist/panoramic/docs-bundle-types.d.ts.map +1 -0
  341. package/dist/panoramic/docs-bundle-types.js +10 -0
  342. package/dist/panoramic/docs-bundle-types.js.map +1 -0
  343. package/dist/panoramic/docs-quality-evaluator.d.ts +31 -0
  344. package/dist/panoramic/docs-quality-evaluator.d.ts.map +1 -0
  345. package/dist/panoramic/docs-quality-evaluator.js +941 -0
  346. package/dist/panoramic/docs-quality-evaluator.js.map +1 -0
  347. package/dist/panoramic/docs-quality-model.d.ts +125 -0
  348. package/dist/panoramic/docs-quality-model.d.ts.map +1 -0
  349. package/dist/panoramic/docs-quality-model.js +166 -0
  350. package/dist/panoramic/docs-quality-model.js.map +1 -0
  351. package/dist/panoramic/dynamic-scenarios-builder.d.ts +18 -0
  352. package/dist/panoramic/dynamic-scenarios-builder.d.ts.map +1 -0
  353. package/dist/panoramic/dynamic-scenarios-builder.js +316 -0
  354. package/dist/panoramic/dynamic-scenarios-builder.js.map +1 -0
  355. package/dist/panoramic/event-surface-generator.d.ts +52 -0
  356. package/dist/panoramic/event-surface-generator.d.ts.map +1 -0
  357. package/dist/panoramic/event-surface-generator.js +507 -0
  358. package/dist/panoramic/event-surface-generator.js.map +1 -0
  359. package/dist/panoramic/generator-registry.d.ts +1 -1
  360. package/dist/panoramic/generator-registry.d.ts.map +1 -1
  361. package/dist/panoramic/generator-registry.js +5 -2
  362. package/dist/panoramic/generator-registry.js.map +1 -1
  363. package/dist/panoramic/generators/cross-package-analyzer.d.ts +5 -5
  364. package/dist/panoramic/generators/cross-package-analyzer.d.ts.map +1 -1
  365. package/dist/panoramic/generators/cross-package-analyzer.js +1 -1
  366. package/dist/panoramic/generators/cross-package-analyzer.js.map +1 -1
  367. package/dist/panoramic/generators/data-model-generator.d.ts +27 -27
  368. package/dist/panoramic/graph/confidence-mapper.d.ts +18 -0
  369. package/dist/panoramic/graph/confidence-mapper.d.ts.map +1 -1
  370. package/dist/panoramic/graph/confidence-mapper.js +26 -0
  371. package/dist/panoramic/graph/confidence-mapper.js.map +1 -1
  372. package/dist/panoramic/graph/graph-builder.d.ts +72 -2
  373. package/dist/panoramic/graph/graph-builder.d.ts.map +1 -1
  374. package/dist/panoramic/graph/graph-builder.js +330 -46
  375. package/dist/panoramic/graph/graph-builder.js.map +1 -1
  376. package/dist/panoramic/graph/graph-paths.d.ts +8 -0
  377. package/dist/panoramic/graph/graph-paths.d.ts.map +1 -1
  378. package/dist/panoramic/graph/graph-paths.js +10 -0
  379. package/dist/panoramic/graph/graph-paths.js.map +1 -1
  380. package/dist/panoramic/graph/graph-query.d.ts +49 -2
  381. package/dist/panoramic/graph/graph-query.d.ts.map +1 -1
  382. package/dist/panoramic/graph/graph-query.js +117 -19
  383. package/dist/panoramic/graph/graph-query.js.map +1 -1
  384. package/dist/panoramic/graph/graph-types.d.ts +32 -3
  385. package/dist/panoramic/graph/graph-types.d.ts.map +1 -1
  386. package/dist/panoramic/graph/index.d.ts +2 -1
  387. package/dist/panoramic/graph/index.d.ts.map +1 -1
  388. package/dist/panoramic/graph/index.js +1 -1
  389. package/dist/panoramic/graph/index.js.map +1 -1
  390. package/dist/panoramic/hyperedges/schema.d.ts +6 -6
  391. package/dist/panoramic/interface-surface-generator.d.ts +50 -0
  392. package/dist/panoramic/interface-surface-generator.d.ts.map +1 -0
  393. package/dist/panoramic/interface-surface-generator.js +388 -0
  394. package/dist/panoramic/interface-surface-generator.js.map +1 -0
  395. package/dist/panoramic/interfaces.d.ts +2 -2
  396. package/dist/panoramic/mock-readme-generator.d.ts +90 -0
  397. package/dist/panoramic/mock-readme-generator.d.ts.map +1 -0
  398. package/dist/panoramic/mock-readme-generator.js +111 -0
  399. package/dist/panoramic/mock-readme-generator.js.map +1 -0
  400. package/dist/panoramic/models/component-view-model.d.ts +1 -1
  401. package/dist/panoramic/models/component-view-model.d.ts.map +1 -1
  402. package/dist/panoramic/models/component-view-model.js.map +1 -1
  403. package/dist/panoramic/narrative-provenance-adapter.d.ts +8 -0
  404. package/dist/panoramic/narrative-provenance-adapter.d.ts.map +1 -0
  405. package/dist/panoramic/narrative-provenance-adapter.js +99 -0
  406. package/dist/panoramic/narrative-provenance-adapter.js.map +1 -0
  407. package/dist/panoramic/parser-registry.d.ts +1 -1
  408. package/dist/panoramic/parser-registry.js +1 -1
  409. package/dist/panoramic/parsers/types.d.ts +6 -6
  410. package/dist/panoramic/pattern-hints-generator.d.ts +28 -0
  411. package/dist/panoramic/pattern-hints-generator.d.ts.map +1 -0
  412. package/dist/panoramic/pattern-hints-generator.js +218 -0
  413. package/dist/panoramic/pattern-hints-generator.js.map +1 -0
  414. package/dist/panoramic/pattern-hints-model.d.ts +89 -0
  415. package/dist/panoramic/pattern-hints-model.d.ts.map +1 -0
  416. package/dist/panoramic/pattern-hints-model.js +61 -0
  417. package/dist/panoramic/pattern-hints-model.js.map +1 -0
  418. package/dist/panoramic/pattern-knowledge-base.d.ts +31 -0
  419. package/dist/panoramic/pattern-knowledge-base.d.ts.map +1 -0
  420. package/dist/panoramic/pattern-knowledge-base.js +407 -0
  421. package/dist/panoramic/pattern-knowledge-base.js.map +1 -0
  422. package/dist/panoramic/pipelines/adr-evidence-verifier.d.ts.map +1 -1
  423. package/dist/panoramic/pipelines/adr-evidence-verifier.js +1 -29
  424. package/dist/panoramic/pipelines/adr-evidence-verifier.js.map +1 -1
  425. package/dist/panoramic/pipelines/coverage-auditor.d.ts.map +1 -1
  426. package/dist/panoramic/pipelines/coverage-auditor.js +4 -2
  427. package/dist/panoramic/pipelines/coverage-auditor.js.map +1 -1
  428. package/dist/panoramic/pipelines/docs-bundle-orchestrator.js +13 -6
  429. package/dist/panoramic/pipelines/docs-bundle-orchestrator.js.map +1 -1
  430. package/dist/panoramic/pipelines/product-ux-docs.d.ts +5 -0
  431. package/dist/panoramic/pipelines/product-ux-docs.d.ts.map +1 -1
  432. package/dist/panoramic/pipelines/product-ux-docs.js +34 -6
  433. package/dist/panoramic/pipelines/product-ux-docs.js.map +1 -1
  434. package/dist/panoramic/product-ux-docs.d.ts +104 -0
  435. package/dist/panoramic/product-ux-docs.d.ts.map +1 -0
  436. package/dist/panoramic/product-ux-docs.js +817 -0
  437. package/dist/panoramic/product-ux-docs.js.map +1 -0
  438. package/dist/panoramic/qa/__tests__/citation.test.d.ts +2 -0
  439. package/dist/panoramic/qa/__tests__/citation.test.d.ts.map +1 -0
  440. package/dist/panoramic/qa/__tests__/citation.test.js +193 -0
  441. package/dist/panoramic/qa/__tests__/citation.test.js.map +1 -0
  442. package/dist/panoramic/qa/__tests__/debt-context.test.d.ts +2 -0
  443. package/dist/panoramic/qa/__tests__/debt-context.test.d.ts.map +1 -0
  444. package/dist/panoramic/qa/__tests__/debt-context.test.js +154 -0
  445. package/dist/panoramic/qa/__tests__/debt-context.test.js.map +1 -0
  446. package/dist/panoramic/qa/__tests__/graph-retriever.test.d.ts +2 -0
  447. package/dist/panoramic/qa/__tests__/graph-retriever.test.d.ts.map +1 -0
  448. package/dist/panoramic/qa/__tests__/graph-retriever.test.js +148 -0
  449. package/dist/panoramic/qa/__tests__/graph-retriever.test.js.map +1 -0
  450. package/dist/panoramic/qa/__tests__/index.test.d.ts +2 -0
  451. package/dist/panoramic/qa/__tests__/index.test.d.ts.map +1 -0
  452. package/dist/panoramic/qa/__tests__/index.test.js +246 -0
  453. package/dist/panoramic/qa/__tests__/index.test.js.map +1 -0
  454. package/dist/panoramic/qa/__tests__/llm-caller.test.d.ts +2 -0
  455. package/dist/panoramic/qa/__tests__/llm-caller.test.d.ts.map +1 -0
  456. package/dist/panoramic/qa/__tests__/llm-caller.test.js +168 -0
  457. package/dist/panoramic/qa/__tests__/llm-caller.test.js.map +1 -0
  458. package/dist/panoramic/qa/__tests__/prompt-builder.test.d.ts +2 -0
  459. package/dist/panoramic/qa/__tests__/prompt-builder.test.d.ts.map +1 -0
  460. package/dist/panoramic/qa/__tests__/prompt-builder.test.js +150 -0
  461. package/dist/panoramic/qa/__tests__/prompt-builder.test.js.map +1 -0
  462. package/dist/panoramic/qa/__tests__/qa-integration.test.d.ts +2 -0
  463. package/dist/panoramic/qa/__tests__/qa-integration.test.d.ts.map +1 -0
  464. package/dist/panoramic/qa/__tests__/qa-integration.test.js +296 -0
  465. package/dist/panoramic/qa/__tests__/qa-integration.test.js.map +1 -0
  466. package/dist/panoramic/qa/__tests__/rag-reranker.test.d.ts +2 -0
  467. package/dist/panoramic/qa/__tests__/rag-reranker.test.d.ts.map +1 -0
  468. package/dist/panoramic/qa/__tests__/rag-reranker.test.js +136 -0
  469. package/dist/panoramic/qa/__tests__/rag-reranker.test.js.map +1 -0
  470. package/dist/panoramic/qa/index.d.ts.map +1 -1
  471. package/dist/panoramic/qa/index.js +10 -3
  472. package/dist/panoramic/qa/index.js.map +1 -1
  473. package/dist/panoramic/query.d.ts +1 -0
  474. package/dist/panoramic/query.d.ts.map +1 -1
  475. package/dist/panoramic/query.js +5 -0
  476. package/dist/panoramic/query.js.map +1 -1
  477. package/dist/panoramic/runtime-topology-generator.d.ts +77 -0
  478. package/dist/panoramic/runtime-topology-generator.d.ts.map +1 -0
  479. package/dist/panoramic/runtime-topology-generator.js +676 -0
  480. package/dist/panoramic/runtime-topology-generator.js.map +1 -0
  481. package/dist/panoramic/runtime-topology-model.d.ts +145 -0
  482. package/dist/panoramic/runtime-topology-model.d.ts.map +1 -0
  483. package/dist/panoramic/runtime-topology-model.js +300 -0
  484. package/dist/panoramic/runtime-topology-model.js.map +1 -0
  485. package/dist/panoramic/troubleshooting-generator.d.ts +51 -0
  486. package/dist/panoramic/troubleshooting-generator.d.ts.map +1 -0
  487. package/dist/panoramic/troubleshooting-generator.js +451 -0
  488. package/dist/panoramic/troubleshooting-generator.js.map +1 -0
  489. package/dist/panoramic/utils/text-segmenter.d.ts +15 -0
  490. package/dist/panoramic/utils/text-segmenter.d.ts.map +1 -1
  491. package/dist/panoramic/utils/text-segmenter.js +38 -0
  492. package/dist/panoramic/utils/text-segmenter.js.map +1 -1
  493. package/dist/panoramic/workspace-index-generator.d.ts +148 -0
  494. package/dist/panoramic/workspace-index-generator.d.ts.map +1 -0
  495. package/dist/panoramic/workspace-index-generator.js +497 -0
  496. package/dist/panoramic/workspace-index-generator.js.map +1 -0
  497. package/dist/runtime-bootstrap.d.ts +9 -0
  498. package/dist/runtime-bootstrap.d.ts.map +1 -0
  499. package/dist/runtime-bootstrap.js +33 -0
  500. package/dist/runtime-bootstrap.js.map +1 -0
  501. package/dist/scaffold-kb/api-entities-serializer.d.ts +12 -0
  502. package/dist/scaffold-kb/api-entities-serializer.d.ts.map +1 -0
  503. package/dist/scaffold-kb/api-entities-serializer.js +144 -0
  504. package/dist/scaffold-kb/api-entities-serializer.js.map +1 -0
  505. package/dist/scaffold-kb/arbitration.d.ts +44 -0
  506. package/dist/scaffold-kb/arbitration.d.ts.map +1 -0
  507. package/dist/scaffold-kb/arbitration.js +144 -0
  508. package/dist/scaffold-kb/arbitration.js.map +1 -0
  509. package/dist/scaffold-kb/chunk-splitter.d.ts +20 -0
  510. package/dist/scaffold-kb/chunk-splitter.d.ts.map +1 -0
  511. package/dist/scaffold-kb/chunk-splitter.js +309 -0
  512. package/dist/scaffold-kb/chunk-splitter.js.map +1 -0
  513. package/dist/scaffold-kb/doc-graph-builder.d.ts +26 -0
  514. package/dist/scaffold-kb/doc-graph-builder.d.ts.map +1 -0
  515. package/dist/scaffold-kb/doc-graph-builder.js +72 -0
  516. package/dist/scaffold-kb/doc-graph-builder.js.map +1 -0
  517. package/dist/scaffold-kb/entity-extractor.d.ts +40 -0
  518. package/dist/scaffold-kb/entity-extractor.d.ts.map +1 -0
  519. package/dist/scaffold-kb/entity-extractor.js +0 -0
  520. package/dist/scaffold-kb/entity-extractor.js.map +1 -0
  521. package/dist/scaffold-kb/entity-heuristic.d.ts +14 -0
  522. package/dist/scaffold-kb/entity-heuristic.d.ts.map +1 -0
  523. package/dist/scaffold-kb/entity-heuristic.js +107 -0
  524. package/dist/scaffold-kb/entity-heuristic.js.map +1 -0
  525. package/dist/scaffold-kb/entity-matcher.d.ts +20 -0
  526. package/dist/scaffold-kb/entity-matcher.d.ts.map +1 -0
  527. package/dist/scaffold-kb/entity-matcher.js +53 -0
  528. package/dist/scaffold-kb/entity-matcher.js.map +1 -0
  529. package/dist/scaffold-kb/entity-util.d.ts +11 -0
  530. package/dist/scaffold-kb/entity-util.d.ts.map +1 -0
  531. package/dist/scaffold-kb/entity-util.js +23 -0
  532. package/dist/scaffold-kb/entity-util.js.map +1 -0
  533. package/dist/scaffold-kb/evidence-envelope.d.ts +17 -0
  534. package/dist/scaffold-kb/evidence-envelope.d.ts.map +1 -0
  535. package/dist/scaffold-kb/evidence-envelope.js +32 -0
  536. package/dist/scaffold-kb/evidence-envelope.js.map +1 -0
  537. package/dist/scaffold-kb/index.d.ts +20 -0
  538. package/dist/scaffold-kb/index.d.ts.map +1 -0
  539. package/dist/scaffold-kb/index.js +102 -0
  540. package/dist/scaffold-kb/index.js.map +1 -0
  541. package/dist/scaffold-kb/ingest/ingest-core.d.ts +47 -0
  542. package/dist/scaffold-kb/ingest/ingest-core.d.ts.map +1 -0
  543. package/dist/scaffold-kb/ingest/ingest-core.js +231 -0
  544. package/dist/scaffold-kb/ingest/ingest-core.js.map +1 -0
  545. package/dist/scaffold-kb/ingest/office-parser.d.ts +33 -0
  546. package/dist/scaffold-kb/ingest/office-parser.d.ts.map +1 -0
  547. package/dist/scaffold-kb/ingest/office-parser.js +187 -0
  548. package/dist/scaffold-kb/ingest/office-parser.js.map +1 -0
  549. package/dist/scaffold-kb/ingest/url-fetcher.d.ts +43 -0
  550. package/dist/scaffold-kb/ingest/url-fetcher.d.ts.map +1 -0
  551. package/dist/scaffold-kb/ingest/url-fetcher.js +245 -0
  552. package/dist/scaffold-kb/ingest/url-fetcher.js.map +1 -0
  553. package/dist/scaffold-kb/ingester.d.ts +38 -0
  554. package/dist/scaffold-kb/ingester.d.ts.map +1 -0
  555. package/dist/scaffold-kb/ingester.js +261 -0
  556. package/dist/scaffold-kb/ingester.js.map +1 -0
  557. package/dist/scaffold-kb/injection-format.d.ts +25 -0
  558. package/dist/scaffold-kb/injection-format.d.ts.map +1 -0
  559. package/dist/scaffold-kb/injection-format.js +55 -0
  560. package/dist/scaffold-kb/injection-format.js.map +1 -0
  561. package/dist/scaffold-kb/kb-writer.d.ts +13 -0
  562. package/dist/scaffold-kb/kb-writer.d.ts.map +1 -0
  563. package/dist/scaffold-kb/kb-writer.js +69 -0
  564. package/dist/scaffold-kb/kb-writer.js.map +1 -0
  565. package/dist/scaffold-kb/keyword-extract.d.ts +16 -0
  566. package/dist/scaffold-kb/keyword-extract.d.ts.map +1 -0
  567. package/dist/scaffold-kb/keyword-extract.js +49 -0
  568. package/dist/scaffold-kb/keyword-extract.js.map +1 -0
  569. package/dist/scaffold-kb/query-sanitizer.d.ts +28 -0
  570. package/dist/scaffold-kb/query-sanitizer.d.ts.map +1 -0
  571. package/dist/scaffold-kb/query-sanitizer.js +38 -0
  572. package/dist/scaffold-kb/query-sanitizer.js.map +1 -0
  573. package/dist/scaffold-kb/recall-eval.d.ts +48 -0
  574. package/dist/scaffold-kb/recall-eval.d.ts.map +1 -0
  575. package/dist/scaffold-kb/recall-eval.js +55 -0
  576. package/dist/scaffold-kb/recall-eval.js.map +1 -0
  577. package/dist/scaffold-kb/schema-compat.d.ts +22 -0
  578. package/dist/scaffold-kb/schema-compat.d.ts.map +1 -0
  579. package/dist/scaffold-kb/schema-compat.js +32 -0
  580. package/dist/scaffold-kb/schema-compat.js.map +1 -0
  581. package/dist/scaffold-kb/search-core.d.ts +42 -0
  582. package/dist/scaffold-kb/search-core.d.ts.map +1 -0
  583. package/dist/scaffold-kb/search-core.js +89 -0
  584. package/dist/scaffold-kb/search-core.js.map +1 -0
  585. package/dist/scaffold-kb/sqlite-engine.d.ts +58 -0
  586. package/dist/scaffold-kb/sqlite-engine.d.ts.map +1 -0
  587. package/dist/scaffold-kb/sqlite-engine.js +61 -0
  588. package/dist/scaffold-kb/sqlite-engine.js.map +1 -0
  589. package/dist/scaffold-kb/sqlite-writer.d.ts +18 -0
  590. package/dist/scaffold-kb/sqlite-writer.d.ts.map +1 -0
  591. package/dist/scaffold-kb/sqlite-writer.js +76 -0
  592. package/dist/scaffold-kb/sqlite-writer.js.map +1 -0
  593. package/dist/scaffold-kb/tokenizer.d.ts +26 -0
  594. package/dist/scaffold-kb/tokenizer.d.ts.map +1 -0
  595. package/dist/scaffold-kb/tokenizer.js +97 -0
  596. package/dist/scaffold-kb/tokenizer.js.map +1 -0
  597. package/dist/scaffold-kb/types.d.ts +157 -0
  598. package/dist/scaffold-kb/types.d.ts.map +1 -0
  599. package/dist/scaffold-kb/types.js +5 -0
  600. package/dist/scaffold-kb/types.js.map +1 -0
  601. package/dist/utils/file-scanner.d.ts +15 -0
  602. package/dist/utils/file-scanner.d.ts.map +1 -1
  603. package/dist/utils/file-scanner.js +18 -1
  604. package/dist/utils/file-scanner.js.map +1 -1
  605. package/dist/utils/string-distance.d.ts +20 -0
  606. package/dist/utils/string-distance.d.ts.map +1 -0
  607. package/dist/utils/string-distance.js +38 -0
  608. package/dist/utils/string-distance.js.map +1 -0
  609. package/package.json +22 -3
  610. package/plugins/demo-kb-en/.claude-plugin/plugin.json +11 -0
  611. package/plugins/demo-kb-en/.mcp.json +8 -0
  612. package/plugins/demo-kb-en/FIXTURE.json +23 -0
  613. package/plugins/demo-kb-en/FIXTURE.md +53 -0
  614. package/plugins/demo-kb-en/ingest-samples/meeting-notes.md +13 -0
  615. package/plugins/demo-kb-en/kb/api-entities.json +3445 -0
  616. package/plugins/demo-kb-en/kb/chunks.sqlite +0 -0
  617. package/plugins/demo-kb-en/kb/doc-graph.json +113 -0
  618. package/plugins/demo-kb-zh/.claude-plugin/plugin.json +11 -0
  619. package/plugins/demo-kb-zh/.mcp.json +8 -0
  620. package/plugins/demo-kb-zh/FIXTURE.json +23 -0
  621. package/plugins/demo-kb-zh/FIXTURE.md +63 -0
  622. package/plugins/demo-kb-zh/ingest-samples/meeting-notes.md +13 -0
  623. package/plugins/demo-kb-zh/kb/api-entities.json +990 -0
  624. package/plugins/demo-kb-zh/kb/chunks.sqlite +0 -0
  625. package/plugins/demo-kb-zh/kb/doc-graph.json +113 -0
  626. package/plugins/spec-driver/.claude-plugin/plugin.json +1 -1
  627. package/plugins/spec-driver/README.md +50 -1
  628. package/plugins/spec-driver/agents/implement.md +20 -1
  629. package/plugins/spec-driver/agents/plan.md +20 -1
  630. package/plugins/spec-driver/agents/quality-review.md +20 -1
  631. package/plugins/spec-driver/agents/spec-review.md +20 -1
  632. package/plugins/spec-driver/agents/verify.md +108 -1
  633. package/plugins/spec-driver/config/orchestration.yaml +39 -31
  634. package/plugins/spec-driver/contracts/orchestration-overrides-contract.yaml +27 -0
  635. package/plugins/spec-driver/contracts/orchestration-schema.mjs +272 -227
  636. package/plugins/spec-driver/contracts/wrapper-source-of-truth.yaml +3 -0
  637. package/plugins/spec-driver/docs/customization.md +134 -0
  638. package/plugins/spec-driver/docs/spectra-mcp-integration.md +165 -0
  639. package/plugins/spec-driver/hooks/hooks.json +9 -0
  640. package/plugins/spec-driver/hooks/stop-fix-compliance-check.sh +36 -0
  641. package/plugins/spec-driver/lib/delegation-contract.mjs +84 -0
  642. package/plugins/spec-driver/lib/orchestration-resolver.mjs +49 -0
  643. package/plugins/spec-driver/lib/orchestrator.mjs +29 -1
  644. package/plugins/spec-driver/lib/preference-rules.mjs +96 -0
  645. package/plugins/spec-driver/scripts/codex-skills.sh +28 -28
  646. package/plugins/spec-driver/scripts/dev/spike-fix-compliance-e2e.mjs +130 -0
  647. package/plugins/spec-driver/scripts/fix-compliance-judge.mjs +415 -0
  648. package/plugins/spec-driver/scripts/generate-adoption-insights.mjs +48 -1
  649. package/plugins/spec-driver/scripts/goal-loop-cli.mjs +307 -0
  650. package/plugins/spec-driver/scripts/init-project.sh +56 -0
  651. package/plugins/spec-driver/scripts/kb-prequery.mjs +125 -0
  652. package/plugins/spec-driver/scripts/lib/config-schema.mjs +200 -94
  653. package/plugins/spec-driver/scripts/lib/ensure-gitignore.sh +277 -0
  654. package/plugins/spec-driver/scripts/lib/extract-wrapper-body.mjs +136 -0
  655. package/plugins/spec-driver/scripts/lib/fix-compliance-core.mjs +434 -0
  656. package/plugins/spec-driver/scripts/lib/fix-compliance-io.mjs +335 -0
  657. package/plugins/spec-driver/scripts/lib/goal-loop-core.mjs +783 -0
  658. package/plugins/spec-driver/scripts/lib/init-project-output.sh +28 -0
  659. package/plugins/spec-driver/scripts/lib/load-zod.mjs +62 -0
  660. package/plugins/spec-driver/scripts/lib/project-profile-resolver.mjs +141 -49
  661. package/plugins/spec-driver/scripts/lib/project-profile-schema.mjs +88 -54
  662. package/plugins/spec-driver/scripts/postinstall.sh +13 -1
  663. package/plugins/spec-driver/scripts/record-workflow-run.mjs +75 -0
  664. package/plugins/spec-driver/scripts/sync-delegation-contract.mjs +187 -0
  665. package/plugins/spec-driver/scripts/sync-preference-rules.mjs +148 -0
  666. package/plugins/spec-driver/scripts/validate-orchestrator-models.mjs +156 -0
  667. package/plugins/spec-driver/scripts/validate-wrapper-sources.mjs +46 -1
  668. package/plugins/spec-driver/skills/spec-driver-feature/SKILL.md +302 -0
  669. package/plugins/spec-driver/skills/spec-driver-fix/SKILL.md +97 -8
  670. package/plugins/spec-driver/skills/spec-driver-implement/SKILL.md +18 -0
  671. package/plugins/spec-driver/skills/spec-driver-refactor/SKILL.md +10 -0
  672. package/plugins/spec-driver/skills/spec-driver-resume/SKILL.md +12 -1
  673. package/plugins/spec-driver/skills/spec-driver-story/SKILL.md +30 -0
  674. package/plugins/spec-driver/templates/delegation-contract.md +27 -0
  675. package/plugins/spec-driver/templates/goal-loop-override-template.yaml +284 -0
  676. package/plugins/spec-driver/templates/preference-rules.md +39 -0
  677. package/plugins/spec-driver/templates/specify-base/project-context-template.yaml +10 -0
  678. package/plugins/spectra/.claude-plugin/plugin.json +1 -1
  679. package/plugins/spectra/README.md +48 -1
  680. package/plugins/spectra/hooks/post-commit.sh +40 -0
  681. package/templates/module-spec.hbs +1 -0
  682. package/templates/product-overview.hbs +1 -1
@@ -0,0 +1,246 @@
1
+ /**
2
+ * index.test.ts
3
+ * T-020 单元测试:answerQuestion() 7 步串联 + 边界条件
4
+ */
5
+ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
6
+ import { answerQuestion, clearEngineCache } from '../index.js';
7
+ // ============================================================
8
+ // Mock 所有依赖模块
9
+ // ============================================================
10
+ // Mock GraphQueryEngine(避免读取真实 graph.json)
11
+ vi.mock('../../graph/graph-query.js', () => ({
12
+ GraphQueryEngine: {
13
+ loadFromFile: vi.fn(),
14
+ },
15
+ }));
16
+ vi.mock('../../graph/graph-paths.js', () => ({
17
+ resolveGraphJsonPath: vi.fn().mockReturnValue('/project/specs/_meta/graph.json'),
18
+ }));
19
+ vi.mock('../graph-retriever.js', () => ({
20
+ retrieveGraphContext: vi.fn(),
21
+ }));
22
+ vi.mock('../rag-reranker.js', () => ({
23
+ rerankWithEmbedding: vi.fn(),
24
+ }));
25
+ vi.mock('../debt-context.js', () => ({
26
+ injectDebtContext: vi.fn(),
27
+ }));
28
+ vi.mock('../citation.js', () => ({
29
+ buildCitations: vi.fn(),
30
+ }));
31
+ vi.mock('../prompt-builder.js', () => ({
32
+ buildQnAPrompt: vi.fn(),
33
+ }));
34
+ vi.mock('../llm-caller.js', () => ({
35
+ callQnALlm: vi.fn(),
36
+ }));
37
+ import { GraphQueryEngine } from '../../graph/graph-query.js';
38
+ import { retrieveGraphContext } from '../graph-retriever.js';
39
+ import { rerankWithEmbedding } from '../rag-reranker.js';
40
+ import { injectDebtContext } from '../debt-context.js';
41
+ import { buildCitations } from '../citation.js';
42
+ import { buildQnAPrompt } from '../prompt-builder.js';
43
+ import { callQnALlm } from '../llm-caller.js';
44
+ // ============================================================
45
+ // Mock 数据设置工具
46
+ // ============================================================
47
+ /** 设置正常流程的 mock 数据 */
48
+ function setupNormalMocks() {
49
+ const mockEngine = {
50
+ query: vi.fn(),
51
+ getHyperedges: vi.fn(),
52
+ getNode: vi.fn(),
53
+ findPath: vi.fn(),
54
+ getCommunity: vi.fn(),
55
+ getSemanticEdges: vi.fn(),
56
+ graph: { nodes: [{ id: 'n1' }] },
57
+ };
58
+ vi.mocked(GraphQueryEngine.loadFromFile).mockReturnValue(mockEngine);
59
+ vi.mocked(retrieveGraphContext).mockReturnValue({
60
+ bfsNodes: [
61
+ { id: 'node-auth', label: '认证模块', kind: 'module' },
62
+ { id: 'node-db', label: '数据库', kind: 'module' },
63
+ { id: 'node-session', label: '会话', kind: 'module' },
64
+ ],
65
+ topChunks: [],
66
+ hyperedges: [],
67
+ fallbackMode: undefined,
68
+ });
69
+ vi.mocked(rerankWithEmbedding).mockResolvedValue({
70
+ rankedChunks: [
71
+ {
72
+ chunk: {
73
+ filePath: 'specs/auth.md',
74
+ startLine: 5,
75
+ endLine: 10,
76
+ headingPath: '## Auth',
77
+ text: '认证模块说明',
78
+ tokenCount: 20,
79
+ },
80
+ similarity: 0.85,
81
+ nodeId: 'node-auth',
82
+ },
83
+ ],
84
+ });
85
+ vi.mocked(injectDebtContext).mockResolvedValue({
86
+ triggered: false,
87
+ citations: [],
88
+ });
89
+ vi.mocked(buildCitations).mockReturnValue([
90
+ {
91
+ specPath: 'specs/auth.md',
92
+ lineRange: { startLine: 5, endLine: 10 },
93
+ excerpt: '认证模块说明',
94
+ nodeId: 'node-auth',
95
+ },
96
+ ]);
97
+ vi.mocked(buildQnAPrompt).mockReturnValue({
98
+ systemPrompt: '你是助手',
99
+ userPrompt: '什么调用了认证模块',
100
+ });
101
+ vi.mocked(callQnALlm).mockResolvedValue({
102
+ answer: '认证模块被 LoginService 调用',
103
+ parsedCitations: [
104
+ {
105
+ specPath: 'specs/auth.md',
106
+ lineRange: { startLine: 5, endLine: 10 },
107
+ excerpt: '认证模块说明',
108
+ },
109
+ ],
110
+ tokenUsage: { input: 100, output: 50, overBudget: false },
111
+ });
112
+ return mockEngine;
113
+ }
114
+ // ============================================================
115
+ // 默认选项
116
+ // ============================================================
117
+ const defaultOptions = {
118
+ projectRoot: '/project',
119
+ };
120
+ // ============================================================
121
+ // 测试套件
122
+ // ============================================================
123
+ describe('answerQuestion', () => {
124
+ beforeEach(() => {
125
+ vi.clearAllMocks();
126
+ clearEngineCache();
127
+ });
128
+ afterEach(() => {
129
+ clearEngineCache();
130
+ });
131
+ describe('正常 7 步串联', () => {
132
+ it('应返回包含 text、citations、tokenUsage 的 QnAAnswer', async () => {
133
+ setupNormalMocks();
134
+ const query = { text: '什么调用了认证模块' };
135
+ const result = await answerQuestion(query, defaultOptions);
136
+ expect(result.text).toBeTruthy();
137
+ expect(Array.isArray(result.citations)).toBe(true);
138
+ expect(result.tokenUsage).toBeDefined();
139
+ expect(typeof result.durationMs).toBe('number');
140
+ });
141
+ it('应依次调用 retrieveGraphContext、rerankWithEmbedding、injectDebtContext、buildCitations、buildQnAPrompt、callQnALlm', async () => {
142
+ setupNormalMocks();
143
+ await answerQuestion({ text: '测试问题' }, defaultOptions);
144
+ expect(retrieveGraphContext).toHaveBeenCalledOnce();
145
+ expect(rerankWithEmbedding).toHaveBeenCalledOnce();
146
+ expect(injectDebtContext).toHaveBeenCalledOnce();
147
+ expect(buildCitations).toHaveBeenCalledOnce();
148
+ expect(buildQnAPrompt).toHaveBeenCalledOnce();
149
+ expect(callQnALlm).toHaveBeenCalledOnce();
150
+ });
151
+ it('应包含 durationMs 字段(> 0)', async () => {
152
+ setupNormalMocks();
153
+ const result = await answerQuestion({ text: '测试' }, defaultOptions);
154
+ expect(result.durationMs).toBeGreaterThanOrEqual(0);
155
+ });
156
+ });
157
+ describe('边界条件 — 空字符串查询', () => {
158
+ it('空字符串应抛出 Error(不调用 LLM)', async () => {
159
+ await expect(answerQuestion({ text: '' }, defaultOptions)).rejects.toThrow(/不能为空/);
160
+ expect(callQnALlm).not.toHaveBeenCalled();
161
+ });
162
+ it('全空格字符串应抛出 Error', async () => {
163
+ await expect(answerQuestion({ text: ' ' }, defaultOptions)).rejects.toThrow(/不能为空/);
164
+ });
165
+ });
166
+ describe('边界条件 — 超长查询截断', () => {
167
+ it('> 2000 字符的查询应截断到 2000 字符', async () => {
168
+ setupNormalMocks();
169
+ const longQuery = 'A'.repeat(2500);
170
+ const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => { });
171
+ await answerQuestion({ text: longQuery }, defaultOptions);
172
+ // retrieveGraphContext 应被调用,且问题被截断
173
+ expect(retrieveGraphContext).toHaveBeenCalledWith('A'.repeat(2000), expect.anything(), expect.anything());
174
+ expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('截断'));
175
+ warnSpy.mockRestore();
176
+ });
177
+ });
178
+ describe('边界条件 — 空图谱', () => {
179
+ it('BFS 命中 0 节点时应返回"图谱为空"提示', async () => {
180
+ vi.mocked(GraphQueryEngine.loadFromFile).mockReturnValue({});
181
+ vi.mocked(retrieveGraphContext).mockReturnValue({
182
+ bfsNodes: [], // 0 个节点
183
+ topChunks: [],
184
+ hyperedges: [],
185
+ fallbackMode: 'rag-only',
186
+ });
187
+ const result = await answerQuestion({ text: '测试' }, defaultOptions);
188
+ expect(result.text).toContain('图谱为空');
189
+ expect(result.citations).toEqual([]);
190
+ expect(callQnALlm).not.toHaveBeenCalled();
191
+ });
192
+ it('图谱文件不存在时应返回友好提示', async () => {
193
+ vi.mocked(GraphQueryEngine.loadFromFile).mockImplementation(() => {
194
+ throw new Error('无法读取图谱文件');
195
+ });
196
+ const result = await answerQuestion({ text: '测试' }, defaultOptions);
197
+ expect(result.text).toContain('图谱为空');
198
+ expect(callQnALlm).not.toHaveBeenCalled();
199
+ });
200
+ });
201
+ describe('边界条件 — LLM 调用失败', () => {
202
+ it('LLM 调用失败时应抛出 Error', async () => {
203
+ setupNormalMocks();
204
+ vi.mocked(callQnALlm).mockRejectedValue(new Error('API 调用超时'));
205
+ await expect(answerQuestion({ text: '测试' }, defaultOptions)).rejects.toThrow(/LLM 调用失败/);
206
+ });
207
+ });
208
+ describe('citations 合并', () => {
209
+ it('LLM 解析的 citations 非空时应优先使用', async () => {
210
+ setupNormalMocks();
211
+ const llmCitations = [
212
+ {
213
+ specPath: 'specs/login.md',
214
+ lineRange: { startLine: 1, endLine: 5 },
215
+ excerpt: 'LLM 提供的 citation',
216
+ },
217
+ ];
218
+ vi.mocked(callQnALlm).mockResolvedValue({
219
+ answer: '回答',
220
+ parsedCitations: llmCitations,
221
+ tokenUsage: { input: 100, output: 50, overBudget: false },
222
+ });
223
+ const result = await answerQuestion({ text: '测试' }, defaultOptions);
224
+ expect(result.citations).toEqual(llmCitations);
225
+ });
226
+ it('LLM 返回空 citations 时应 fallback 到 buildCitations 的结果', async () => {
227
+ setupNormalMocks();
228
+ const builtCitations = [
229
+ {
230
+ specPath: 'specs/auth.md',
231
+ lineRange: { startLine: 5, endLine: 10 },
232
+ excerpt: 'built citation',
233
+ },
234
+ ];
235
+ vi.mocked(buildCitations).mockReturnValue(builtCitations);
236
+ vi.mocked(callQnALlm).mockResolvedValue({
237
+ answer: '回答',
238
+ parsedCitations: [], // LLM 没有解析到 citations
239
+ tokenUsage: { input: 100, output: 50, overBudget: false },
240
+ });
241
+ const result = await answerQuestion({ text: '测试' }, defaultOptions);
242
+ expect(result.citations).toEqual(builtCitations);
243
+ });
244
+ });
245
+ });
246
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/panoramic/qa/__tests__/index.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/D,+DAA+D;AAC/D,cAAc;AACd,+DAA+D;AAE/D,2CAA2C;AAC3C,EAAE,CAAC,IAAI,CAAC,4BAA4B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3C,gBAAgB,EAAE;QAChB,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;K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CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=llm-caller.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-caller.test.d.ts","sourceRoot":"","sources":["../../../../src/panoramic/qa/__tests__/llm-caller.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * llm-caller.test.ts
3
+ * T-019 单元测试:budget-gate record-only + overBudget 标记 + 响应解析
4
+ */
5
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
6
+ // ============================================================
7
+ // Mock 依赖
8
+ // ============================================================
9
+ // Mock Anthropic SDK
10
+ vi.mock('@anthropic-ai/sdk', () => {
11
+ const mockCreate = vi.fn();
12
+ const Anthropic = vi.fn(() => ({
13
+ messages: {
14
+ create: mockCreate,
15
+ },
16
+ }));
17
+ Anthropic._mockCreate = mockCreate;
18
+ return { default: Anthropic };
19
+ });
20
+ // Mock estimateFast(控制 token 估算量)
21
+ vi.mock('../../../core/token-counter.js', () => ({
22
+ estimateFast: vi.fn().mockReturnValue(100),
23
+ }));
24
+ // Mock runBudgetGate(不真实执行)
25
+ vi.mock('../../../batch/budget-gate.js', () => ({
26
+ runBudgetGate: vi.fn().mockResolvedValue({
27
+ finalPolicy: 'continue',
28
+ finalEstimate: 100,
29
+ skipEnrichmentApplied: false,
30
+ cheaperModelApplied: false,
31
+ attempts: [],
32
+ }),
33
+ }));
34
+ // Mock resolveReverseSpecModel(返回确定性模型)
35
+ vi.mock('../../../core/model-selection.js', () => ({
36
+ resolveReverseSpecModel: vi.fn().mockReturnValue({ model: 'claude-test-model' }),
37
+ }));
38
+ import Anthropic from '@anthropic-ai/sdk';
39
+ import { callQnALlm } from '../llm-caller.js';
40
+ import { runBudgetGate } from '../../../batch/budget-gate.js';
41
+ import { estimateFast } from '../../../core/token-counter.js';
42
+ // 获取 mock create 函数
43
+ const MockedAnthropicClass = vi.mocked(Anthropic);
44
+ // ============================================================
45
+ // 测试数据
46
+ // ============================================================
47
+ const testPrompt = {
48
+ systemPrompt: '你是代码库问答助手',
49
+ userPrompt: '什么调用了认证模块',
50
+ };
51
+ /** 正常的 JSON 格式 LLM 响应 */
52
+ const normalJsonResponse = {
53
+ id: 'msg-001',
54
+ type: 'message',
55
+ role: 'assistant',
56
+ model: 'claude-test-model',
57
+ content: [
58
+ {
59
+ type: 'text',
60
+ text: JSON.stringify({
61
+ answer: '认证模块被 LoginService 调用 [来源:specs/auth.md:10-15]',
62
+ citations: [
63
+ {
64
+ specPath: 'specs/auth.md',
65
+ startLine: 10,
66
+ endLine: 15,
67
+ excerpt: '登录服务调用认证模块',
68
+ },
69
+ ],
70
+ }),
71
+ },
72
+ ],
73
+ stop_reason: 'end_turn',
74
+ usage: { input_tokens: 150, output_tokens: 80 },
75
+ };
76
+ // ============================================================
77
+ // 测试套件
78
+ // ============================================================
79
+ describe('callQnALlm', () => {
80
+ let mockCreate;
81
+ beforeEach(() => {
82
+ vi.clearAllMocks();
83
+ // 重新获取 mock create 实例
84
+ const instance = new (vi.mocked(Anthropic))();
85
+ mockCreate = instance.messages.create;
86
+ mockCreate.mockResolvedValue(normalJsonResponse);
87
+ });
88
+ describe('正常调用路径', () => {
89
+ it('应调用 runBudgetGate(record-only 模式)', async () => {
90
+ await callQnALlm(testPrompt);
91
+ expect(runBudgetGate).toHaveBeenCalledWith(expect.objectContaining({
92
+ budget: Infinity,
93
+ preset: 'continue',
94
+ isTTY: false,
95
+ }));
96
+ });
97
+ it('应从项目配置读取模型 ID(不硬编码)', async () => {
98
+ await callQnALlm(testPrompt);
99
+ // 验证 Anthropic.messages.create 被调用(模型来自 resolveReverseSpecModel)
100
+ // 由于 Anthropic 是 mock,这里验证 runBudgetGate 被调用即可
101
+ expect(runBudgetGate).toHaveBeenCalled();
102
+ });
103
+ it('应返回包含 answer 的结果', async () => {
104
+ const result = await callQnALlm(testPrompt);
105
+ expect(result.answer).toBeTruthy();
106
+ expect(typeof result.answer).toBe('string');
107
+ });
108
+ it('应返回 tokenUsage 字段', async () => {
109
+ const result = await callQnALlm(testPrompt);
110
+ expect(result.tokenUsage).toBeDefined();
111
+ expect(typeof result.tokenUsage.input).toBe('number');
112
+ expect(typeof result.tokenUsage.output).toBe('number');
113
+ expect(typeof result.tokenUsage.overBudget).toBe('boolean');
114
+ });
115
+ it('正常调用时 overBudget 应为 false(估算 130 tokens < 6000 上限)', async () => {
116
+ // estimateFast mock 返回 100,total = 100 + 30 = 130 < 6000
117
+ vi.mocked(estimateFast).mockReturnValue(100);
118
+ const result = await callQnALlm(testPrompt);
119
+ expect(result.tokenUsage.overBudget).toBe(false);
120
+ });
121
+ });
122
+ describe('overBudget 标记', () => {
123
+ it('token 估算超过 hardcode 上限时 overBudget 应为 true', async () => {
124
+ // 让 estimateFast 返回一个超过限制的值(6000 / 1.3 ≈ 4616 → total ≈ 6000+)
125
+ vi.mocked(estimateFast).mockReturnValue(5000); // total = 5000 + 1500 = 6500 > 6000
126
+ const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => { });
127
+ const result = await callQnALlm(testPrompt);
128
+ expect(result.tokenUsage.overBudget).toBe(true);
129
+ expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('qna token cost over hardcode limit'));
130
+ warnSpy.mockRestore();
131
+ });
132
+ it('超额时 LLM 调用不应被阻断(应继续返回结果)', async () => {
133
+ vi.mocked(estimateFast).mockReturnValue(5000);
134
+ const result = await callQnALlm(testPrompt);
135
+ // 超额但调用继续,应有 answer
136
+ expect(result.answer).toBeTruthy();
137
+ expect(result.tokenUsage.overBudget).toBe(true);
138
+ });
139
+ });
140
+ describe('响应解析', () => {
141
+ it('应从 JSON 响应中解析 parsedCitations', async () => {
142
+ const result = await callQnALlm(testPrompt);
143
+ // 验证 parsedCitations 结构(来自 normalJsonResponse 中的 citations 数组)
144
+ expect(Array.isArray(result.parsedCitations)).toBe(true);
145
+ });
146
+ it('LLM 返回非 JSON 文本时应 fallback 到原始文本作为 answer', async () => {
147
+ // 创建一个返回纯文本(非 JSON)的 mock
148
+ const plainTextResponse = {
149
+ ...normalJsonResponse,
150
+ content: [{ type: 'text', text: '这是纯文本回答,没有 JSON 格式' }],
151
+ usage: { input_tokens: 100, output_tokens: 50 },
152
+ };
153
+ // 需要直接 mock Anthropic client 实例
154
+ const AnthropicConstructor = vi.mocked(Anthropic);
155
+ const mockInstance = { messages: { create: vi.fn().mockResolvedValue(plainTextResponse) } };
156
+ Anthropic.mockImplementation
157
+ ? vi.mocked(Anthropic).mockImplementation(() => mockInstance)
158
+ : null;
159
+ // 使用新实例重新调用
160
+ vi.mocked(Anthropic).mockImplementationOnce(() => mockInstance);
161
+ const result = await callQnALlm(testPrompt);
162
+ // 非 JSON 时 answer 应包含原始文本
163
+ expect(typeof result.answer).toBe('string');
164
+ expect(result.answer.length).toBeGreaterThan(0);
165
+ });
166
+ });
167
+ });
168
+ //# sourceMappingURL=llm-caller.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-caller.test.js","sourceRoot":"","sources":["../../../../src/panoramic/qa/__tests__/llm-caller.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE9D,+DAA+D;AAC/D,UAAU;AACV,+DAA+D;AAE/D,qBAAqB;AACrB,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAChC,MAAM,UAAU,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7B,QAAQ,EAAE;YACR,MAAM,EAAE,UAAU;SACnB;KACF,CAAC,CAAC,CAAC;IACH,SAA2D,CAAC,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AAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=prompt-builder.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-builder.test.d.ts","sourceRoot":"","sources":["../../../../src/panoramic/qa/__tests__/prompt-builder.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * prompt-builder.test.ts
3
+ * T-018 单元测试:prompt 组装 + citation 内联格式 + hyperedge 候选列表
4
+ */
5
+ import { describe, it, expect } from 'vitest';
6
+ import { buildQnAPrompt } from '../prompt-builder.js';
7
+ // ============================================================
8
+ // 测试数据工厂
9
+ // ============================================================
10
+ function makeGraphCtx(overrides) {
11
+ return {
12
+ bfsNodes: [
13
+ { id: 'node-auth', label: '认证模块', kind: 'module' },
14
+ { id: 'node-db', label: '数据库层', kind: 'module' },
15
+ ],
16
+ topChunks: [],
17
+ hyperedges: [
18
+ {
19
+ id: 'he-1',
20
+ label: '登录流程',
21
+ nodes: ['node-auth', 'node-db', 'node-session'],
22
+ rationale: '用户登录时依次调用认证、数据库和会话管理',
23
+ confidence: 'INFERRED',
24
+ },
25
+ ],
26
+ ...overrides,
27
+ };
28
+ }
29
+ function makeCitations() {
30
+ return [
31
+ {
32
+ specPath: 'specs/auth/login.md',
33
+ lineRange: { startLine: 10, endLine: 20 },
34
+ excerpt: '登录验证流程说明',
35
+ nodeId: 'node-auth',
36
+ similarity: 0.85,
37
+ },
38
+ {
39
+ specPath: '[graph hyperedge]',
40
+ lineRange: { startLine: 0, endLine: 0 },
41
+ excerpt: '登录流程跨模块协作',
42
+ },
43
+ ];
44
+ }
45
+ // ============================================================
46
+ // 测试套件
47
+ // ============================================================
48
+ describe('buildQnAPrompt', () => {
49
+ describe('基础结构检查', () => {
50
+ it('应返回 systemPrompt 和 userPrompt 字段', () => {
51
+ const ctx = makeGraphCtx();
52
+ const citations = makeCitations();
53
+ const result = buildQnAPrompt(ctx, citations, '什么调用了认证模块');
54
+ expect(result.systemPrompt).toBeTruthy();
55
+ expect(result.userPrompt).toBeTruthy();
56
+ expect(typeof result.systemPrompt).toBe('string');
57
+ expect(typeof result.userPrompt).toBe('string');
58
+ });
59
+ it('systemPrompt 应包含 citation 格式要求', () => {
60
+ const ctx = makeGraphCtx();
61
+ const result = buildQnAPrompt(ctx, [], '测试问题');
62
+ expect(result.systemPrompt).toContain('[来源:');
63
+ expect(result.systemPrompt).toContain('100%');
64
+ });
65
+ it('systemPrompt 应要求返回 JSON 格式', () => {
66
+ const ctx = makeGraphCtx();
67
+ const result = buildQnAPrompt(ctx, [], '测试问题');
68
+ expect(result.systemPrompt).toContain('JSON');
69
+ expect(result.systemPrompt).toContain('"answer"');
70
+ expect(result.systemPrompt).toContain('"citations"');
71
+ });
72
+ });
73
+ describe('用户问题注入', () => {
74
+ it('userPrompt 应包含原始问题文本', () => {
75
+ const ctx = makeGraphCtx();
76
+ const question = '什么调用了认证模块的 login 函数';
77
+ const result = buildQnAPrompt(ctx, [], question);
78
+ expect(result.userPrompt).toContain(question);
79
+ });
80
+ });
81
+ describe('Citation 内联格式', () => {
82
+ it('userPrompt 应包含所有 citation 的内联格式', () => {
83
+ const ctx = makeGraphCtx();
84
+ const citations = makeCitations();
85
+ const result = buildQnAPrompt(ctx, citations, '测试');
86
+ // 应包含 specs/auth/login.md 的引用
87
+ expect(result.userPrompt).toContain('specs/auth/login.md:10-20');
88
+ // 应包含 graph-hyperedge 引用
89
+ expect(result.userPrompt).toContain('graph-hyperedge');
90
+ });
91
+ it('citation excerpt 应出现在 prompt 中', () => {
92
+ const ctx = makeGraphCtx();
93
+ const citations = makeCitations();
94
+ const result = buildQnAPrompt(ctx, citations, '测试');
95
+ expect(result.userPrompt).toContain('登录验证流程说明');
96
+ });
97
+ });
98
+ describe('Hyperedge 候选列表', () => {
99
+ it('userPrompt 应包含超边候选列表区块', () => {
100
+ const ctx = makeGraphCtx();
101
+ const result = buildQnAPrompt(ctx, [], '测试');
102
+ // 应有超边候选列表相关标题
103
+ expect(result.userPrompt).toContain('超边候选列表');
104
+ });
105
+ it('userPrompt 应包含 hyperedge 的 label', () => {
106
+ const ctx = makeGraphCtx();
107
+ const result = buildQnAPrompt(ctx, [], '测试');
108
+ // hyperedge label "登录流程" 应出现在 prompt 中
109
+ expect(result.userPrompt).toContain('登录流程');
110
+ });
111
+ it('hyperedge rationale 应出现在候选列表中', () => {
112
+ const ctx = makeGraphCtx();
113
+ const result = buildQnAPrompt(ctx, [], '测试');
114
+ expect(result.userPrompt).toContain('用户登录时依次调用认证');
115
+ });
116
+ it('空超边时应有占位说明', () => {
117
+ const ctx = makeGraphCtx({ hyperedges: [] });
118
+ const result = buildQnAPrompt(ctx, [], '测试');
119
+ expect(result.userPrompt).toContain('无超边数据');
120
+ });
121
+ });
122
+ describe('fallback 模式提示', () => {
123
+ it('fallbackMode=rag-only 时 userPrompt 应包含降级提示', () => {
124
+ const ctx = makeGraphCtx({ fallbackMode: 'rag-only' });
125
+ const result = buildQnAPrompt(ctx, [], '测试');
126
+ expect(result.userPrompt).toContain('rag-only');
127
+ expect(result.userPrompt).toContain('降级模式');
128
+ });
129
+ it('无 fallbackMode 时不应包含降级提示', () => {
130
+ const ctx = makeGraphCtx({ fallbackMode: undefined });
131
+ const result = buildQnAPrompt(ctx, [], '测试');
132
+ expect(result.userPrompt).not.toContain('降级模式');
133
+ });
134
+ });
135
+ describe('BFS 节点摘要', () => {
136
+ it('userPrompt 应包含 BFS 节点信息', () => {
137
+ const ctx = makeGraphCtx();
138
+ const result = buildQnAPrompt(ctx, [], '测试');
139
+ // 节点 label 应出现在 userPrompt 中
140
+ expect(result.userPrompt).toContain('认证模块');
141
+ expect(result.userPrompt).toContain('数据库层');
142
+ });
143
+ it('空 BFS 节点时应有占位说明', () => {
144
+ const ctx = makeGraphCtx({ bfsNodes: [] });
145
+ const result = buildQnAPrompt(ctx, [], '测试');
146
+ expect(result.userPrompt).toContain('无相关节点');
147
+ });
148
+ });
149
+ });
150
+ //# sourceMappingURL=prompt-builder.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-builder.test.js","sourceRoot":"","sources":["../../../../src/panoramic/qa/__tests__/prompt-builder.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,+DAA+D;AAC/D,SAAS;AACT,+DAA+D;AAE/D,SAAS,YAAY,CAAC,SAAiC;IACrD,OAAO;QACL,QAAQ,EAAE;YACR,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;YAClD,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;SACjD;QACD,SAAS,EAAE,EAAE;QACb,UAAU,EAAE;YACV;gBACE,EAAE,EAAE,MAAM;gBACV,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,cAAc,CAAC;gBAC/C,SAAS,EAAE,sBAAsB;gBACjC,UAAU,EAAE,UAAU;aACvB;SACF;QACD,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,aAAa;IACpB,OAAO;QACL;YACE,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YACzC,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,IAAI;SACjB;QACD;YACE,QAAQ,EAAE,mBAAmB;YAC7B,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,E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CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;YACzB,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=qa-integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-integration.test.d.ts","sourceRoot":"","sources":["../../../../src/panoramic/qa/__tests__/qa-integration.test.ts"],"names":[],"mappings":""}