@rsaglobaltech/specgate 0.8.1

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 (494) hide show
  1. package/CHANGELOG.md +1016 -0
  2. package/README.md +148 -0
  3. package/bin/specgate.js +2 -0
  4. package/bin/specgate.ts +383 -0
  5. package/dist/bin/specgate.js +342 -0
  6. package/dist/bin/specgate.js.map +1 -0
  7. package/dist/packages/core/src/application/AddRequirementUseCase.js +24 -0
  8. package/dist/packages/core/src/application/AddRequirementUseCase.js.map +1 -0
  9. package/dist/packages/core/src/application/ArchiveChangeUseCase.js +185 -0
  10. package/dist/packages/core/src/application/ArchiveChangeUseCase.js.map +1 -0
  11. package/dist/packages/core/src/application/CheckAgainstLockUseCase.js +134 -0
  12. package/dist/packages/core/src/application/CheckAgainstLockUseCase.js.map +1 -0
  13. package/dist/packages/core/src/application/GenerateAgentPromptUseCase.js +25 -0
  14. package/dist/packages/core/src/application/GenerateAgentPromptUseCase.js.map +1 -0
  15. package/dist/packages/core/src/application/GeneratePlanUseCase.js +135 -0
  16. package/dist/packages/core/src/application/GeneratePlanUseCase.js.map +1 -0
  17. package/dist/packages/core/src/application/LinkRequirementUseCase.js +25 -0
  18. package/dist/packages/core/src/application/LinkRequirementUseCase.js.map +1 -0
  19. package/dist/packages/core/src/application/RemovePackUseCase.js +28 -0
  20. package/dist/packages/core/src/application/RemovePackUseCase.js.map +1 -0
  21. package/dist/packages/core/src/application/UpdateRequirementStatusUseCase.js +37 -0
  22. package/dist/packages/core/src/application/UpdateRequirementStatusUseCase.js.map +1 -0
  23. package/dist/packages/core/src/application/ValidateChangeUseCase.js +86 -0
  24. package/dist/packages/core/src/application/ValidateChangeUseCase.js.map +1 -0
  25. package/dist/packages/core/src/application/ValidateProjectUseCase.js +101 -0
  26. package/dist/packages/core/src/application/ValidateProjectUseCase.js.map +1 -0
  27. package/dist/packages/core/src/application/ports/IDomainPackRepository.js +3 -0
  28. package/dist/packages/core/src/application/ports/IDomainPackRepository.js.map +1 -0
  29. package/dist/packages/core/src/application/ports/IHarnessConfigRepository.js +3 -0
  30. package/dist/packages/core/src/application/ports/IHarnessConfigRepository.js.map +1 -0
  31. package/dist/packages/core/src/application/ports/ILockfileRepository.js +3 -0
  32. package/dist/packages/core/src/application/ports/ILockfileRepository.js.map +1 -0
  33. package/dist/packages/core/src/application/ports/IManifestRepository.js +3 -0
  34. package/dist/packages/core/src/application/ports/IManifestRepository.js.map +1 -0
  35. package/dist/packages/core/src/application/ports/IProjectRepository.js +3 -0
  36. package/dist/packages/core/src/application/ports/IProjectRepository.js.map +1 -0
  37. package/dist/packages/core/src/application/ports/IRequirementGraphRepository.js +3 -0
  38. package/dist/packages/core/src/application/ports/IRequirementGraphRepository.js.map +1 -0
  39. package/dist/packages/core/src/application/ports/ITraceabilityRepository.js +3 -0
  40. package/dist/packages/core/src/application/ports/ITraceabilityRepository.js.map +1 -0
  41. package/dist/packages/core/src/domain/AgentPrompt.js +79 -0
  42. package/dist/packages/core/src/domain/AgentPrompt.js.map +1 -0
  43. package/dist/packages/core/src/domain/ArchivePlan.js +26 -0
  44. package/dist/packages/core/src/domain/ArchivePlan.js.map +1 -0
  45. package/dist/packages/core/src/domain/AuthoringScope.js +48 -0
  46. package/dist/packages/core/src/domain/AuthoringScope.js.map +1 -0
  47. package/dist/packages/core/src/domain/ChangeTemplates.js +133 -0
  48. package/dist/packages/core/src/domain/ChangeTemplates.js.map +1 -0
  49. package/dist/packages/core/src/domain/CucumberMessages.js +256 -0
  50. package/dist/packages/core/src/domain/CucumberMessages.js.map +1 -0
  51. package/dist/packages/core/src/domain/DeclaredArtifacts.js +117 -0
  52. package/dist/packages/core/src/domain/DeclaredArtifacts.js.map +1 -0
  53. package/dist/packages/core/src/domain/DeltaSpec.js +219 -0
  54. package/dist/packages/core/src/domain/DeltaSpec.js.map +1 -0
  55. package/dist/packages/core/src/domain/Diagnostic.js +75 -0
  56. package/dist/packages/core/src/domain/Diagnostic.js.map +1 -0
  57. package/dist/packages/core/src/domain/DomainPack.js +62 -0
  58. package/dist/packages/core/src/domain/DomainPack.js.map +1 -0
  59. package/dist/packages/core/src/domain/EmptyAttempt.js +60 -0
  60. package/dist/packages/core/src/domain/EmptyAttempt.js.map +1 -0
  61. package/dist/packages/core/src/domain/FileChangeSet.js +37 -0
  62. package/dist/packages/core/src/domain/FileChangeSet.js.map +1 -0
  63. package/dist/packages/core/src/domain/Gherkin.js +272 -0
  64. package/dist/packages/core/src/domain/Gherkin.js.map +1 -0
  65. package/dist/packages/core/src/domain/GherkinDialects.js +97 -0
  66. package/dist/packages/core/src/domain/GherkinDialects.js.map +1 -0
  67. package/dist/packages/core/src/domain/GherkinQuality.js +160 -0
  68. package/dist/packages/core/src/domain/GherkinQuality.js.map +1 -0
  69. package/dist/packages/core/src/domain/GherkinTags.js +119 -0
  70. package/dist/packages/core/src/domain/GherkinTags.js.map +1 -0
  71. package/dist/packages/core/src/domain/GitSafety.js +77 -0
  72. package/dist/packages/core/src/domain/GitSafety.js.map +1 -0
  73. package/dist/packages/core/src/domain/HarnessConfig.js +58 -0
  74. package/dist/packages/core/src/domain/HarnessConfig.js.map +1 -0
  75. package/dist/packages/core/src/domain/HarnessReport.js +162 -0
  76. package/dist/packages/core/src/domain/HarnessReport.js.map +1 -0
  77. package/dist/packages/core/src/domain/HarnessRun.js +154 -0
  78. package/dist/packages/core/src/domain/HarnessRun.js.map +1 -0
  79. package/dist/packages/core/src/domain/InboundChange.js +127 -0
  80. package/dist/packages/core/src/domain/InboundChange.js.map +1 -0
  81. package/dist/packages/core/src/domain/Language.js +112 -0
  82. package/dist/packages/core/src/domain/Language.js.map +1 -0
  83. package/dist/packages/core/src/domain/Lockfile.js +64 -0
  84. package/dist/packages/core/src/domain/Lockfile.js.map +1 -0
  85. package/dist/packages/core/src/domain/PackContribution.js +106 -0
  86. package/dist/packages/core/src/domain/PackContribution.js.map +1 -0
  87. package/dist/packages/core/src/domain/PackDelta.js +298 -0
  88. package/dist/packages/core/src/domain/PackDelta.js.map +1 -0
  89. package/dist/packages/core/src/domain/PackSpec.js +481 -0
  90. package/dist/packages/core/src/domain/PackSpec.js.map +1 -0
  91. package/dist/packages/core/src/domain/ProfileMatch.js +87 -0
  92. package/dist/packages/core/src/domain/ProfileMatch.js.map +1 -0
  93. package/dist/packages/core/src/domain/Reconciliation.js +72 -0
  94. package/dist/packages/core/src/domain/Reconciliation.js.map +1 -0
  95. package/dist/packages/core/src/domain/RequirementGraph.js +197 -0
  96. package/dist/packages/core/src/domain/RequirementGraph.js.map +1 -0
  97. package/dist/packages/core/src/domain/RequirementPlan.js +85 -0
  98. package/dist/packages/core/src/domain/RequirementPlan.js.map +1 -0
  99. package/dist/packages/core/src/domain/RequirementReadiness.js +115 -0
  100. package/dist/packages/core/src/domain/RequirementReadiness.js.map +1 -0
  101. package/dist/packages/core/src/domain/RequirementSyntax.js +91 -0
  102. package/dist/packages/core/src/domain/RequirementSyntax.js.map +1 -0
  103. package/dist/packages/core/src/domain/ResumeState.js +115 -0
  104. package/dist/packages/core/src/domain/ResumeState.js.map +1 -0
  105. package/dist/packages/core/src/domain/RunBudget.js +103 -0
  106. package/dist/packages/core/src/domain/RunBudget.js.map +1 -0
  107. package/dist/packages/core/src/domain/SpecDiff.js +48 -0
  108. package/dist/packages/core/src/domain/SpecDiff.js.map +1 -0
  109. package/dist/packages/core/src/domain/SpecParser.js +406 -0
  110. package/dist/packages/core/src/domain/SpecParser.js.map +1 -0
  111. package/dist/packages/core/src/domain/SpecopsManifest.js +90 -0
  112. package/dist/packages/core/src/domain/SpecopsManifest.js.map +1 -0
  113. package/dist/packages/core/src/domain/TraceabilityFormat.js +317 -0
  114. package/dist/packages/core/src/domain/TraceabilityFormat.js.map +1 -0
  115. package/dist/packages/core/src/domain/TraceabilityMatrix.js +200 -0
  116. package/dist/packages/core/src/domain/TraceabilityMatrix.js.map +1 -0
  117. package/dist/packages/core/src/domain/TraceabilityMerge.js +180 -0
  118. package/dist/packages/core/src/domain/TraceabilityMerge.js.map +1 -0
  119. package/dist/packages/core/src/domain/ValidationReport.js +53 -0
  120. package/dist/packages/core/src/domain/ValidationReport.js.map +1 -0
  121. package/dist/packages/core/src/domain/ValueAnnotations.js +138 -0
  122. package/dist/packages/core/src/domain/ValueAnnotations.js.map +1 -0
  123. package/dist/packages/core/src/domain/WriteScope.js +155 -0
  124. package/dist/packages/core/src/domain/WriteScope.js.map +1 -0
  125. package/dist/packages/core/src/domain/YamlLite.js +226 -0
  126. package/dist/packages/core/src/domain/YamlLite.js.map +1 -0
  127. package/dist/packages/core/src/index.js +120 -0
  128. package/dist/packages/core/src/index.js.map +1 -0
  129. package/dist/packages/core/src/infrastructure/ChangeWorkspace.js +276 -0
  130. package/dist/packages/core/src/infrastructure/ChangeWorkspace.js.map +1 -0
  131. package/dist/packages/core/src/infrastructure/ConsoleReporter.js +19 -0
  132. package/dist/packages/core/src/infrastructure/ConsoleReporter.js.map +1 -0
  133. package/dist/packages/core/src/infrastructure/DirectorySnapshot.js +106 -0
  134. package/dist/packages/core/src/infrastructure/DirectorySnapshot.js.map +1 -0
  135. package/dist/packages/core/src/infrastructure/DiskDomainPackRepository.js +57 -0
  136. package/dist/packages/core/src/infrastructure/DiskDomainPackRepository.js.map +1 -0
  137. package/dist/packages/core/src/infrastructure/DiskHarnessConfigRepository.js +58 -0
  138. package/dist/packages/core/src/infrastructure/DiskHarnessConfigRepository.js.map +1 -0
  139. package/dist/packages/core/src/infrastructure/DiskLanguageRepository.js +69 -0
  140. package/dist/packages/core/src/infrastructure/DiskLanguageRepository.js.map +1 -0
  141. package/dist/packages/core/src/infrastructure/DiskLockfileRepository.js +64 -0
  142. package/dist/packages/core/src/infrastructure/DiskLockfileRepository.js.map +1 -0
  143. package/dist/packages/core/src/infrastructure/DiskManifestRepository.js +88 -0
  144. package/dist/packages/core/src/infrastructure/DiskManifestRepository.js.map +1 -0
  145. package/dist/packages/core/src/infrastructure/DiskPackDeltaRepository.js +138 -0
  146. package/dist/packages/core/src/infrastructure/DiskPackDeltaRepository.js.map +1 -0
  147. package/dist/packages/core/src/infrastructure/DiskPackRepository.js +130 -0
  148. package/dist/packages/core/src/infrastructure/DiskPackRepository.js.map +1 -0
  149. package/dist/packages/core/src/infrastructure/DiskProjectRepository.js +127 -0
  150. package/dist/packages/core/src/infrastructure/DiskProjectRepository.js.map +1 -0
  151. package/dist/packages/core/src/infrastructure/DiskRequirementGraphRepository.js +124 -0
  152. package/dist/packages/core/src/infrastructure/DiskRequirementGraphRepository.js.map +1 -0
  153. package/dist/packages/core/src/infrastructure/DiskTraceabilityRepository.js +53 -0
  154. package/dist/packages/core/src/infrastructure/DiskTraceabilityRepository.js.map +1 -0
  155. package/dist/packages/core/src/infrastructure/GitContributionStager.js +99 -0
  156. package/dist/packages/core/src/infrastructure/GitContributionStager.js.map +1 -0
  157. package/dist/packages/core/src/infrastructure/GitMergeDriver.js +103 -0
  158. package/dist/packages/core/src/infrastructure/GitMergeDriver.js.map +1 -0
  159. package/dist/packages/core/src/infrastructure/HarnessConfigFile.js +348 -0
  160. package/dist/packages/core/src/infrastructure/HarnessConfigFile.js.map +1 -0
  161. package/dist/packages/core/src/infrastructure/PackChangeDeposit.js +106 -0
  162. package/dist/packages/core/src/infrastructure/PackChangeDeposit.js.map +1 -0
  163. package/dist/packages/core/src/infrastructure/RemotePackResolver.js +181 -0
  164. package/dist/packages/core/src/infrastructure/RemotePackResolver.js.map +1 -0
  165. package/dist/packages/core/src/infrastructure/SpecopsConfigFile.js +94 -0
  166. package/dist/packages/core/src/infrastructure/SpecopsConfigFile.js.map +1 -0
  167. package/dist/packages/core/test/unit/authoring-scope.test.js +102 -0
  168. package/dist/packages/core/test/unit/authoring-scope.test.js.map +1 -0
  169. package/dist/packages/core/test/unit/change-templates.test.js +96 -0
  170. package/dist/packages/core/test/unit/change-templates.test.js.map +1 -0
  171. package/dist/packages/core/test/unit/cucumber-messages.test.js +232 -0
  172. package/dist/packages/core/test/unit/cucumber-messages.test.js.map +1 -0
  173. package/dist/packages/core/test/unit/declared-artifacts.test.js +124 -0
  174. package/dist/packages/core/test/unit/declared-artifacts.test.js.map +1 -0
  175. package/dist/packages/core/test/unit/empty-attempt.test.js +79 -0
  176. package/dist/packages/core/test/unit/empty-attempt.test.js.map +1 -0
  177. package/dist/packages/core/test/unit/gherkin-dialects.test.js +115 -0
  178. package/dist/packages/core/test/unit/gherkin-dialects.test.js.map +1 -0
  179. package/dist/packages/core/test/unit/gherkin-keyword-case.test.js +110 -0
  180. package/dist/packages/core/test/unit/gherkin-keyword-case.test.js.map +1 -0
  181. package/dist/packages/core/test/unit/gherkin-quality.test.js +151 -0
  182. package/dist/packages/core/test/unit/gherkin-quality.test.js.map +1 -0
  183. package/dist/packages/core/test/unit/gherkin-tags.test.js +127 -0
  184. package/dist/packages/core/test/unit/gherkin-tags.test.js.map +1 -0
  185. package/dist/packages/core/test/unit/git-safety.test.js +104 -0
  186. package/dist/packages/core/test/unit/git-safety.test.js.map +1 -0
  187. package/dist/packages/core/test/unit/harness-report.test.js +192 -0
  188. package/dist/packages/core/test/unit/harness-report.test.js.map +1 -0
  189. package/dist/packages/core/test/unit/harness-roles.test.js +86 -0
  190. package/dist/packages/core/test/unit/harness-roles.test.js.map +1 -0
  191. package/dist/packages/core/test/unit/inbound-change.test.js +145 -0
  192. package/dist/packages/core/test/unit/inbound-change.test.js.map +1 -0
  193. package/dist/packages/core/test/unit/matrix-dependencies.test.js +100 -0
  194. package/dist/packages/core/test/unit/matrix-dependencies.test.js.map +1 -0
  195. package/dist/packages/core/test/unit/profile-match.test.js +115 -0
  196. package/dist/packages/core/test/unit/profile-match.test.js.map +1 -0
  197. package/dist/packages/core/test/unit/reconciliation.test.js +112 -0
  198. package/dist/packages/core/test/unit/reconciliation.test.js.map +1 -0
  199. package/dist/packages/core/test/unit/requirement-readiness.test.js +161 -0
  200. package/dist/packages/core/test/unit/requirement-readiness.test.js.map +1 -0
  201. package/dist/packages/core/test/unit/resume-state.test.js +124 -0
  202. package/dist/packages/core/test/unit/resume-state.test.js.map +1 -0
  203. package/dist/packages/core/test/unit/run-budget.test.js +113 -0
  204. package/dist/packages/core/test/unit/run-budget.test.js.map +1 -0
  205. package/dist/packages/core/test/unit/traceability-merge.test.js +159 -0
  206. package/dist/packages/core/test/unit/traceability-merge.test.js.map +1 -0
  207. package/dist/packages/core/test/unit/validate-project.test.js +156 -0
  208. package/dist/packages/core/test/unit/validate-project.test.js.map +1 -0
  209. package/dist/packages/core/test/unit/value-annotations.test.js +149 -0
  210. package/dist/packages/core/test/unit/value-annotations.test.js.map +1 -0
  211. package/dist/packages/core/test/unit/write-scope.test.js +165 -0
  212. package/dist/packages/core/test/unit/write-scope.test.js.map +1 -0
  213. package/dist/packages/core/test/unit/yaml-lite.test.js +78 -0
  214. package/dist/packages/core/test/unit/yaml-lite.test.js.map +1 -0
  215. package/dist/scripts/adopt_project.js +11 -0
  216. package/dist/scripts/adopt_project.js.map +1 -0
  217. package/dist/scripts/agents/commands.js +100 -0
  218. package/dist/scripts/agents/commands.js.map +1 -0
  219. package/dist/scripts/agents/init.js +482 -0
  220. package/dist/scripts/agents/init.js.map +1 -0
  221. package/dist/scripts/alm/cli.js +154 -0
  222. package/dist/scripts/alm/cli.js.map +1 -0
  223. package/dist/scripts/alm/clients.js +30 -0
  224. package/dist/scripts/alm/clients.js.map +1 -0
  225. package/dist/scripts/alm/core.js +258 -0
  226. package/dist/scripts/alm/core.js.map +1 -0
  227. package/dist/scripts/alm/port.js +116 -0
  228. package/dist/scripts/alm/port.js.map +1 -0
  229. package/dist/scripts/alm/providers/azure.js +79 -0
  230. package/dist/scripts/alm/providers/azure.js.map +1 -0
  231. package/dist/scripts/alm/providers/github.js +124 -0
  232. package/dist/scripts/alm/providers/github.js.map +1 -0
  233. package/dist/scripts/alm/providers/http-client.js +47 -0
  234. package/dist/scripts/alm/providers/http-client.js.map +1 -0
  235. package/dist/scripts/alm/providers/index.js +107 -0
  236. package/dist/scripts/alm/providers/index.js.map +1 -0
  237. package/dist/scripts/alm/providers/jira.js +129 -0
  238. package/dist/scripts/alm/providers/jira.js.map +1 -0
  239. package/dist/scripts/bundle_pack.js +10 -0
  240. package/dist/scripts/bundle_pack.js.map +1 -0
  241. package/dist/scripts/change/archive.js +68 -0
  242. package/dist/scripts/change/archive.js.map +1 -0
  243. package/dist/scripts/change/artifacts.js +143 -0
  244. package/dist/scripts/change/artifacts.js.map +1 -0
  245. package/dist/scripts/change/cli.js +39 -0
  246. package/dist/scripts/change/cli.js.map +1 -0
  247. package/dist/scripts/change/delta.js +20 -0
  248. package/dist/scripts/change/delta.js.map +1 -0
  249. package/dist/scripts/change/instructions.js +339 -0
  250. package/dist/scripts/change/instructions.js.map +1 -0
  251. package/dist/scripts/ci_init.js +12 -0
  252. package/dist/scripts/ci_init.js.map +1 -0
  253. package/dist/scripts/cli/commands/alm/PullCommand.js +238 -0
  254. package/dist/scripts/cli/commands/alm/PullCommand.js.map +1 -0
  255. package/dist/scripts/cli/commands/change/ChangeCommand.js +867 -0
  256. package/dist/scripts/cli/commands/change/ChangeCommand.js.map +1 -0
  257. package/dist/scripts/cli/commands/config/CiInitCommand.js +144 -0
  258. package/dist/scripts/cli/commands/config/CiInitCommand.js.map +1 -0
  259. package/dist/scripts/cli/commands/config/CompletionCommand.js +160 -0
  260. package/dist/scripts/cli/commands/config/CompletionCommand.js.map +1 -0
  261. package/dist/scripts/cli/commands/config/ConfigInitCommand.js +108 -0
  262. package/dist/scripts/cli/commands/config/ConfigInitCommand.js.map +1 -0
  263. package/dist/scripts/cli/commands/config/ConfigSetCommand.js +166 -0
  264. package/dist/scripts/cli/commands/config/ConfigSetCommand.js.map +1 -0
  265. package/dist/scripts/cli/commands/config/GenAgentContractCommand.js +212 -0
  266. package/dist/scripts/cli/commands/config/GenAgentContractCommand.js.map +1 -0
  267. package/dist/scripts/cli/commands/harness/RunCommand.js +1922 -0
  268. package/dist/scripts/cli/commands/harness/RunCommand.js.map +1 -0
  269. package/dist/scripts/cli/commands/mcp/McpInstallCommand.js +114 -0
  270. package/dist/scripts/cli/commands/mcp/McpInstallCommand.js.map +1 -0
  271. package/dist/scripts/cli/commands/mcp/index.js +29 -0
  272. package/dist/scripts/cli/commands/mcp/index.js.map +1 -0
  273. package/dist/scripts/cli/commands/pack/BundlePackCommand.js +59 -0
  274. package/dist/scripts/cli/commands/pack/BundlePackCommand.js.map +1 -0
  275. package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js +559 -0
  276. package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js.map +1 -0
  277. package/dist/scripts/cli/commands/pack/InferPackCommand.js +304 -0
  278. package/dist/scripts/cli/commands/pack/InferPackCommand.js.map +1 -0
  279. package/dist/scripts/cli/commands/pack/InitPackCommand.js +368 -0
  280. package/dist/scripts/cli/commands/pack/InitPackCommand.js.map +1 -0
  281. package/dist/scripts/cli/commands/pack/LintPackCommand.js +631 -0
  282. package/dist/scripts/cli/commands/pack/LintPackCommand.js.map +1 -0
  283. package/dist/scripts/cli/commands/pack/pack-args.js +83 -0
  284. package/dist/scripts/cli/commands/pack/pack-args.js.map +1 -0
  285. package/dist/scripts/cli/commands/project/AdoptCommand.js +414 -0
  286. package/dist/scripts/cli/commands/project/AdoptCommand.js.map +1 -0
  287. package/dist/scripts/cli/commands/project/InitFromPackCommand.js +188 -0
  288. package/dist/scripts/cli/commands/project/InitFromPackCommand.js.map +1 -0
  289. package/dist/scripts/cli/commands/project/InitProjectCommand.js +791 -0
  290. package/dist/scripts/cli/commands/project/InitProjectCommand.js.map +1 -0
  291. package/dist/scripts/cli/commands/project/OnboardCommand.js +655 -0
  292. package/dist/scripts/cli/commands/project/OnboardCommand.js.map +1 -0
  293. package/dist/scripts/cli/commands/project/UpdateCommand.js +206 -0
  294. package/dist/scripts/cli/commands/project/UpdateCommand.js.map +1 -0
  295. package/dist/scripts/cli/commands/project/WizardCommand.js +166 -0
  296. package/dist/scripts/cli/commands/project/WizardCommand.js.map +1 -0
  297. package/dist/scripts/cli/commands/quality/DoctorCommand.js +553 -0
  298. package/dist/scripts/cli/commands/quality/DoctorCommand.js.map +1 -0
  299. package/dist/scripts/cli/commands/quality/FixCommand.js +201 -0
  300. package/dist/scripts/cli/commands/quality/FixCommand.js.map +1 -0
  301. package/dist/scripts/cli/commands/quality/LicenseCheckCommand.js +187 -0
  302. package/dist/scripts/cli/commands/quality/LicenseCheckCommand.js.map +1 -0
  303. package/dist/scripts/cli/commands/quality/ReportCommand.js +557 -0
  304. package/dist/scripts/cli/commands/quality/ReportCommand.js.map +1 -0
  305. package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js +764 -0
  306. package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js.map +1 -0
  307. package/dist/scripts/cli/commands/spec/DoneCommand.js +116 -0
  308. package/dist/scripts/cli/commands/spec/DoneCommand.js.map +1 -0
  309. package/dist/scripts/cli/commands/spec/PlanCommand.js +397 -0
  310. package/dist/scripts/cli/commands/spec/PlanCommand.js.map +1 -0
  311. package/dist/scripts/cli/commands/spec/ReqCommand.js +303 -0
  312. package/dist/scripts/cli/commands/spec/ReqCommand.js.map +1 -0
  313. package/dist/scripts/cli/commands/spec/StatusCommand.js +206 -0
  314. package/dist/scripts/cli/commands/spec/StatusCommand.js.map +1 -0
  315. package/dist/scripts/cli/commands/spec/StudioCommand.js +241 -0
  316. package/dist/scripts/cli/commands/spec/StudioCommand.js.map +1 -0
  317. package/dist/scripts/cli/commands/specops/ContributeCommand.js +313 -0
  318. package/dist/scripts/cli/commands/specops/ContributeCommand.js.map +1 -0
  319. package/dist/scripts/cli/commands/specops/DiffCommand.js +394 -0
  320. package/dist/scripts/cli/commands/specops/DiffCommand.js.map +1 -0
  321. package/dist/scripts/cli/commands/specops/SyncCommand.js +380 -0
  322. package/dist/scripts/cli/commands/specops/SyncCommand.js.map +1 -0
  323. package/dist/scripts/completion.js +24 -0
  324. package/dist/scripts/completion.js.map +1 -0
  325. package/dist/scripts/config_init.js +12 -0
  326. package/dist/scripts/config_init.js.map +1 -0
  327. package/dist/scripts/config_set.js +20 -0
  328. package/dist/scripts/config_set.js.map +1 -0
  329. package/dist/scripts/docs/blocks.js +137 -0
  330. package/dist/scripts/docs/blocks.js.map +1 -0
  331. package/dist/scripts/docs/build-site.js +425 -0
  332. package/dist/scripts/docs/build-site.js.map +1 -0
  333. package/dist/scripts/docs/nav.js +198 -0
  334. package/dist/scripts/docs/nav.js.map +1 -0
  335. package/dist/scripts/docs/record-terminal.js +477 -0
  336. package/dist/scripts/docs/record-terminal.js.map +1 -0
  337. package/dist/scripts/docs/terminal-storyboard.js +121 -0
  338. package/dist/scripts/docs/terminal-storyboard.js.map +1 -0
  339. package/dist/scripts/doctor.js +14 -0
  340. package/dist/scripts/doctor.js.map +1 -0
  341. package/dist/scripts/done.js +17 -0
  342. package/dist/scripts/done.js.map +1 -0
  343. package/dist/scripts/expand_domain_pack.js +18 -0
  344. package/dist/scripts/expand_domain_pack.js.map +1 -0
  345. package/dist/scripts/fix.js +12 -0
  346. package/dist/scripts/fix.js.map +1 -0
  347. package/dist/scripts/gen_agent_contract.js +14 -0
  348. package/dist/scripts/gen_agent_contract.js.map +1 -0
  349. package/dist/scripts/gen_mcp_tools.js +264 -0
  350. package/dist/scripts/gen_mcp_tools.js.map +1 -0
  351. package/dist/scripts/harness/init.js +358 -0
  352. package/dist/scripts/harness/init.js.map +1 -0
  353. package/dist/scripts/harness/prompt.js +18 -0
  354. package/dist/scripts/harness/prompt.js.map +1 -0
  355. package/dist/scripts/harness/report.js +323 -0
  356. package/dist/scripts/harness/report.js.map +1 -0
  357. package/dist/scripts/harness/run.js +33 -0
  358. package/dist/scripts/harness/run.js.map +1 -0
  359. package/dist/scripts/infer_pack.js +17 -0
  360. package/dist/scripts/infer_pack.js.map +1 -0
  361. package/dist/scripts/init_from_pack.js +16 -0
  362. package/dist/scripts/init_from_pack.js.map +1 -0
  363. package/dist/scripts/init_pack.js +16 -0
  364. package/dist/scripts/init_pack.js.map +1 -0
  365. package/dist/scripts/init_project.js +17 -0
  366. package/dist/scripts/init_project.js.map +1 -0
  367. package/dist/scripts/lib/agent.js +99 -0
  368. package/dist/scripts/lib/agent.js.map +1 -0
  369. package/dist/scripts/lib/capability-specs.js +80 -0
  370. package/dist/scripts/lib/capability-specs.js.map +1 -0
  371. package/dist/scripts/lib/command.js +17 -0
  372. package/dist/scripts/lib/command.js.map +1 -0
  373. package/dist/scripts/lib/diagnostics.js +62 -0
  374. package/dist/scripts/lib/diagnostics.js.map +1 -0
  375. package/dist/scripts/lib/monorepo-fanout.js +118 -0
  376. package/dist/scripts/lib/monorepo-fanout.js.map +1 -0
  377. package/dist/scripts/lib/placeholders.js +190 -0
  378. package/dist/scripts/lib/placeholders.js.map +1 -0
  379. package/dist/scripts/lib/project-root.js +124 -0
  380. package/dist/scripts/lib/project-root.js.map +1 -0
  381. package/dist/scripts/lib/requirement-graph.js +31 -0
  382. package/dist/scripts/lib/requirement-graph.js.map +1 -0
  383. package/dist/scripts/lib/surface.js +609 -0
  384. package/dist/scripts/lib/surface.js.map +1 -0
  385. package/dist/scripts/license_check.js +15 -0
  386. package/dist/scripts/license_check.js.map +1 -0
  387. package/dist/scripts/lint_pack.js +18 -0
  388. package/dist/scripts/lint_pack.js.map +1 -0
  389. package/dist/scripts/merge-traceability.js +106 -0
  390. package/dist/scripts/merge-traceability.js.map +1 -0
  391. package/dist/scripts/onboard.js +22 -0
  392. package/dist/scripts/onboard.js.map +1 -0
  393. package/dist/scripts/plan.js +17 -0
  394. package/dist/scripts/plan.js.map +1 -0
  395. package/dist/scripts/plugin/gate-hook.js +171 -0
  396. package/dist/scripts/plugin/gate-hook.js.map +1 -0
  397. package/dist/scripts/report.js +17 -0
  398. package/dist/scripts/report.js.map +1 -0
  399. package/dist/scripts/req.js +22 -0
  400. package/dist/scripts/req.js.map +1 -0
  401. package/dist/scripts/schema/cli.js +215 -0
  402. package/dist/scripts/schema/cli.js.map +1 -0
  403. package/dist/scripts/schema/registry.js +264 -0
  404. package/dist/scripts/schema/registry.js.map +1 -0
  405. package/dist/scripts/specops/add.js +180 -0
  406. package/dist/scripts/specops/add.js.map +1 -0
  407. package/dist/scripts/specops/against_lock.js +100 -0
  408. package/dist/scripts/specops/against_lock.js.map +1 -0
  409. package/dist/scripts/specops/as_change.js +49 -0
  410. package/dist/scripts/specops/as_change.js.map +1 -0
  411. package/dist/scripts/specops/contribute.js +24 -0
  412. package/dist/scripts/specops/contribute.js.map +1 -0
  413. package/dist/scripts/specops/diff.js +32 -0
  414. package/dist/scripts/specops/diff.js.map +1 -0
  415. package/dist/scripts/specops/lock.js +39 -0
  416. package/dist/scripts/specops/lock.js.map +1 -0
  417. package/dist/scripts/specops/manifest.js +90 -0
  418. package/dist/scripts/specops/manifest.js.map +1 -0
  419. package/dist/scripts/specops/remove.js +102 -0
  420. package/dist/scripts/specops/remove.js.map +1 -0
  421. package/dist/scripts/specops/sync.js +27 -0
  422. package/dist/scripts/specops/sync.js.map +1 -0
  423. package/dist/scripts/specops/verify.js +149 -0
  424. package/dist/scripts/specops/verify.js.map +1 -0
  425. package/dist/scripts/status.js +17 -0
  426. package/dist/scripts/status.js.map +1 -0
  427. package/dist/scripts/studio.js +14 -0
  428. package/dist/scripts/studio.js.map +1 -0
  429. package/dist/scripts/update.js +17 -0
  430. package/dist/scripts/update.js.map +1 -0
  431. package/dist/scripts/validate_specs.js +10 -0
  432. package/dist/scripts/validate_specs.js.map +1 -0
  433. package/examples/project.config.example +19 -0
  434. package/examples/project.yaml.example +17 -0
  435. package/package.json +105 -0
  436. package/templates/adopt/AI_RULES.md.tpl +27 -0
  437. package/templates/adopt/adr-readme.md.tpl +5 -0
  438. package/templates/adopt/baseline.feature.tpl +9 -0
  439. package/templates/adopt/spec.md.tpl +25 -0
  440. package/templates/adopt/traceability.md.tpl +11 -0
  441. package/templates/backend/AI_RULES.md.tpl +35 -0
  442. package/templates/backend/features/core/health.feature.tpl +7 -0
  443. package/templates/base/.devcontainer/devcontainer.json.tpl +18 -0
  444. package/templates/base/.dockerignore.tpl +11 -0
  445. package/templates/base/.env.dev.app.tpl +13 -0
  446. package/templates/base/.env.dev.infra.tpl +6 -0
  447. package/templates/base/.env.dev.tpl +16 -0
  448. package/templates/base/.env.example.tpl +17 -0
  449. package/templates/base/.env.feature.app.tpl +11 -0
  450. package/templates/base/.env.feature.infra.tpl +4 -0
  451. package/templates/base/.env.feature.tpl +16 -0
  452. package/templates/base/.env.prod.app.tpl +13 -0
  453. package/templates/base/.env.prod.infra.tpl +6 -0
  454. package/templates/base/.env.prod.tpl +16 -0
  455. package/templates/base/.github/workflows/specs.yml.tpl +26 -0
  456. package/templates/base/.gitignore.tpl +9 -0
  457. package/templates/base/.pre-commit-config.yaml.tpl +10 -0
  458. package/templates/base/AGENTS.md.tpl +32 -0
  459. package/templates/base/README.md.tpl +32 -0
  460. package/templates/base/docker-compose.yml.tpl +13 -0
  461. package/templates/base/docs/specs/adr/README.md.tpl +10 -0
  462. package/templates/base/docs/specs/aggregates.md.tpl +5 -0
  463. package/templates/base/docs/specs/commands.md.tpl +13 -0
  464. package/templates/base/docs/specs/domain-model.md.tpl +30 -0
  465. package/templates/base/docs/specs/events.md.tpl +5 -0
  466. package/templates/base/docs/specs/review-checklist.md.tpl +18 -0
  467. package/templates/base/docs/specs/runtime-environments.md.tpl +26 -0
  468. package/templates/base/docs/specs/status-model.md.tpl +16 -0
  469. package/templates/base/docs/specs/traceability.md.tpl +7 -0
  470. package/templates/base/docs/specs/use-cases.md.tpl +5 -0
  471. package/templates/base/spec.md.tpl +63 -0
  472. package/templates/ci/azure.yml.tpl +40 -0
  473. package/templates/ci/github.yml.tpl +40 -0
  474. package/templates/ci/gitlab.yml.tpl +21 -0
  475. package/templates/ci/jenkins.tpl +35 -0
  476. package/templates/contracts/AI_RULES.md.tpl +55 -0
  477. package/templates/contracts/asyncapi-stub.yaml.tpl +24 -0
  478. package/templates/contracts/contract-traceability.md.tpl +10 -0
  479. package/templates/contracts/openapi-stub.yaml.tpl +29 -0
  480. package/templates/contracts/pacts-gitkeep.tpl +0 -0
  481. package/templates/contracts/test-strategy.md.tpl +94 -0
  482. package/templates/frontend/AI_RULES.md.tpl +34 -0
  483. package/templates/frontend/features/core/health.feature.tpl +6 -0
  484. package/templates/harness/harness.config.yaml.tpl +74 -0
  485. package/templates/harness/prompt-prefix.md.tpl +60 -0
  486. package/templates/mobile/AI_RULES.md.tpl +56 -0
  487. package/templates/mobile/features/core/health.feature.tpl +7 -0
  488. package/templates/modules/auth/backend/registration_and_login.feature.tpl +10 -0
  489. package/templates/modules/auth/frontend/login.feature.tpl +5 -0
  490. package/templates/modules/billing/backend/billing_settlement.feature.tpl +5 -0
  491. package/templates/modules/billing/frontend/billing_summary.feature.tpl +5 -0
  492. package/templates/modules/dashboard/backend/dashboard_kpi.feature.tpl +5 -0
  493. package/templates/modules/dashboard/frontend/dashboard.feature.tpl +5 -0
  494. package/vendor/mermaid.min.js +3636 -0
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ILockfileRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILockfileRepository.js","sourceRoot":"","sources":["../../../../../../packages/core/src/application/ports/ILockfileRepository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IManifestRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IManifestRepository.js","sourceRoot":"","sources":["../../../../../../packages/core/src/application/ports/IManifestRepository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IProjectRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IProjectRepository.js","sourceRoot":"","sources":["../../../../../../packages/core/src/application/ports/IProjectRepository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IRequirementGraphRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRequirementGraphRepository.js","sourceRoot":"","sources":["../../../../../../packages/core/src/application/ports/IRequirementGraphRepository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITraceabilityRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITraceabilityRepository.js","sourceRoot":"","sources":["../../../../../../packages/core/src/application/ports/ITraceabilityRepository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentPrompt = void 0;
4
+ class AgentPrompt {
5
+ static build(req, opts = {}) {
6
+ const parts = [];
7
+ if (opts.promptPrefix && String(opts.promptPrefix).trim()) {
8
+ parts.push(String(opts.promptPrefix).trimEnd());
9
+ parts.push("---");
10
+ }
11
+ parts.push(`# Implement ${req.requirement}\n\n` +
12
+ `You are a coding agent working inside a spec-driven project. Implement ` +
13
+ `exactly one requirement — **${req.requirement}** — following the project's ` +
14
+ `existing conventions. Do not touch unrelated files.`);
15
+ const field = (camel, snake) => {
16
+ const val = req[camel] !== undefined ? req[camel] : req[snake];
17
+ return val === null || val === undefined ? "" : val;
18
+ };
19
+ const facts = [
20
+ `- Requirement: ${req.requirement}`,
21
+ `- Scenario ID: ${field("scenarioId", "scenario_id") || "(none)"}`,
22
+ `- plan category: ${req.category || ""}`,
23
+ `- Feature file: ${field("featureFile", "feature_file") || "(none declared)"}`,
24
+ `- Test artifact (write this first — TDD): ${field("testArtifact", "test_artifact") || "(none declared)"}`,
25
+ `- Production artifact: ${field("technicalArtifact", "technical_artifact") || "(none declared)"}`,
26
+ `- Current status: ${req.status || "(none)"}`,
27
+ ].join("\n");
28
+ parts.push(AgentPrompt.section("Requirement facts", facts));
29
+ if (opts.hint) {
30
+ parts.push(AgentPrompt.section("Suggested approach", opts.hint));
31
+ }
32
+ const featureRel = String(field("featureFile", "feature_file") || "")
33
+ .replace(/^`|`$/g, "")
34
+ .trim();
35
+ if (featureRel) {
36
+ if (opts.featureContent) {
37
+ parts.push(AgentPrompt.section(`Gherkin scenario (${featureRel})`, "```gherkin\n" + opts.featureContent.trimEnd() + "\n```"));
38
+ }
39
+ else {
40
+ parts.push(AgentPrompt.section("Gherkin scenario", `The feature file \`${featureRel}\` does not exist yet. Create it from the ` +
41
+ `requirement before writing code.`));
42
+ }
43
+ }
44
+ if (opts.aiRulesContent) {
45
+ parts.push(AgentPrompt.section("Project rules (AI_RULES.md — non-negotiable)", opts.aiRulesContent.trimEnd()));
46
+ }
47
+ const baseRules = opts.stageRules || [
48
+ "Write the test first against the technical artifact path declared in the requirement.",
49
+ "Run the project test command; verify the test fails for the expected reason.",
50
+ "Implement the requirement; verify the test passes.",
51
+ ];
52
+ const doneRules = [
53
+ ...baseRules,
54
+ "**Do not modify** `spec.md`, `AI_RULES.md`, or any `features/**/*.feature` — they are the project's source of truth.",
55
+ "The harness will run `validate --strict-tdd` and the project test command. Both must pass.",
56
+ ];
57
+ parts.push(AgentPrompt.section("Definition of done", doneRules.map((r, i) => `${i + 1}. ${r}`).join("\n")));
58
+ if (opts.previousFailure) {
59
+ parts.push(AgentPrompt.section(`Previous attempt failed (attempt ${(opts.attempt || 2) - 1}` +
60
+ `${opts.maxAttempts ? ` of ${opts.maxAttempts}` : ""})`, "The gate rejected the last attempt. Fix the specific failure below — do not " +
61
+ "start over.\n\n```\n" +
62
+ String(opts.previousFailure).trim().slice(-4000) +
63
+ "\n```"));
64
+ }
65
+ if (opts.reviewFindings) {
66
+ parts.push(AgentPrompt.section("Reviewer findings", "A reviewer read the previous attempt and reported the following. These are " +
67
+ "advice, not a verdict: the gate decides, and a finding it does not care " +
68
+ "about must not send you off-spec.\n\n```\n" +
69
+ String(opts.reviewFindings).trim().slice(-4000) +
70
+ "\n```"));
71
+ }
72
+ return parts.join("\n");
73
+ }
74
+ static section(title, body) {
75
+ return `## ${title}\n\n${body}\n`;
76
+ }
77
+ }
78
+ exports.AgentPrompt = AgentPrompt;
79
+ //# sourceMappingURL=AgentPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentPrompt.js","sourceRoot":"","sources":["../../../../../packages/core/src/domain/AgentPrompt.ts"],"names":[],"mappings":";;;AA4BA,MAAa,WAAW;IACf,MAAM,CAAC,KAAK,CAAC,GAAsB,EAAE,OAAsB,EAAE;QAClE,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,IAAI,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAC1D,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAChD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;QAED,KAAK,CAAC,IAAI,CACR,eAAe,GAAG,CAAC,WAAW,MAAM;YAClC,yEAAyE;YACzE,+BAA+B,GAAG,CAAC,WAAW,+BAA+B;YAC7E,qDAAqD,CACxD,CAAC;QAEF,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE;YAC7C,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC/D,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACtD,CAAC,CAAC;QAEF,MAAM,KAAK,GAAG;YACZ,kBAAkB,GAAG,CAAC,WAAW,EAAE;YACnC,kBAAkB,KAAK,CA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AAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;gBAC/C,OAAO,CACV,CACF,CAAC;QACJ,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,KAAa,EAAE,IAAY;QAChD,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI,CAAC;IACpC,CAAC;CACF;AAtHD,kCAsHC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArchivePlan = void 0;
4
+ class ArchivePlan {
5
+ writes = [];
6
+ deletes = [];
7
+ move;
8
+ totals = {
9
+ added: 0,
10
+ modified: 0,
11
+ removed: 0,
12
+ specsWritten: 0,
13
+ specsRetired: 0,
14
+ };
15
+ projectDir;
16
+ diagnostics = [];
17
+ warnings = [];
18
+ get ok() {
19
+ return this.diagnostics.length === 0;
20
+ }
21
+ get specsUpdated() {
22
+ return this.totals.specsWritten > 0 || this.totals.specsRetired > 0;
23
+ }
24
+ }
25
+ exports.ArchivePlan = ArchivePlan;
26
+ //# sourceMappingURL=ArchivePlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArchivePlan.js","sourceRoot":"","sources":["../../../../../packages/core/src/domain/ArchivePlan.ts"],"names":[],"mappings":";;;AA8BA,MAAa,WAAW;IACf,MAAM,GAAqB,EAAE,CAAC;IAC9B,OAAO,GAAsB,EAAE,CAAC;IAChC,IAAI,CAAiB;IACrB,MAAM,GAAsB;QACjC,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;KAChB,CAAC;IAEK,UAAU,CAAU;IACpB,WAAW,GAAU,EAAE,CAAC;IACxB,QAAQ,GAAU,EAAE,CAAC;IAE5B,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC;IACtE,CAAC;CACF;AAvBD,kCAuBC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * What a `spec-author` agent is allowed to touch.
4
+ *
5
+ * The role writes the proposal and the delta of a change. It is the one role in
6
+ * the harness that produces *specification* rather than code, and that is
7
+ * exactly why it needs a boundary: an agent asked to describe a change, and
8
+ * able to edit the capability spec it is describing, can quietly make the
9
+ * change unnecessary instead of proposing it.
10
+ *
11
+ * So the rule is narrow and stated once, here: everything under the change's
12
+ * own directory, and nothing else. Not `spec.md`, not the capability specs, not
13
+ * `traceability.md`, not code. `change archive` is what moves a delta into the
14
+ * capability spec, after a human has read it.
15
+ *
16
+ * Pure: paths in, verdict out. Enforcing it — reverting what strayed outside —
17
+ * belongs to the command, which is where a filesystem lives.
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.changeScope = changeScope;
21
+ exports.isInScope = isInScope;
22
+ exports.judgeScope = judgeScope;
23
+ /** Repository-relative, POSIX-separated. `docs/specs/changes/<id>/…` */
24
+ function changeScope(changeId) {
25
+ return `docs/specs/changes/${changeId}/`;
26
+ }
27
+ /** Is this path inside the change the author was asked to write? */
28
+ function isInScope(relativePath, changeId) {
29
+ const normalised = relativePath.split("\\").join("/").replace(/^\.\//, "");
30
+ // A path that climbs out cannot be judged by prefix alone: `docs/specs/
31
+ // changes/x/../../../etc` starts with the scope and is not inside it.
32
+ if (normalised.split("/").includes(".."))
33
+ return false;
34
+ return normalised.startsWith(changeScope(changeId));
35
+ }
36
+ /**
37
+ * Split what changed into what was permitted and what was not.
38
+ *
39
+ * @param changed repository-relative paths the agent touched
40
+ */
41
+ function judgeScope(changed, changeId) {
42
+ const allowed = [];
43
+ const strayed = [];
44
+ for (const p of changed)
45
+ (isInScope(p, changeId) ? allowed : strayed).push(p);
46
+ return { allowed, strayed };
47
+ }
48
+ //# sourceMappingURL=AuthoringScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthoringScope.js","sourceRoot":"","sources":["../../../../../packages/core/src/domain/AuthoringScope.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AAGH,kCAEC;AAGD,8BAMC;AAcD,gCAKC;AA/BD,wEAAwE;AACxE,SAAgB,WAAW,CAAC,QAAgB;IAC1C,OAAO,sBAAsB,QAAQ,GAAG,CAAC;AAC3C,CAAC;AAED,oEAAoE;AACpE,SAAgB,SAAS,CAAC,YAAoB,EAAE,QAAgB;IAC9D,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3E,wEAAwE;IACxE,sEAAsE;IACtE,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,OAAO,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AASD;;;;GAIG;AACH,SAAgB,UAAU,CAAC,OAA0B,EAAE,QAAgB;IACrE,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ /**
3
+ * The files `specgate change new` scaffolds.
4
+ *
5
+ * Prose follows the project's language; the grammar never does. `SHALL`,
6
+ * `GIVEN`/`WHEN`/`THEN`, `## ADDED Requirements` and `REQ-NNN` are what the
7
+ * validator parses, so they stay in English in every locale — see
8
+ * `domain/Language`.
9
+ *
10
+ * The phrase table arrives already resolved, which is what keeps this module
11
+ * pure: working out which language a project speaks reads its config.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.CHANGE_TEMPLATES = void 0;
15
+ exports.templateProposal = templateProposal;
16
+ exports.templateTasks = templateTasks;
17
+ exports.templateDesign = templateDesign;
18
+ exports.templateDelta = templateDelta;
19
+ exports.templateValueDriftDelta = templateValueDriftDelta;
20
+ const SpecParser_1 = require("./SpecParser");
21
+ function templateProposal(changeId) {
22
+ return `# Proposal: ${changeId}
23
+
24
+ ## Intent
25
+
26
+ <!-- Why this change exists. The problem, not the solution. -->
27
+
28
+ ## Scope
29
+
30
+ In scope:
31
+
32
+ -
33
+
34
+ Out of scope:
35
+
36
+ -
37
+
38
+ ## Approach
39
+
40
+ <!-- One paragraph. The technical detail belongs in design.md. -->
41
+ `;
42
+ }
43
+ function templateTasks() {
44
+ return `# Tasks
45
+
46
+ ## 1. Specification
47
+
48
+ - [ ] 1.1 Write the delta spec for each affected capability
49
+ - [ ] 1.2 Run \`specgate change validate\`
50
+
51
+ ## 2. Implementation
52
+
53
+ - [ ] 2.1
54
+ `;
55
+ }
56
+ function templateDesign(changeId) {
57
+ return `# Design: ${changeId}
58
+
59
+ ## Technical approach
60
+
61
+ <!-- How. Only what a reviewer needs to judge the approach. -->
62
+
63
+ ## Decisions
64
+
65
+ ### Decision:
66
+
67
+ <!-- What was chosen, and what was rejected, and why. -->
68
+
69
+ ## Affected files
70
+
71
+ -
72
+ `;
73
+ }
74
+ function templateDelta(capability, reqId, t) {
75
+ return `# Delta — ${capability}
76
+
77
+ ## ADDED Requirements
78
+
79
+ ### Requirement: ${reqId} — ${t.shortName}
80
+
81
+ ${t.systemShall(t.observableBehaviour)}
82
+
83
+ #### Scenario: ${t.scenarioName}
84
+
85
+ - GIVEN ${t.precondition}
86
+ - WHEN ${t.action}
87
+ - THEN ${t.outcome}
88
+
89
+ <!-- csda:trace uc=UC-000 feature=features/<area>/<name>.feature -->
90
+ `;
91
+ }
92
+ /**
93
+ * Route 2 of the three-way resolution for a declared-value divergence
94
+ * (§8.6 → §11): "update the spec". Routes 1 ("fix the code") and 3 ("retire
95
+ * the requirement") need no new tooling — they are pointed at from the
96
+ * report and use `change new`/manual editing exactly as they already do.
97
+ * This is the one route that is glue between pieces that already exist:
98
+ * `specgate report` finds the divergence, `renderRequirement` already knows how
99
+ * to serialise a requirement node, and `ArchiveChangeUseCase` already knows
100
+ * how to apply a `MODIFIED Requirements` delta.
101
+ *
102
+ * The `value_<id>` trace key is rewritten to the code's value — that part is
103
+ * exact, because it is a structured field. The prose is **not**
104
+ * rewritten automatically: "the session times out after 15 minutes" cannot
105
+ * be turned into "after 30 minutes" without risking a sentence that reads
106
+ * wrong, which is exactly the kind of guess this project refuses to make on
107
+ * a human's behalf. A `TODO:` marks it instead — the same restraint
108
+ * `pack infer` already uses for whatever it cannot infer (ADR-0014).
109
+ */
110
+ function templateValueDriftDelta(capability, req, valueId, oldValue, newValue) {
111
+ const updated = {
112
+ ...req,
113
+ trace: { ...req.trace, [`value_${valueId}`]: newValue },
114
+ text: `${req.text || ""}`.trim() +
115
+ `\n\nTODO: this requirement's prose still says \`${valueId}\` is \`${oldValue}\`. ` +
116
+ `Update it to state \`${newValue}\`, the value the code actually declares, or reject ` +
117
+ `this change if the code is what should change instead.`,
118
+ };
119
+ return `# Delta — ${capability}
120
+
121
+ ## MODIFIED Requirements
122
+
123
+ ${(0, SpecParser_1.renderRequirement)(updated)}
124
+ `;
125
+ }
126
+ /** The scaffolded file set, keyed by the artefact `change new` writes. */
127
+ exports.CHANGE_TEMPLATES = {
128
+ proposal: (changeId) => templateProposal(changeId),
129
+ tasks: () => templateTasks(),
130
+ design: (changeId) => templateDesign(changeId),
131
+ specs: (_changeId, t) => templateDelta("<capability>", "REQ-NNN", t),
132
+ };
133
+ //# sourceMappingURL=ChangeTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeTemplates.js","sourceRoot":"","sources":["../../../../../packages/core/src/domain/ChangeTemplates.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAKH,4CAqBC;AAED,sCAYC;AAED,wCAiBC;AAED,sCAiBC;AAoBD,0DAsBC;AArHD,6CAAiD;AAEjD,SAAgB,gBAAgB,CAAC,QAAQ;IACvC,OAAO,eAAe,QAAQ;;;;;;;;;;;;;;;;;;;CAmB/B,CAAC;AACF,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO;;;;;;;;;;CAUR,CAAC;AACF,CAAC;AAED,SAAgB,cAAc,CAAC,QAAQ;IACrC,OAAO,aAAa,QAAQ;;;;;;;;;;;;;;;CAe7B,CAAC;AACF,CAAC;AAED,SAAgB,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,CAAU;IACzD,OAAO,aAAa,UAAU;;;;mBAIb,KAAK,MAAM,CAAC,CAAC,SAAS;;EAEvC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC;;iBAErB,CAAC,CAAC,YAAY;;UAErB,CAAC,CAAC,YAAY;SACf,CAAC,CAAC,MAAM;SACR,CAAC,CAAC,OAAO;;;CAGjB,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,uBAAuB,CACrC,UAAkB,EAClB,GAAQ,EACR,OAAe,EACf,QAAgB,EAChB,QAAgB;IAEhB,MAAM,OAAO,GAAG;QACd,GAAG,GAAG;QACN,KAAK,EAAE,EAAE,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE;QACvD,IAAI,EACF,GAAG,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;YAC1B,mDAAmD,OAAO,WAAW,QAAQ,MAAM;YACnF,wBAAwB,QAAQ,sDAAsD;YACtF,wDAAwD;KAC3D,CAAC;IACF,OAAO,aAAa,UAAU;;;;EAI9B,IAAA,8BAAiB,EAAC,OAAO,CAAC;CAC3B,CAAC;AACF,CAAC;AAED,0EAA0E;AAC7D,QAAA,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC;IAC1D,KAAK,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE;IAC5B,MAAM,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;IACtD,KAAK,EAAE,CAAC,SAAiB,EAAE,CAAU,EAAE,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC;CACtF,CAAC"}
@@ -0,0 +1,256 @@
1
+ "use strict";
2
+ /**
3
+ * Reading what Cucumber actually did, instead of reading its prose (F5).
4
+ *
5
+ * ## Why
6
+ *
7
+ * The gate asks one question — did the command exit zero? — and H14 showed what
8
+ * that misses: `1 scenario (1 passed) · 0 steps · exit 0` is a scenario that
9
+ * tested nothing and reported success. `filterHint` already tried to catch a
10
+ * neighbouring problem, a filter that silently did not apply, by running a
11
+ * regular expression over the human summary looking for "16 scenarios". A
12
+ * regex over prose is a guess; this is the same fact, stated by the runner.
13
+ *
14
+ * Cucumber has published a machine-readable channel for years. `--format
15
+ * message` emits NDJSON, one envelope per line, and it answers directly:
16
+ *
17
+ * - is there a scenario for the requirement under test at all;
18
+ * - did it *run*;
19
+ * - did it have steps;
20
+ * - did every one of them end `PASSED`;
21
+ * - how many scenarios ran in total.
22
+ *
23
+ * ## Built against a real stream
24
+ *
25
+ * The shapes here were taken from `npx cucumber-js --format message` over this
26
+ * repository's own suite (protocol 33.0.4, cucumber-js 13.2.1), not from
27
+ * memory. One detail that only shows up that way: `testCase.testSteps` includes
28
+ * **hook** steps, which carry no `pickleStepId`. Counting those as steps would
29
+ * let an empty scenario with a `Before` hook read as having one — precisely the
30
+ * H14 failure, rebuilt in a new place.
31
+ *
32
+ * ## Staying runner-neutral
33
+ *
34
+ * Nothing here is required. A project that does not use Cucumber keeps the
35
+ * exit-code gate, and the harness stays neutral about the runner — this is an
36
+ * extra reading for the runner that offers one.
37
+ */
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.GATE_MESSAGE_CODES = void 0;
40
+ exports.parseCucumberMessages = parseCucumberMessages;
41
+ exports.invokesCucumberDirectly = invokesCucumberDirectly;
42
+ exports.withMessageReport = withMessageReport;
43
+ exports.pickTargetPickles = pickTargetPickles;
44
+ exports.checkGateRun = checkGateRun;
45
+ const Diagnostic_1 = require("./Diagnostic");
46
+ exports.GATE_MESSAGE_CODES = Object.freeze({
47
+ NOT_FOUND: "gate_scenario_not_found",
48
+ NOT_EXECUTED: "gate_scenario_not_executed",
49
+ NO_STEPS: "gate_scenario_has_no_steps",
50
+ NOT_PASSED: "gate_scenario_not_passed",
51
+ RAN_MORE_THAN_ASKED: "gate_ran_more_than_asked",
52
+ });
53
+ /** Worse than `PASSED`, in the order a run should be judged by. */
54
+ const FAILING_ORDER = ["FAILED", "AMBIGUOUS", "UNDEFINED", "PENDING", "SKIPPED", "UNKNOWN"];
55
+ function worstStatus(statuses) {
56
+ for (const candidate of FAILING_ORDER) {
57
+ if (statuses.includes(candidate))
58
+ return candidate;
59
+ }
60
+ return statuses.length > 0 ? "PASSED" : "NOT_EXECUTED";
61
+ }
62
+ /**
63
+ * Fold an NDJSON message stream into per-scenario outcomes.
64
+ *
65
+ * Tolerant on purpose: a line that is not JSON, or an envelope of a kind we do
66
+ * not use, is skipped rather than fatal. The stream is written progressively,
67
+ * so a killed run leaves a partial last line, and refusing to read the other
68
+ * 300 envelopes because of it would be the wrong trade.
69
+ */
70
+ function parseCucumberMessages(ndjson) {
71
+ const pickles = new Map();
72
+ /** testCase id → { pickleId, pickleStepByTestStepId } */
73
+ const testCases = new Map();
74
+ /** testCaseStarted id → testCase id */
75
+ const started = new Map();
76
+ /** pickle id → status per pickle step */
77
+ const statuses = new Map();
78
+ let implementation = null;
79
+ let parsed = false;
80
+ for (const line of (ndjson || "").split("\n")) {
81
+ const text = line.trim();
82
+ if (!text)
83
+ continue;
84
+ let envelope;
85
+ try {
86
+ envelope = JSON.parse(text);
87
+ }
88
+ catch {
89
+ continue;
90
+ }
91
+ if (!envelope || typeof envelope !== "object")
92
+ continue;
93
+ if (envelope.meta) {
94
+ parsed = true;
95
+ implementation = envelope.meta?.implementation?.name ?? null;
96
+ }
97
+ else if (envelope.pickle) {
98
+ parsed = true;
99
+ pickles.set(envelope.pickle.id, envelope.pickle);
100
+ }
101
+ else if (envelope.testCase) {
102
+ parsed = true;
103
+ const steps = new Map();
104
+ for (const step of envelope.testCase.testSteps ?? []) {
105
+ // No `pickleStepId` means a hook, and a hook is not a step the
106
+ // scenario declared. See the module note.
107
+ if (step?.pickleStepId)
108
+ steps.set(step.id, step.pickleStepId);
109
+ }
110
+ testCases.set(envelope.testCase.id, { pickleId: envelope.testCase.pickleId, steps });
111
+ }
112
+ else if (envelope.testCaseStarted) {
113
+ parsed = true;
114
+ started.set(envelope.testCaseStarted.id, envelope.testCaseStarted.testCaseId);
115
+ }
116
+ else if (envelope.testStepFinished) {
117
+ parsed = true;
118
+ const testCaseId = started.get(envelope.testStepFinished.testCaseStartedId);
119
+ const testCase = testCaseId ? testCases.get(testCaseId) : undefined;
120
+ if (!testCase)
121
+ continue;
122
+ if (!testCase.steps.has(envelope.testStepFinished.testStepId))
123
+ continue; // a hook
124
+ const status = envelope.testStepFinished.testStepResult?.status ?? "UNKNOWN";
125
+ const list = statuses.get(testCase.pickleId) ?? [];
126
+ list.push(status);
127
+ statuses.set(testCase.pickleId, list);
128
+ }
129
+ }
130
+ const executedPickleIds = new Set();
131
+ for (const testCaseId of started.values()) {
132
+ const testCase = testCases.get(testCaseId);
133
+ if (testCase)
134
+ executedPickleIds.add(testCase.pickleId);
135
+ }
136
+ const outcomes = [...pickles.values()].map((pickle) => {
137
+ const stepStatuses = statuses.get(pickle.id) ?? [];
138
+ const executed = executedPickleIds.has(pickle.id);
139
+ return {
140
+ id: pickle.id,
141
+ uri: pickle.uri ?? "",
142
+ name: pickle.name ?? "",
143
+ tags: (pickle.tags ?? []).map((t) => String(t?.name ?? "")),
144
+ stepCount: (pickle.steps ?? []).length,
145
+ executed,
146
+ stepStatuses,
147
+ status: executed ? worstStatus(stepStatuses) : "NOT_EXECUTED",
148
+ };
149
+ });
150
+ return {
151
+ pickles: outcomes,
152
+ executed: executedPickleIds.size,
153
+ implementation,
154
+ parsed,
155
+ };
156
+ }
157
+ /**
158
+ * Does this command invoke cucumber-js directly, so the harness can ask it for
159
+ * the message stream?
160
+ *
161
+ * Deliberately narrow. `npm test` may well run Cucumber, and the harness has no
162
+ * way to know — appending a flag to it would either be ignored or break the
163
+ * command. Only a direct invocation is rewritten; every other project declares
164
+ * `message_report` in `harness.config.yaml` and keeps control of its own
165
+ * command.
166
+ */
167
+ function invokesCucumberDirectly(command) {
168
+ return /(^|\s|\/)cucumber-js(\s|$)/.test(String(command || ""));
169
+ }
170
+ /** The same command, told to also write its message stream to `file`. */
171
+ function withMessageReport(command, file) {
172
+ if (/--format[= ]message/.test(command))
173
+ return command;
174
+ return `${command} --format message:${file}`;
175
+ }
176
+ /**
177
+ * Which scenarios in the run belong to the requirement under test.
178
+ *
179
+ * Tags first — `@REQ-001` / `@SCN-001` is the direct statement, and F4 is what
180
+ * makes them common. Falling back to the feature path keeps this useful before
181
+ * F4 lands, since a matrix row already names one file per requirement.
182
+ */
183
+ function pickTargetPickles(run, target) {
184
+ const wanted = [target.requirement, target.scenarioId]
185
+ .filter((t) => Boolean(t))
186
+ .map((t) => `@${t.toLowerCase()}`);
187
+ if (wanted.length > 0) {
188
+ const tagged = run.pickles.filter((p) => p.tags.some((tag) => wanted.includes(tag.toLowerCase())));
189
+ if (tagged.length > 0)
190
+ return tagged;
191
+ }
192
+ const file = String(target.featureFile ?? "").replace(/\\/g, "/");
193
+ if (!file)
194
+ return [];
195
+ return run.pickles.filter((p) => p.uri.replace(/\\/g, "/") === file);
196
+ }
197
+ /**
198
+ * What the message stream says about the gate's claim.
199
+ *
200
+ * Returns `[]` when the stream carried nothing we understood — a project whose
201
+ * command is not Cucumber must not be failed by a reader that did not apply.
202
+ */
203
+ function checkGateRun(run, target) {
204
+ if (!run.parsed)
205
+ return [];
206
+ const found = [];
207
+ const label = target.requirement || target.scenarioId || target.featureFile || "the requirement";
208
+ const mine = pickTargetPickles(run, target);
209
+ if (mine.length === 0) {
210
+ found.push((0, Diagnostic_1.error)(exports.GATE_MESSAGE_CODES.NOT_FOUND, `the run contains no scenario for ${label}. The gate reported success for ` +
211
+ `a suite that never covered it.`, {
212
+ target: target.requirement,
213
+ fix: `Check the filter in the gate command, and that the feature file the ` +
214
+ `matrix declares is the one the runner loads.`,
215
+ }));
216
+ return found;
217
+ }
218
+ for (const pickle of mine) {
219
+ if (!pickle.executed) {
220
+ found.push((0, Diagnostic_1.error)(exports.GATE_MESSAGE_CODES.NOT_EXECUTED, `"${pickle.name}" exists but never ran, so nothing about ${label} was verified.`, {
221
+ target: target.requirement,
222
+ file: pickle.uri,
223
+ fix: "Check the runner's filter and tags.",
224
+ }));
225
+ continue;
226
+ }
227
+ if (pickle.stepCount === 0) {
228
+ found.push((0, Diagnostic_1.error)(exports.GATE_MESSAGE_CODES.NO_STEPS, `"${pickle.name}" ran with no steps, so it passed without testing anything.`, {
229
+ target: target.requirement,
230
+ file: pickle.uri,
231
+ fix: "Write Given / When / Then steps — Gherkin keywords are case-sensitive.",
232
+ }));
233
+ continue;
234
+ }
235
+ if (pickle.status !== "PASSED") {
236
+ found.push((0, Diagnostic_1.error)(exports.GATE_MESSAGE_CODES.NOT_PASSED, `"${pickle.name}" ended ${pickle.status}, not PASSED.`, {
237
+ target: target.requirement,
238
+ file: pickle.uri,
239
+ fix: "Make the scenario pass as written.",
240
+ }));
241
+ }
242
+ }
243
+ // What `filterHint` guessed with a regex over prose, as a number the runner
244
+ // reported. A warning: running more than asked is a smell, not proof of a
245
+ // broken gate — a project may deliberately run its whole suite.
246
+ if (run.executed > mine.length) {
247
+ found.push((0, Diagnostic_1.warning)(exports.GATE_MESSAGE_CODES.RAN_MORE_THAN_ASKED, `the gate asked for ${mine.length} scenario(s) and the runner executed ` +
248
+ `${run.executed}. The filter may not be applying.`, {
249
+ target: target.requirement,
250
+ fix: "A runner config that pins its own paths can override the argument — " +
251
+ "check that config on the base branch, not only on main.",
252
+ }));
253
+ }
254
+ return found;
255
+ }
256
+ //# sourceMappingURL=CucumberMessages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CucumberMessages.js","sourceRoot":"","sources":["../../../../../packages/core/src/domain/CucumberMessages.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;;;AAsDH,sDAgFC;AAYD,0DAEC;AAGD,8CAGC;AAiBD,8CAeC;AAQD,oCAwFC;AAvRD,6CAA8C;AAEjC,QAAA,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,yBAAyB;IACpC,YAAY,EAAE,4BAA4B;IAC1C,QAAQ,EAAE,4BAA4B;IACtC,UAAU,EAAE,0BAA0B;IACtC,mBAAmB,EAAE,0BAA0B;CAChD,CAAC,CAAC;AAyBH,mEAAmE;AACnE,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAE5F,SAAS,WAAW,CAAC,QAA2B;IAC9C,KAAK,MAAM,SAAS,IAAI,aAAa,EAAE,CAAC;QACtC,IAAI,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IACrD,CAAC;IACD,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,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