@velum-labs/routekit-eval-setup 1.3.2 → 1.5.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 (342) hide show
  1. package/dist/adapters/authoring-responses-request.d.ts +5 -0
  2. package/dist/adapters/authoring-responses-request.js +38 -0
  3. package/dist/adapters/evaluation-evidence-freshness.d.ts +7 -0
  4. package/dist/adapters/evaluation-evidence-freshness.js +76 -0
  5. package/dist/adapters/git-task-history.d.ts +67 -0
  6. package/dist/adapters/git-task-history.js +171 -0
  7. package/dist/adapters/integrated-repository-history.d.ts +21 -0
  8. package/dist/adapters/integrated-repository-history.js +175 -0
  9. package/dist/adapters/repository-command-diagnostic.d.ts +8 -0
  10. package/dist/adapters/repository-command-diagnostic.js +46 -0
  11. package/dist/adapters/repository-command-evidence.d.ts +13 -0
  12. package/dist/adapters/repository-command-evidence.js +102 -0
  13. package/dist/adapters/repository-command-runner.d.ts +238 -0
  14. package/dist/adapters/repository-command-runner.js +1483 -0
  15. package/dist/adapters/repository-import-context.d.ts +47 -0
  16. package/dist/adapters/repository-import-context.js +469 -0
  17. package/dist/adapters/repository-node-test-reporter.d.ts +3 -0
  18. package/dist/adapters/repository-node-test-reporter.js +27 -0
  19. package/dist/adapters/repository-review-evidence.d.ts +39 -0
  20. package/dist/adapters/repository-review-evidence.js +632 -0
  21. package/dist/adapters/repository-seed-selection.d.ts +7 -0
  22. package/dist/adapters/repository-seed-selection.js +79 -0
  23. package/dist/adapters/repository-solution-edits.d.ts +49 -0
  24. package/dist/adapters/repository-solution-edits.js +136 -0
  25. package/dist/adapters/repository-vitest-phase-adapter.d.ts +8 -0
  26. package/dist/adapters/repository-vitest-phase-adapter.js +310 -0
  27. package/dist/adapters/repository-vitest-reporter.d.ts +24 -0
  28. package/dist/adapters/repository-vitest-reporter.js +314 -0
  29. package/dist/adapters/strict-authoring-schema.d.ts +5 -0
  30. package/dist/adapters/strict-authoring-schema.js +158 -0
  31. package/dist/adapters/test-discovery.d.ts +30 -0
  32. package/dist/adapters/test-discovery.js +124 -0
  33. package/dist/adapters/typescript-repository-index.d.ts +51 -0
  34. package/dist/adapters/typescript-repository-index.js +226 -0
  35. package/dist/agentic-capabilities-protocol.d.ts +1373 -0
  36. package/dist/agentic-capabilities-protocol.js +786 -0
  37. package/dist/case-checkpoint-store.d.ts +29 -0
  38. package/dist/case-checkpoint-store.js +133 -0
  39. package/dist/case-pipeline-protocol-v2.d.ts +184 -0
  40. package/dist/case-pipeline-protocol-v2.js +193 -0
  41. package/dist/case-pipeline-protocol.d.ts +2626 -0
  42. package/dist/case-pipeline-protocol.js +371 -0
  43. package/dist/effect-api.d.ts +74 -10
  44. package/dist/effect-api.js +56 -6
  45. package/dist/errors.d.ts +31 -0
  46. package/dist/errors.js +10 -0
  47. package/dist/eval-capability-execution-envelope.d.ts +64 -0
  48. package/dist/eval-capability-execution-envelope.js +98 -0
  49. package/dist/eval-capability-policy.d.ts +90 -0
  50. package/dist/eval-capability-policy.js +107 -0
  51. package/dist/eval-event-log.d.ts +140 -0
  52. package/dist/eval-event-log.js +220 -0
  53. package/dist/evaluation-authoring-policy.d.ts +18 -0
  54. package/dist/evaluation-authoring-policy.js +19 -0
  55. package/dist/evaluation-authoring-validation.d.ts +22 -0
  56. package/dist/evaluation-authoring-validation.js +72 -0
  57. package/dist/evaluation-evidence.d.ts +20 -0
  58. package/dist/evaluation-evidence.js +319 -0
  59. package/dist/evaluation-grader-calibration-protocol.d.ts +108 -0
  60. package/dist/evaluation-grader-calibration-protocol.js +80 -0
  61. package/dist/evaluation-grader-calibration.d.ts +18 -0
  62. package/dist/evaluation-grader-calibration.js +334 -0
  63. package/dist/evaluation-grading-policy.d.ts +24 -0
  64. package/dist/evaluation-grading-policy.js +54 -0
  65. package/dist/evaluation-proposal-policy.d.ts +4 -0
  66. package/dist/evaluation-proposal-policy.js +91 -0
  67. package/dist/evaluation-source-retrieval.d.ts +68 -0
  68. package/dist/evaluation-source-retrieval.js +513 -0
  69. package/dist/evaluation-structure-policy.d.ts +29 -0
  70. package/dist/evaluation-structure-policy.js +138 -0
  71. package/dist/index.d.ts +124 -17
  72. package/dist/index.js +69 -11
  73. package/dist/inspection.js +2 -3
  74. package/dist/project-artifacts.d.ts +7 -2
  75. package/dist/project-artifacts.js +49 -136
  76. package/dist/project-authoring.d.ts +66 -5
  77. package/dist/project-authoring.js +783 -109
  78. package/dist/project-contracts.d.ts +419 -84
  79. package/dist/project-contracts.js +160 -52
  80. package/dist/project-store.js +2 -1
  81. package/dist/project-workflow.d.ts +5 -4
  82. package/dist/project-workflow.js +154 -35
  83. package/dist/repository-adversary-protocol.d.ts +64 -0
  84. package/dist/repository-adversary-protocol.js +105 -0
  85. package/dist/repository-behavior-protocol.d.ts +188 -0
  86. package/dist/repository-behavior-protocol.js +202 -0
  87. package/dist/repository-benchmark-protocol.d.ts +487 -0
  88. package/dist/repository-benchmark-protocol.js +96 -0
  89. package/dist/repository-execution-protocol.d.ts +150 -0
  90. package/dist/repository-execution-protocol.js +38 -0
  91. package/dist/repository-fixture-instructions.d.ts +3 -0
  92. package/dist/repository-fixture-instructions.js +91 -0
  93. package/dist/repository-fixture-protocol.d.ts +79 -0
  94. package/dist/repository-fixture-protocol.js +79 -0
  95. package/dist/repository-foundry-plan-protocol.d.ts +118 -0
  96. package/dist/repository-foundry-plan-protocol.js +296 -0
  97. package/dist/repository-foundry-progress-protocol.d.ts +52 -0
  98. package/dist/repository-foundry-progress-protocol.js +52 -0
  99. package/dist/repository-improvement-protocol.d.ts +100 -0
  100. package/dist/repository-improvement-protocol.js +106 -0
  101. package/dist/repository-language-model-protocol.d.ts +43 -0
  102. package/dist/repository-language-model-protocol.js +146 -0
  103. package/dist/repository-oracle-coverage-protocol.d.ts +18 -0
  104. package/dist/repository-oracle-coverage-protocol.js +39 -0
  105. package/dist/repository-oracle-execution-binding.d.ts +27 -0
  106. package/dist/repository-oracle-execution-binding.js +59 -0
  107. package/dist/repository-oracle-protocol.d.ts +230 -0
  108. package/dist/repository-oracle-protocol.js +156 -0
  109. package/dist/repository-oracle-scope-policy.d.ts +22 -0
  110. package/dist/repository-oracle-scope-policy.js +92 -0
  111. package/dist/repository-quality-policy.d.ts +15 -0
  112. package/dist/repository-quality-policy.js +357 -0
  113. package/dist/repository-routing-benchmark-protocol.d.ts +176 -0
  114. package/dist/repository-routing-benchmark-protocol.js +103 -0
  115. package/dist/repository-routing-model-protocol.d.ts +36 -0
  116. package/dist/repository-routing-model-protocol.js +89 -0
  117. package/dist/repository-routing-plan-protocol.d.ts +112 -0
  118. package/dist/repository-routing-plan-protocol.js +58 -0
  119. package/dist/repository-routing-quality-policy.d.ts +9 -0
  120. package/dist/repository-routing-quality-policy.js +191 -0
  121. package/dist/repository-seed-qualification-progress-protocol.d.ts +205 -0
  122. package/dist/repository-seed-qualification-progress-protocol.js +28 -0
  123. package/dist/repository-semantic-calibration-protocol.d.ts +768 -0
  124. package/dist/repository-semantic-calibration-protocol.js +276 -0
  125. package/dist/repository-semantic-calibration.d.ts +163 -0
  126. package/dist/repository-semantic-calibration.js +581 -0
  127. package/dist/repository-specification-contract-facts-protocol.d.ts +224 -0
  128. package/dist/repository-specification-contract-facts-protocol.js +276 -0
  129. package/dist/repository-specification-critique-protocol.d.ts +189 -0
  130. package/dist/repository-specification-critique-protocol.js +103 -0
  131. package/dist/repository-task-family-protocol.d.ts +24 -0
  132. package/dist/repository-task-family-protocol.js +37 -0
  133. package/dist/repository-task-seed-protocol.d.ts +384 -0
  134. package/dist/repository-task-seed-protocol.js +236 -0
  135. package/dist/repository-trajectory-protocol.d.ts +20 -0
  136. package/dist/repository-trajectory-protocol.js +42 -0
  137. package/dist/service.js +1 -1
  138. package/dist/services/adversary/service.d.ts +64 -0
  139. package/dist/services/adversary/service.js +330 -0
  140. package/dist/services/benchmark-compiler/service.d.ts +450 -0
  141. package/dist/services/benchmark-compiler/service.js +9 -0
  142. package/dist/services/budgeted-model/service.d.ts +118 -0
  143. package/dist/services/budgeted-model/service.js +460 -0
  144. package/dist/services/case-authoring/service.d.ts +163 -0
  145. package/dist/services/case-authoring/service.js +1456 -0
  146. package/dist/services/case-finalization/service.d.ts +283 -0
  147. package/dist/services/case-finalization/service.js +370 -0
  148. package/dist/services/case-generation/service.d.ts +619 -0
  149. package/dist/services/case-generation/service.js +2628 -0
  150. package/dist/services/case-pipeline/service.d.ts +31 -0
  151. package/dist/services/case-pipeline/service.js +485 -0
  152. package/dist/services/case-pipeline-v2/service.d.ts +70 -0
  153. package/dist/services/case-pipeline-v2/service.js +477 -0
  154. package/dist/services/command-observability/service.d.ts +13 -0
  155. package/dist/services/command-observability/service.js +3 -0
  156. package/dist/services/dimension-labeling/service.d.ts +77 -0
  157. package/dist/services/dimension-labeling/service.js +188 -0
  158. package/dist/services/eval-candidate/service.d.ts +208 -0
  159. package/dist/services/eval-candidate/service.js +64 -0
  160. package/dist/services/eval-capabilities/service.d.ts +183 -0
  161. package/dist/services/eval-capabilities/service.js +1433 -0
  162. package/dist/services/eval-environment/service.d.ts +173 -0
  163. package/dist/services/eval-environment/service.js +127 -0
  164. package/dist/services/evidence-reconstruction/service.d.ts +36 -0
  165. package/dist/services/evidence-reconstruction/service.js +145 -0
  166. package/dist/services/fixture-builder/service.d.ts +62 -0
  167. package/dist/services/fixture-builder/service.js +36 -0
  168. package/dist/services/fixture-validation/service.d.ts +75 -0
  169. package/dist/services/fixture-validation/service.js +295 -0
  170. package/dist/services/foundry/service.d.ts +831 -0
  171. package/dist/services/foundry/service.js +442 -0
  172. package/dist/services/foundry-progress/service.d.ts +62 -0
  173. package/dist/services/foundry-progress/service.js +149 -0
  174. package/dist/services/foundry-v2/service.d.ts +54 -0
  175. package/dist/services/foundry-v2/service.js +28 -0
  176. package/dist/services/grounded-authoring/service.d.ts +126 -0
  177. package/dist/services/grounded-authoring/service.js +822 -0
  178. package/dist/services/historical-case/service.d.ts +722 -0
  179. package/dist/services/historical-case/service.js +177 -0
  180. package/dist/services/improvement-loop/service.d.ts +59 -0
  181. package/dist/services/improvement-loop/service.js +176 -0
  182. package/dist/services/language-model/service.d.ts +52 -0
  183. package/dist/services/language-model/service.js +194 -0
  184. package/dist/services/oracle-builder/service.d.ts +146 -0
  185. package/dist/services/oracle-builder/service.js +513 -0
  186. package/dist/services/oracle-coverage/service.d.ts +28 -0
  187. package/dist/services/oracle-coverage/service.js +50 -0
  188. package/dist/services/oracle-coverage-witness/service.d.ts +130 -0
  189. package/dist/services/oracle-coverage-witness/service.js +538 -0
  190. package/dist/services/pipeline-challenge/service.d.ts +551 -0
  191. package/dist/services/pipeline-challenge/service.js +427 -0
  192. package/dist/services/pipeline-controls/service.d.ts +130 -0
  193. package/dist/services/pipeline-controls/service.js +483 -0
  194. package/dist/services/pipeline-oracle/service.d.ts +8 -0
  195. package/dist/services/pipeline-oracle/service.js +256 -0
  196. package/dist/services/pipeline-seed/service.d.ts +298 -0
  197. package/dist/services/pipeline-seed/service.js +428 -0
  198. package/dist/services/pipeline-spec/service.d.ts +103 -0
  199. package/dist/services/pipeline-spec/service.js +619 -0
  200. package/dist/services/pipeline-tournament/service.d.ts +258 -0
  201. package/dist/services/pipeline-tournament/service.js +476 -0
  202. package/dist/services/quality-gate/service.d.ts +233 -0
  203. package/dist/services/quality-gate/service.js +136 -0
  204. package/dist/services/repository-bundle/service.d.ts +33 -0
  205. package/dist/services/repository-bundle/service.js +114 -0
  206. package/dist/services/repository-model/service.d.ts +105 -0
  207. package/dist/services/repository-model/service.js +250 -0
  208. package/dist/services/repository-public-artifact/service.d.ts +133 -0
  209. package/dist/services/repository-public-artifact/service.js +330 -0
  210. package/dist/services/routing-benchmark/service.d.ts +362 -0
  211. package/dist/services/routing-benchmark/service.js +96 -0
  212. package/dist/services/specification-critic/service.d.ts +92 -0
  213. package/dist/services/specification-critic/service.js +172 -0
  214. package/dist/services/task-family/service.d.ts +40 -0
  215. package/dist/services/task-family/service.js +55 -0
  216. package/dist/services/task-seed/service.d.ts +906 -0
  217. package/dist/services/task-seed/service.js +1406 -0
  218. package/dist/services/task-specification/service.d.ts +27 -0
  219. package/dist/services/task-specification/service.js +40 -0
  220. package/dist/services/trajectory-policy/service.d.ts +110 -0
  221. package/dist/services/trajectory-policy/service.js +216 -0
  222. package/dist/test/agentic-capabilities-protocol.test.d.ts +1 -0
  223. package/dist/test/agentic-capabilities-protocol.test.js +570 -0
  224. package/dist/test/agentic-capabilities.test.d.ts +1 -0
  225. package/dist/test/agentic-capabilities.test.js +1461 -0
  226. package/dist/test/agentic-environment.test.d.ts +1 -0
  227. package/dist/test/agentic-environment.test.js +213 -0
  228. package/dist/test/case-pipeline-foundation.test.d.ts +1 -0
  229. package/dist/test/case-pipeline-foundation.test.js +535 -0
  230. package/dist/test/case-pipeline-protocol-v2.test.d.ts +1 -0
  231. package/dist/test/case-pipeline-protocol-v2.test.js +124 -0
  232. package/dist/test/case-pipeline-v2.test.d.ts +1 -0
  233. package/dist/test/case-pipeline-v2.test.js +286 -0
  234. package/dist/test/case-pipeline.test.d.ts +1 -0
  235. package/dist/test/case-pipeline.test.js +851 -0
  236. package/dist/test/eval-capability-policy.test.d.ts +1 -0
  237. package/dist/test/eval-capability-policy.test.js +50 -0
  238. package/dist/test/eval-event-log.test.d.ts +1 -0
  239. package/dist/test/eval-event-log.test.js +125 -0
  240. package/dist/test/evaluation-evidence-freshness.test.d.ts +1 -0
  241. package/dist/test/evaluation-evidence-freshness.test.js +44 -0
  242. package/dist/test/evaluation-evidence.test.d.ts +1 -0
  243. package/dist/test/evaluation-evidence.test.js +230 -0
  244. package/dist/test/evaluation-grader-calibration.test.d.ts +1 -0
  245. package/dist/test/evaluation-grader-calibration.test.js +373 -0
  246. package/dist/test/evaluation-proposal-digest.test.d.ts +1 -0
  247. package/dist/test/evaluation-proposal-digest.test.js +187 -0
  248. package/dist/test/evaluation-source-retrieval.test.d.ts +1 -0
  249. package/dist/test/evaluation-source-retrieval.test.js +237 -0
  250. package/dist/test/evaluation-structure-policy.test.d.ts +1 -0
  251. package/dist/test/evaluation-structure-policy.test.js +196 -0
  252. package/dist/test/fixtures/repository-resource-panel.d.ts +39 -0
  253. package/dist/test/fixtures/repository-resource-panel.js +111 -0
  254. package/dist/test/fixtures/vitest-boundary-panel.d.ts +84 -0
  255. package/dist/test/fixtures/vitest-boundary-panel.js +120 -0
  256. package/dist/test/fixtures/vitest-phase-panel.d.ts +135 -0
  257. package/dist/test/fixtures/vitest-phase-panel.js +213 -0
  258. package/dist/test/fixtures/vitest-reporter-results.d.ts +76 -0
  259. package/dist/test/fixtures/vitest-reporter-results.js +94 -0
  260. package/dist/test/grounded-authoring.test.d.ts +1 -0
  261. package/dist/test/grounded-authoring.test.js +565 -0
  262. package/dist/test/integrated-repository-history.test.d.ts +1 -0
  263. package/dist/test/integrated-repository-history.test.js +227 -0
  264. package/dist/test/project-authoring.test.js +593 -43
  265. package/dist/test/project-workflow.test.js +419 -40
  266. package/dist/test/repository-authoring-artifacts.test.d.ts +1 -0
  267. package/dist/test/repository-authoring-artifacts.test.js +185 -0
  268. package/dist/test/repository-bundle.test.d.ts +1 -0
  269. package/dist/test/repository-bundle.test.js +52 -0
  270. package/dist/test/repository-case-generation.test.d.ts +1 -0
  271. package/dist/test/repository-case-generation.test.js +3465 -0
  272. package/dist/test/repository-command-diagnostic.test.d.ts +1 -0
  273. package/dist/test/repository-command-diagnostic.test.js +55 -0
  274. package/dist/test/repository-command-signals.test.d.ts +1 -0
  275. package/dist/test/repository-command-signals.test.js +124 -0
  276. package/dist/test/repository-fixture-scope-coverage.test.d.ts +1 -0
  277. package/dist/test/repository-fixture-scope-coverage.test.js +127 -0
  278. package/dist/test/repository-fixture-validation.test.d.ts +1 -0
  279. package/dist/test/repository-fixture-validation.test.js +362 -0
  280. package/dist/test/repository-foundry-progress.test.d.ts +1 -0
  281. package/dist/test/repository-foundry-progress.test.js +110 -0
  282. package/dist/test/repository-foundry-quality.test.d.ts +1 -0
  283. package/dist/test/repository-foundry-quality.test.js +1138 -0
  284. package/dist/test/repository-import-context.test.d.ts +1 -0
  285. package/dist/test/repository-import-context.test.js +354 -0
  286. package/dist/test/repository-model-authoring.test.d.ts +1 -0
  287. package/dist/test/repository-model-authoring.test.js +544 -0
  288. package/dist/test/repository-model.test.d.ts +1 -0
  289. package/dist/test/repository-model.test.js +2195 -0
  290. package/dist/test/repository-node-test-reporter.test.d.ts +1 -0
  291. package/dist/test/repository-node-test-reporter.test.js +104 -0
  292. package/dist/test/repository-oracle-concurrency.test.d.ts +1 -0
  293. package/dist/test/repository-oracle-concurrency.test.js +542 -0
  294. package/dist/test/repository-oracle-coverage-witness.test.d.ts +1 -0
  295. package/dist/test/repository-oracle-coverage-witness.test.js +511 -0
  296. package/dist/test/repository-oracle-coverage.test.d.ts +1 -0
  297. package/dist/test/repository-oracle-coverage.test.js +168 -0
  298. package/dist/test/repository-oracle-evidence.test.d.ts +1 -0
  299. package/dist/test/repository-oracle-evidence.test.js +185 -0
  300. package/dist/test/repository-oracle-plan.test.d.ts +1 -0
  301. package/dist/test/repository-oracle-plan.test.js +176 -0
  302. package/dist/test/repository-overlay-isolation.test.d.ts +1 -0
  303. package/dist/test/repository-overlay-isolation.test.js +85 -0
  304. package/dist/test/repository-preparation-cache.test.d.ts +1 -0
  305. package/dist/test/repository-preparation-cache.test.js +414 -0
  306. package/dist/test/repository-public-artifact.test.d.ts +1 -0
  307. package/dist/test/repository-public-artifact.test.js +273 -0
  308. package/dist/test/repository-qualification-diagnostics.test.d.ts +1 -0
  309. package/dist/test/repository-qualification-diagnostics.test.js +524 -0
  310. package/dist/test/repository-reference-authoring.test.d.ts +1 -0
  311. package/dist/test/repository-reference-authoring.test.js +1633 -0
  312. package/dist/test/repository-review-evidence-v2.test.d.ts +1 -0
  313. package/dist/test/repository-review-evidence-v2.test.js +183 -0
  314. package/dist/test/repository-review-evidence.test.d.ts +1 -0
  315. package/dist/test/repository-review-evidence.test.js +124 -0
  316. package/dist/test/repository-seed-exclusions.test.d.ts +1 -0
  317. package/dist/test/repository-seed-exclusions.test.js +96 -0
  318. package/dist/test/repository-seed-selection.test.d.ts +1 -0
  319. package/dist/test/repository-seed-selection.test.js +504 -0
  320. package/dist/test/repository-semantic-calibration.test.d.ts +1 -0
  321. package/dist/test/repository-semantic-calibration.test.js +688 -0
  322. package/dist/test/repository-solution-edits.test.d.ts +1 -0
  323. package/dist/test/repository-solution-edits.test.js +377 -0
  324. package/dist/test/repository-specification-budget.test.d.ts +1 -0
  325. package/dist/test/repository-specification-budget.test.js +171 -0
  326. package/dist/test/repository-specification-contract-checkpoint.test.d.ts +1 -0
  327. package/dist/test/repository-specification-contract-checkpoint.test.js +228 -0
  328. package/dist/test/repository-specification-contract-facts.test.d.ts +1 -0
  329. package/dist/test/repository-specification-contract-facts.test.js +177 -0
  330. package/dist/test/repository-trajectory-authoring.test.d.ts +1 -0
  331. package/dist/test/repository-trajectory-authoring.test.js +176 -0
  332. package/dist/test/repository-valid-control-plan.test.d.ts +1 -0
  333. package/dist/test/repository-valid-control-plan.test.js +45 -0
  334. package/dist/test/repository-vitest-phase.test.d.ts +1 -0
  335. package/dist/test/repository-vitest-phase.test.js +848 -0
  336. package/dist/test/repository-vitest-reporter.test.d.ts +1 -0
  337. package/dist/test/repository-vitest-reporter.test.js +158 -0
  338. package/dist/test/repository-workspace-build.test.d.ts +1 -0
  339. package/dist/test/repository-workspace-build.test.js +160 -0
  340. package/dist/test/strict-authoring-schema.test.d.ts +1 -0
  341. package/dist/test/strict-authoring-schema.test.js +169 -0
  342. package/package.json +48 -6
@@ -0,0 +1,47 @@
1
+ import { Effect } from "effect";
2
+ import { type GitTreeSnapshotV1 } from "./git-task-history.js";
3
+ type Source = {
4
+ readonly path: string;
5
+ readonly content: string;
6
+ };
7
+ /**
8
+ * Read complete, bounded local import context from one pinned tree. This is
9
+ * supporting context, not permission to edit a dependency or an assertion that
10
+ * the complete dependency graph has been loaded.
11
+ */
12
+ export declare const readRepositoryLocalImportsV1: (input: {
13
+ readonly snapshot: GitTreeSnapshotV1;
14
+ readonly sources: readonly Source[];
15
+ readonly dependencyContextVersion?: 1 | 2;
16
+ }) => Effect.Effect<{
17
+ commit: string;
18
+ sources: Source[];
19
+ omitted: {
20
+ path: string;
21
+ reason: "depth" | "file-size" | "total-size" | "file-count";
22
+ }[];
23
+ unresolved: {
24
+ from: string;
25
+ specifier: string;
26
+ }[];
27
+ dependencyContextVersion: 1 | 2;
28
+ dependencies: {
29
+ from: string;
30
+ specifier: string;
31
+ symbols: readonly string[] | null;
32
+ resolution: "resolved" | "external" | "unsupported" | "unresolved";
33
+ paths: readonly string[];
34
+ }[];
35
+ } | {
36
+ commit: string;
37
+ sources: Source[];
38
+ omitted: {
39
+ path: string;
40
+ reason: "file-size" | "total-size" | "file-count" | "depth";
41
+ }[];
42
+ unresolved: {
43
+ from: string;
44
+ specifier: string;
45
+ }[];
46
+ }, import("../errors.js").RepositoryFoundryError, never>;
47
+ export {};
@@ -0,0 +1,469 @@
1
+ import { posix } from "node:path";
2
+ import { Effect } from "effect";
3
+ import ts from "typescript";
4
+ import { readGitTreeFileV1 } from "./git-task-history.js";
5
+ import { selectTypeScriptWorkspaceManifestPathsV1 } from "./typescript-repository-index.js";
6
+ const MAXIMUM_BYTES = 64_000;
7
+ const MAXIMUM_FILE_BYTES = 48_000;
8
+ const MAXIMUM_FILES = 16;
9
+ const MAXIMUM_DEPTH = 2;
10
+ const relativeImports = (content) => {
11
+ const reexports = [
12
+ ...content.matchAll(/\bexport\s+(?:type\s+)?(?:\*(?:\s+as\s+\w+)?|\{[^}]*\})\s+from\s*["'](\.{1,2}\/[^"'\\\0]+)["']/gu)
13
+ ];
14
+ return [
15
+ ...content.matchAll(/\b(?:from\s*|import\s*\(\s*|require\s*\(\s*|import\s*)["'](\.{1,2}\/[^"'\\\0]+)["']/gu)
16
+ ].map((match) => ({
17
+ specifier: match[1],
18
+ reexport: reexports.some((entry) => match.index >= entry.index && match.index < entry.index + entry[0].length)
19
+ }));
20
+ };
21
+ const candidates = (from, specifier) => {
22
+ const path = posix.normalize(posix.join(posix.dirname(from), specifier));
23
+ if (path.startsWith("../") || posix.isAbsolute(path) || path.includes("\0"))
24
+ return [];
25
+ const extension = posix.extname(path);
26
+ const base = path.slice(0, -extension.length);
27
+ if (extension === ".js")
28
+ return [`${base}.ts`, `${base}.tsx`, `${base}.d.ts`, path];
29
+ if (extension === ".jsx")
30
+ return [`${base}.tsx`, path];
31
+ if (extension === ".mjs")
32
+ return [`${base}.mts`, `${base}.d.mts`, path];
33
+ if (extension === ".cjs")
34
+ return [`${base}.cts`, `${base}.d.cts`, path];
35
+ if (extension.length > 0)
36
+ return /\.(?:[cm]?[jt]sx?|json)$/u.test(path) ? [path] : [];
37
+ return [
38
+ ...[".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs", ".json"].map((suffix) => `${path}${suffix}`),
39
+ ...[".ts", ".tsx", ".js", ".mjs", ".cjs"].map((suffix) => `${path}/index${suffix}`)
40
+ ];
41
+ };
42
+ const fixturePriority = (path) => /(?:^|\/)(?:test|tests|__tests__|fixtures)(?:\/|$)|(?:fixture|test-helper)/u.test(path) ? 0 : 1;
43
+ // Parse syntax only. A TypeScript program/module resolver would read the current
44
+ // filesystem and installed packages, which must never contaminate pinned context.
45
+ const importReferences = (source, requested) => {
46
+ const file = ts.createSourceFile(source.path, source.content, ts.ScriptTarget.Latest, true);
47
+ const references = [];
48
+ const wanted = requested === undefined ? undefined : new Set(requested);
49
+ const visit = (node) => {
50
+ if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
51
+ const clause = node.importClause;
52
+ const names = clause?.namedBindings;
53
+ const elements = names !== undefined && ts.isNamedImports(names) ? names.elements : [];
54
+ const symbols = clause === undefined || (names !== undefined && ts.isNamespaceImport(names))
55
+ ? undefined
56
+ : [
57
+ ...(clause.name === undefined ? [] : ["default"]),
58
+ ...elements.map((element) => (element.propertyName ?? element.name).text)
59
+ ];
60
+ references.push({
61
+ specifier: node.moduleSpecifier.text,
62
+ reexport: false,
63
+ typeOnly: clause?.isTypeOnly === true ||
64
+ (clause?.name === undefined &&
65
+ elements.length > 0 &&
66
+ elements.every((element) => element.isTypeOnly)),
67
+ symbols
68
+ });
69
+ return;
70
+ }
71
+ if (ts.isExportDeclaration(node) &&
72
+ node.moduleSpecifier !== undefined &&
73
+ ts.isStringLiteral(node.moduleSpecifier)) {
74
+ const clause = node.exportClause;
75
+ if (clause !== undefined && ts.isNamedExports(clause)) {
76
+ const elements = clause.elements.filter((element) => wanted === undefined || wanted.has(element.name.text));
77
+ if (elements.length === 0)
78
+ return;
79
+ references.push({
80
+ specifier: node.moduleSpecifier.text,
81
+ reexport: true,
82
+ typeOnly: node.isTypeOnly || elements.every((element) => element.isTypeOnly),
83
+ symbols: elements.map((element) => (element.propertyName ?? element.name).text)
84
+ });
85
+ }
86
+ else if (clause === undefined || wanted === undefined || wanted.has(clause.name.text)) {
87
+ references.push({
88
+ specifier: node.moduleSpecifier.text,
89
+ reexport: true,
90
+ typeOnly: node.isTypeOnly,
91
+ symbols: clause === undefined ? requested : undefined
92
+ });
93
+ }
94
+ return;
95
+ }
96
+ if (ts.isImportEqualsDeclaration(node) &&
97
+ ts.isExternalModuleReference(node.moduleReference) &&
98
+ node.moduleReference.expression !== undefined &&
99
+ ts.isStringLiteral(node.moduleReference.expression)) {
100
+ references.push({
101
+ specifier: node.moduleReference.expression.text,
102
+ reexport: false,
103
+ typeOnly: node.isTypeOnly,
104
+ symbols: undefined
105
+ });
106
+ return;
107
+ }
108
+ if (ts.isImportTypeNode(node) &&
109
+ ts.isLiteralTypeNode(node.argument) &&
110
+ ts.isStringLiteral(node.argument.literal)) {
111
+ let qualifier = node.qualifier;
112
+ while (qualifier !== undefined && ts.isQualifiedName(qualifier))
113
+ qualifier = qualifier.left;
114
+ references.push({
115
+ specifier: node.argument.literal.text,
116
+ reexport: false,
117
+ typeOnly: true,
118
+ symbols: qualifier === undefined ? undefined : [qualifier.text]
119
+ });
120
+ return;
121
+ }
122
+ if (ts.isCallExpression(node) &&
123
+ (node.expression.kind === ts.SyntaxKind.ImportKeyword ||
124
+ (ts.isIdentifier(node.expression) && node.expression.text === "require")) &&
125
+ node.arguments[0] !== undefined &&
126
+ ts.isStringLiteral(node.arguments[0])) {
127
+ references.push({
128
+ specifier: node.arguments[0].text,
129
+ reexport: false,
130
+ typeOnly: false,
131
+ symbols: undefined
132
+ });
133
+ return;
134
+ }
135
+ ts.forEachChild(node, visit);
136
+ };
137
+ // Imported bindings re-exported locally are still imports, so their defining
138
+ // module is followed even when an alias changes the public name.
139
+ ts.forEachChild(file, visit);
140
+ return references;
141
+ };
142
+ const object = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
143
+ ? value
144
+ : undefined;
145
+ const packageSpecifier = (specifier) => {
146
+ if (specifier.startsWith(".") ||
147
+ specifier.startsWith("/") ||
148
+ specifier.includes(":") ||
149
+ specifier.includes("\\") ||
150
+ specifier.includes("\0") ||
151
+ specifier.split("/").some((part) => part === "" || part === "." || part === ".."))
152
+ return undefined;
153
+ const parts = specifier.split("/");
154
+ const width = specifier.startsWith("@") ? 2 : 1;
155
+ if (parts.length < width)
156
+ return undefined;
157
+ return {
158
+ name: parts.slice(0, width).join("/"),
159
+ subpath: parts.length === width ? "." : `./${parts.slice(width).join("/")}`
160
+ };
161
+ };
162
+ const exportTargetStrings = (value) => {
163
+ if (typeof value === "string")
164
+ return [value];
165
+ if (Array.isArray(value))
166
+ return value.flatMap(exportTargetStrings);
167
+ const conditions = object(value);
168
+ if (conditions === undefined)
169
+ return [];
170
+ // Source and type entries can identify their corresponding implementation.
171
+ // Runtime conditions retain manifest order; unsupported conditions are not guessed.
172
+ return Object.entries(conditions)
173
+ .filter(([condition]) => ["source", "types", "node", "import", "default"].includes(condition))
174
+ .flatMap(([, target]) => exportTargetStrings(target));
175
+ };
176
+ const packageExportTargets = (manifest, subpath) => {
177
+ if (manifest.exports === undefined) {
178
+ return subpath === "."
179
+ ? [manifest.source, manifest.module, manifest.main, "./index.js"]
180
+ .filter((entry) => typeof entry === "string")
181
+ .map((entry) => (entry.startsWith(".") || entry.startsWith("/") ? entry : `./${entry}`))
182
+ : [subpath];
183
+ }
184
+ const exports = object(manifest.exports);
185
+ if (exports === undefined || !Object.keys(exports).some((key) => key.startsWith("."))) {
186
+ return subpath === "." ? exportTargetStrings(manifest.exports) : [];
187
+ }
188
+ if (Object.hasOwn(exports, subpath))
189
+ return exportTargetStrings(exports[subpath]);
190
+ const patterns = Object.keys(exports)
191
+ .filter((key) => key.startsWith("./") && key.split("*").length === 2)
192
+ .sort((left, right) => right.indexOf("*") - left.indexOf("*") || right.length - left.length);
193
+ for (const pattern of patterns) {
194
+ const [prefix, suffix] = pattern.split("*");
195
+ if (!subpath.startsWith(prefix) || !subpath.endsWith(suffix))
196
+ continue;
197
+ const replacement = subpath.slice(prefix.length, subpath.length - suffix.length);
198
+ if (replacement.length === 0)
199
+ continue;
200
+ return exportTargetStrings(exports[pattern]).map((target) => target.replaceAll("*", replacement));
201
+ }
202
+ return [];
203
+ };
204
+ const readWorkspaceImports = Effect.fn("CaseGeneration.readWorkspaceImports")(function* (input) {
205
+ const version = input.dependencyContextVersion ?? 1;
206
+ const maximumBytes = version === 2 ? 96_000 : MAXIMUM_BYTES;
207
+ const maximumFiles = version === 2 ? 24 : MAXIMUM_FILES;
208
+ const files = new Set(input.snapshot.files);
209
+ const contentCache = new Map(input.sources.map((source) => [source.path, source.content]));
210
+ const read = Effect.fnUntraced(function* (path) {
211
+ const cached = contentCache.get(path);
212
+ if (cached !== undefined)
213
+ return cached;
214
+ const content = yield* readGitTreeFileV1({ snapshot: input.snapshot, path });
215
+ contentCache.set(path, content);
216
+ return content;
217
+ });
218
+ const parseObject = (content) => Effect.try({
219
+ try: () => object(JSON.parse(content)),
220
+ catch: () => undefined
221
+ }).pipe(Effect.orElseSucceed(() => undefined));
222
+ const inventory = yield* selectTypeScriptWorkspaceManifestPathsV1(input.snapshot);
223
+ const packages = new Map();
224
+ for (const path of inventory.selectedManifestPaths) {
225
+ const manifest = yield* parseObject(yield* read(path));
226
+ if (manifest === undefined || typeof manifest.name !== "string")
227
+ continue;
228
+ const entry = { root: posix.dirname(path), manifest };
229
+ packages.set(manifest.name, [...(packages.get(manifest.name) ?? []), entry]);
230
+ }
231
+ const roots = new Map();
232
+ const resolveWorkspace = Effect.fnUntraced(function* (specifier) {
233
+ const parsed = packageSpecifier(specifier);
234
+ if (parsed === undefined)
235
+ return [];
236
+ const matches = packages.get(parsed.name);
237
+ // Duplicate package names are ambiguous, not permission to choose one.
238
+ if (matches?.length !== 1)
239
+ return [];
240
+ const pkg = matches[0];
241
+ if (!roots.has(pkg.root)) {
242
+ const path = posix.join(pkg.root, "tsconfig.json");
243
+ const config = files.has(path)
244
+ ? object(ts.parseConfigFileTextToJson(path, yield* read(path)).config)
245
+ : undefined;
246
+ const compiler = object(config?.compilerOptions);
247
+ roots.set(pkg.root, typeof compiler?.rootDir === "string" && typeof compiler.outDir === "string"
248
+ ? { rootDir: compiler.rootDir, outDir: compiler.outDir }
249
+ : undefined);
250
+ }
251
+ const layout = roots.get(pkg.root);
252
+ const resolved = [];
253
+ for (const target of packageExportTargets(pkg.manifest, parsed.subpath)) {
254
+ if (!target.startsWith("./") || target.includes("\\") || target.includes("\0"))
255
+ continue;
256
+ const path = posix.normalize(posix.join(pkg.root, target));
257
+ const within = (candidate, root) => !posix.isAbsolute(candidate) &&
258
+ !candidate.startsWith("../") &&
259
+ (root === "." || candidate === root || candidate.startsWith(`${root}/`));
260
+ if (!within(path, pkg.root))
261
+ continue;
262
+ const possible = [];
263
+ if (layout !== undefined) {
264
+ const outputRoot = posix.normalize(posix.join(pkg.root, layout.outDir));
265
+ const sourceRoot = posix.normalize(posix.join(pkg.root, layout.rootDir));
266
+ if (within(outputRoot, pkg.root) &&
267
+ within(sourceRoot, pkg.root) &&
268
+ within(path, outputRoot)) {
269
+ const sourcePath = posix
270
+ .join(sourceRoot, posix.relative(outputRoot, path))
271
+ .replace(/\.d\.(ts|mts|cts)$/u, ".$1");
272
+ possible.push(...candidates(posix.join(pkg.root, "package.json"), `./${posix.relative(pkg.root, sourcePath)}`));
273
+ }
274
+ }
275
+ possible.push(...candidates(posix.join(pkg.root, "package.json"), target));
276
+ const found = possible.find((candidate) => files.has(candidate));
277
+ if (found !== undefined && !resolved.includes(found))
278
+ resolved.push(found);
279
+ }
280
+ return resolved;
281
+ });
282
+ const seen = new Set(input.sources.map((source) => source.path));
283
+ const sources = [];
284
+ const omitted = new Map();
285
+ const unresolved = new Map();
286
+ const dependencies = new Map();
287
+ const pending = new Map();
288
+ const expanded = new Map();
289
+ let totalBytes = 0;
290
+ const enqueue = Effect.fnUntraced(function* (source, depth, inheritedPriority, requested) {
291
+ for (const { specifier, reexport, typeOnly, symbols } of importReferences(source, requested)) {
292
+ const dependencyKey = `${source.path}\0${specifier}\0${JSON.stringify(symbols ?? null)}`;
293
+ const dependency = { from: source.path, specifier, symbols: symbols ?? null };
294
+ const pkg = packageSpecifier(specifier);
295
+ if (specifier.startsWith("node:") || (pkg !== undefined && !packages.has(pkg.name))) {
296
+ dependencies.set(dependencyKey, { ...dependency, resolution: "external", paths: [] });
297
+ continue;
298
+ }
299
+ const paths = specifier.startsWith(".")
300
+ ? candidates(source.path, specifier)
301
+ .filter((candidate) => files.has(candidate))
302
+ .slice(0, 1)
303
+ : yield* resolveWorkspace(specifier);
304
+ if (paths.length === 0) {
305
+ unresolved.set(`${source.path}\0${specifier}`, { from: source.path, specifier });
306
+ dependencies.set(dependencyKey, {
307
+ ...dependency,
308
+ resolution: specifier.startsWith(".") ? "unresolved" : "unsupported",
309
+ paths: []
310
+ });
311
+ continue;
312
+ }
313
+ dependencies.set(dependencyKey, { ...dependency, resolution: "resolved", paths });
314
+ for (const path of paths) {
315
+ const priority = inheritedPriority === undefined
316
+ ? reexport
317
+ ? 3
318
+ : typeOnly && version === 1
319
+ ? 2
320
+ : 0
321
+ : Math.max(inheritedPriority, typeOnly && version === 1 ? 2 : 0);
322
+ // A named re-export is a facade hop, not a new behavioral dependency.
323
+ // Keep broad unrequested root exports bounded by the original depth rule.
324
+ const dependencyDepth = version === 2 && reexport && requested !== undefined ? depth - 1 : depth;
325
+ if (expanded
326
+ .get(path)
327
+ ?.some((prior) => prior.depth <= dependencyDepth &&
328
+ prior.priority <= priority &&
329
+ (prior.symbols === undefined ||
330
+ (symbols !== undefined &&
331
+ symbols.every((symbol) => prior.symbols.includes(symbol))))))
332
+ continue;
333
+ const prior = pending.get(path);
334
+ pending.set(path, {
335
+ depth: Math.min(prior?.depth ?? dependencyDepth, dependencyDepth),
336
+ priority: Math.min(prior?.priority ?? priority, priority),
337
+ symbols: prior === undefined
338
+ ? symbols
339
+ : prior.symbols === undefined || symbols === undefined
340
+ ? undefined
341
+ : [...new Set([...prior.symbols, ...symbols])].sort()
342
+ });
343
+ }
344
+ }
345
+ });
346
+ for (const source of input.sources)
347
+ yield* enqueue(source, 1);
348
+ while (pending.size > 0) {
349
+ const ordered = [...pending.entries()].sort(([left, a], [right, b]) => a.priority - b.priority ||
350
+ fixturePriority(left) - fixturePriority(right) ||
351
+ a.depth - b.depth ||
352
+ left.localeCompare(right));
353
+ let [path, entry] = ordered[0];
354
+ if (version === 2 &&
355
+ entry.depth <= MAXIMUM_DEPTH &&
356
+ sources.length < maximumFiles &&
357
+ totalBytes < maximumBytes) {
358
+ // Whole large modules must not consume the packet before small type,
359
+ // constructor and error definitions at the same dependency distance.
360
+ const tier = ordered.filter(([candidate, request]) => request.priority === entry.priority &&
361
+ request.depth === entry.depth &&
362
+ fixturePriority(candidate) === fixturePriority(path));
363
+ const sized = yield* Effect.forEach(tier, ([candidate, request]) => Effect.map(read(candidate), (content) => ({
364
+ path: candidate,
365
+ entry: request,
366
+ bytes: seen.has(candidate) ? 0 : Buffer.byteLength(content)
367
+ })), { concurrency: 4 });
368
+ const selected = sized.sort((left, right) => left.bytes - right.bytes || left.path.localeCompare(right.path))[0];
369
+ path = selected.path;
370
+ entry = selected.entry;
371
+ }
372
+ pending.delete(path);
373
+ if (entry.depth > MAXIMUM_DEPTH) {
374
+ if (!seen.has(path))
375
+ omitted.set(path, "depth");
376
+ continue;
377
+ }
378
+ if (!seen.has(path) && sources.length >= maximumFiles) {
379
+ omitted.set(path, "file-count");
380
+ continue;
381
+ }
382
+ const content = yield* read(path);
383
+ const bytes = Buffer.byteLength(content);
384
+ if (!seen.has(path) && bytes > MAXIMUM_FILE_BYTES) {
385
+ omitted.set(path, "file-size");
386
+ continue;
387
+ }
388
+ if (!seen.has(path) && totalBytes + bytes > maximumBytes) {
389
+ omitted.set(path, "total-size");
390
+ continue;
391
+ }
392
+ omitted.delete(path);
393
+ const source = { path, content };
394
+ if (!seen.has(path)) {
395
+ seen.add(path);
396
+ totalBytes += bytes;
397
+ sources.push(source);
398
+ }
399
+ expanded.set(path, [...(expanded.get(path) ?? []), entry]);
400
+ yield* enqueue(source, entry.depth + 1, entry.priority, entry.symbols);
401
+ }
402
+ return {
403
+ commit: input.snapshot.commit,
404
+ sources,
405
+ omitted: [...omitted].map(([path, reason]) => ({ path, reason })),
406
+ unresolved: [...unresolved.values()],
407
+ dependencyContextVersion: version,
408
+ dependencies: [...dependencies.values()]
409
+ };
410
+ });
411
+ /**
412
+ * Read complete, bounded local import context from one pinned tree. This is
413
+ * supporting context, not permission to edit a dependency or an assertion that
414
+ * the complete dependency graph has been loaded.
415
+ */
416
+ export const readRepositoryLocalImportsV1 = Effect.fn("CaseGeneration.readLocalImports")(function* (input) {
417
+ if (input.dependencyContextVersion !== undefined)
418
+ return yield* readWorkspaceImports(input);
419
+ const files = new Set(input.snapshot.files);
420
+ const seen = new Set(input.sources.map((source) => source.path));
421
+ const sources = [];
422
+ const omitted = [];
423
+ const unresolved = [];
424
+ let totalBytes = 0;
425
+ let frontier = [...input.sources];
426
+ for (let depth = 1; frontier.length > 0; depth += 1) {
427
+ const next = new Map();
428
+ for (const source of frontier) {
429
+ for (const { specifier, reexport } of relativeImports(source.content)) {
430
+ const path = candidates(source.path, specifier).find((candidate) => files.has(candidate));
431
+ if (path === undefined) {
432
+ unresolved.push({ from: source.path, specifier });
433
+ }
434
+ else if (!seen.has(path) || next.has(path)) {
435
+ seen.add(path);
436
+ next.set(path, Math.min(next.get(path) ?? 1, reexport ? 1 : 0));
437
+ }
438
+ }
439
+ }
440
+ frontier = [];
441
+ for (const path of [...next.keys()].sort((left, right) => fixturePriority(left) - fixturePriority(right) ||
442
+ next.get(left) - next.get(right) ||
443
+ left.localeCompare(right))) {
444
+ if (depth > MAXIMUM_DEPTH) {
445
+ omitted.push({ path, reason: "depth" });
446
+ continue;
447
+ }
448
+ if (sources.length >= MAXIMUM_FILES) {
449
+ omitted.push({ path, reason: "file-count" });
450
+ continue;
451
+ }
452
+ const content = yield* readGitTreeFileV1({ snapshot: input.snapshot, path });
453
+ const bytes = Buffer.byteLength(content);
454
+ if (bytes > MAXIMUM_FILE_BYTES) {
455
+ omitted.push({ path, reason: "file-size" });
456
+ continue;
457
+ }
458
+ if (totalBytes + bytes > MAXIMUM_BYTES) {
459
+ omitted.push({ path, reason: "total-size" });
460
+ continue;
461
+ }
462
+ totalBytes += bytes;
463
+ const source = { path, content };
464
+ sources.push(source);
465
+ frontier.push(source);
466
+ }
467
+ }
468
+ return { commit: input.snapshot.commit, sources, omitted, unresolved };
469
+ });
@@ -0,0 +1,3 @@
1
+ import type { RepositoryCommandRecipeV1 } from "../repository-behavior-protocol.js";
2
+ /** Node and tsx share the Node test runner; TAP exposes hook versus test-body failures. */
3
+ export declare const repositoryNodeTestArgumentsV1: (recipe: RepositoryCommandRecipeV1) => readonly string[];
@@ -0,0 +1,27 @@
1
+ /** Node and tsx share the Node test runner; TAP exposes hook versus test-body failures. */
2
+ export const repositoryNodeTestArgumentsV1 = (recipe) => {
3
+ const offset = (recipe.executable === "node" || recipe.executable === "tsx")
4
+ ? 0
5
+ : recipe.executable === "corepack" && recipe.args[1] === "exec" &&
6
+ (recipe.args[2] === "node" || recipe.args[2] === "tsx")
7
+ ? 3
8
+ : recipe.executable === "pnpm" && recipe.args[0] === "exec" &&
9
+ (recipe.args[1] === "node" || recipe.args[1] === "tsx")
10
+ ? 2
11
+ : undefined;
12
+ if (offset === undefined || !recipe.args.slice(offset).includes("--test"))
13
+ return recipe.args;
14
+ const args = recipe.args.slice(0, offset);
15
+ args.push("--test-reporter=tap");
16
+ for (let index = offset; index < recipe.args.length; index += 1) {
17
+ const value = recipe.args[index];
18
+ if (value === "--test-reporter" || value === "--test-reporter-destination") {
19
+ index += 1;
20
+ }
21
+ else if (!value.startsWith("--test-reporter=") &&
22
+ !value.startsWith("--test-reporter-destination=")) {
23
+ args.push(value);
24
+ }
25
+ }
26
+ return args;
27
+ };
@@ -0,0 +1,39 @@
1
+ type Json = null | boolean | number | string | Json[] | {
2
+ [key: string]: Json;
3
+ };
4
+ type Node = null | boolean | number | string | readonly ["object", readonly (readonly [string, Node])[]] | readonly ["array", readonly Node[]] | readonly ["text", string];
5
+ type SpliceContext = {
6
+ readonly startLine: number;
7
+ readonly endLine: number;
8
+ readonly immediatelyBefore: string;
9
+ readonly immediatelyAfter: string;
10
+ };
11
+ type Text = readonly ["literal", string] | readonly ["splice", string, number, number, string, SpliceContext];
12
+ export type RepositoryReviewEvidenceV1 = {
13
+ readonly encoding: "routekit-lossless-review-json-v1";
14
+ readonly texts: Readonly<Record<string, Text>>;
15
+ readonly evidence: Node;
16
+ };
17
+ export declare const REPOSITORY_REVIEW_EVIDENCE_INSTRUCTIONS = "The input uses routekit-lossless-review-json-v1.\nDecode evidence before reviewing it. Null, booleans, numbers, and strings represent themselves.\nEvery original object is [\"object\", [[key, encodedValue], ...]], and every original array is\n[\"array\", [encodedValue, ...]]. [\"text\", digest] resolves a string from texts. A text entry is\n[\"literal\", exactString] or [\"splice\", baseDigest, prefixChars, suffixChars, replacement, context].\nFor a splice, retain the first prefixChars and last suffixChars of the literal base string and\ninsert replacement between them. Character counts use JavaScript UTF-16 code units, not UTF-8 bytes.\nThe verified context gives one-based start/end lines in the base and up to 120 characters immediately\nbefore and after the replaced range, so you can locate the changed code without counting characters.\nDigests are SHA-256 of UTF-8 JSON.stringify(exactString). The host verified exact reconstruction.\nAll original fields, source, controls, and evidence are retained. Evidence-inventory paths address\nthe decoded original object; the encoding does not change those paths or their meaning.";
18
+ /** Factor full-file variants without weakening or truncating the review evidence. */
19
+ export declare function encodeRepositoryReviewEvidenceV1(input: unknown, sourceBases: readonly string[]): RepositoryReviewEvidenceV1;
20
+ /** Host-side integrity check; the reviewer receives the same reconstruction rules. */
21
+ export declare function decodeRepositoryReviewEvidenceV1(packet: RepositoryReviewEvidenceV1): Json;
22
+ type CompactNode = null | boolean | number | string | readonly ["r", number, ...CompactNode[]] | readonly ["a", ...CompactNode[]] | readonly ["t", number] | readonly ["s", number] | readonly ["n", number] | readonly ["j", ...CompactNode[]];
23
+ type TextHunk = readonly [number, number, string, SpliceContext];
24
+ type CompactText = Text | readonly ["patch", string, readonly TextHunk[]];
25
+ export type RepositoryReviewEvidenceV2 = {
26
+ readonly encoding: "routekit-lossless-review-json-v2";
27
+ readonly originalDigest: string;
28
+ readonly texts: readonly (readonly [string, CompactText])[];
29
+ readonly shapes: readonly (readonly string[])[];
30
+ readonly strings: readonly string[];
31
+ readonly nodes: readonly CompactNode[];
32
+ readonly evidence: CompactNode;
33
+ };
34
+ export declare const REPOSITORY_REVIEW_EVIDENCE_V2_INSTRUCTIONS = "The input uses routekit-lossless-review-json-v2.\nDecode evidence before reviewing it. Null, booleans, numbers, and strings represent themselves.\n[\"a\", ...items] represents an original array of decoded items. [\"r\", shapeIndex, ...values]\nrepresents an original object: zip shapes[shapeIndex] with the decoded values, in the given order.\nFor example, shapes[0]=[\"solutionId\",\"outcome\"] and [\"r\",0,\"candidate-a\",\"fail\"] represents\n{\"solutionId\":\"candidate-a\",\"outcome\":\"fail\"}. Every original array or object has an explicit tag.\n[\"s\", index] resolves exactly strings[index]. [\"j\", ...parts] concatenates decoded string\nparts without adding or removing spaces or delimiters. These joins factor repetitive diagnostics and evidence paths;\nthe individual outcome, duration, error, and other evidence fields remain available.\n[\"n\", index] resolves exactly nodes[index]. These shared arrays and objects avoid repeating\nidentical fixtures and control overlays across the proposal and executed evidence. A node may\nrefer only to earlier node entries. Every occurrence reconstructs the complete original subtree.\n[\"t\", index] resolves texts[index], a [digest, entry] pair. An entry is [\"literal\", exactString]\nor [\"splice\", baseDigest, prefixChars, suffixChars, replacement, context]. Locate the literal base\nby its digest in texts. Retain its first prefixChars and last suffixChars, inserting replacement\nbetween them. Counts use JavaScript UTF-16 code units. The verified context gives one-based start/end\nlines and up to 120 characters immediately before and after the replacement.\nA [\"patch\", baseDigest, hunks] entry applies separated edits to the exact resolved base string.\nEach hunk is [startChars, endChars, exactReplacement, context]. Offsets are zero-based UTF-16,\nend-exclusive, ordered, nonoverlapping ranges in the ORIGINAL base. Preserve all text between\nranges; insert each replacement once. Context verifies the original source lines and neighboring\ntext. A base may itself be encoded; text dependencies are acyclic and the host validates every digest.\nText digests are SHA-256\nof UTF-8 JSON.stringify(exactString). originalDigest binds the complete decoded original JSON.\nThe host verified exact reconstruction. No source, control, observation, or evidence-inventory entry\nwas omitted. Evidence-inventory paths address the decoded original object, with unchanged meaning.";
35
+ /** Lossless row and string dictionaries keep full observed populations reviewable. */
36
+ export declare function encodeRepositoryReviewEvidenceV2(input: unknown, sourceBases: readonly string[]): RepositoryReviewEvidenceV2;
37
+ /** Reject malformed tables and any change to the complete reconstructed evidence. */
38
+ export declare function decodeRepositoryReviewEvidenceV2(packet: RepositoryReviewEvidenceV2): Json;
39
+ export {};