audit-tools 0.34.42 → 0.35.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 (396) hide show
  1. package/dist/audit/cli/args.d.ts +6 -0
  2. package/dist/audit/cli/args.d.ts.map +1 -1
  3. package/dist/audit/cli/args.js +21 -4
  4. package/dist/audit/cli/args.js.map +1 -1
  5. package/dist/audit/cli/auditStep.d.ts +6 -15
  6. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  7. package/dist/audit/cli/auditStep.js +1 -1
  8. package/dist/audit/cli/auditStep.js.map +1 -1
  9. package/dist/audit/cli/dispatch/hostFanoutGate.d.ts +21 -61
  10. package/dist/audit/cli/dispatch/hostFanoutGate.d.ts.map +1 -1
  11. package/dist/audit/cli/dispatch/hostFanoutGate.js +18 -167
  12. package/dist/audit/cli/dispatch/hostFanoutGate.js.map +1 -1
  13. package/dist/audit/cli/dispatch/packetFilter.d.ts +2 -2
  14. package/dist/audit/cli/dispatch/packetFilter.d.ts.map +1 -1
  15. package/dist/audit/cli/dispatch/packetFilter.js +3 -1
  16. package/dist/audit/cli/dispatch/packetFilter.js.map +1 -1
  17. package/dist/audit/cli/dispatch/quotaPool.d.ts +2 -14
  18. package/dist/audit/cli/dispatch/quotaPool.d.ts.map +1 -1
  19. package/dist/audit/cli/dispatch/quotaPool.js +16 -6
  20. package/dist/audit/cli/dispatch/quotaPool.js.map +1 -1
  21. package/dist/audit/cli/dispatch/tierRouting.d.ts +2 -2
  22. package/dist/audit/cli/dispatch/tokenUsageObservation.d.ts.map +1 -1
  23. package/dist/audit/cli/dispatch/tokenUsageObservation.js +10 -2
  24. package/dist/audit/cli/dispatch/tokenUsageObservation.js.map +1 -1
  25. package/dist/audit/cli/dispatch.d.ts +14 -3
  26. package/dist/audit/cli/dispatch.d.ts.map +1 -1
  27. package/dist/audit/cli/dispatch.js +87 -65
  28. package/dist/audit/cli/dispatch.js.map +1 -1
  29. package/dist/audit/cli/forceSynthesisCommand.d.ts.map +1 -1
  30. package/dist/audit/cli/forceSynthesisCommand.js +9 -1
  31. package/dist/audit/cli/forceSynthesisCommand.js.map +1 -1
  32. package/dist/audit/cli/hybridDispatch.d.ts +4 -9
  33. package/dist/audit/cli/hybridDispatch.d.ts.map +1 -1
  34. package/dist/audit/cli/hybridDispatch.js +1 -1
  35. package/dist/audit/cli/hybridDispatch.js.map +1 -1
  36. package/dist/audit/cli/lineIndex.d.ts +2 -0
  37. package/dist/audit/cli/lineIndex.d.ts.map +1 -1
  38. package/dist/audit/cli/lineIndex.js +4 -0
  39. package/dist/audit/cli/lineIndex.js.map +1 -1
  40. package/dist/audit/cli/nextStepCommand.d.ts +0 -26
  41. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  42. package/dist/audit/cli/nextStepCommand.js +18 -360
  43. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  44. package/dist/audit/cli/nextStepHelpers.d.ts +5 -16
  45. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  46. package/dist/audit/cli/nextStepHelpers.js +27 -157
  47. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  48. package/dist/audit/cli/quotaCommand.d.ts.map +1 -1
  49. package/dist/audit/cli/quotaCommand.js +1 -5
  50. package/dist/audit/cli/quotaCommand.js.map +1 -1
  51. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  52. package/dist/audit/cli/reviewRun.js +58 -23
  53. package/dist/audit/cli/reviewRun.js.map +1 -1
  54. package/dist/audit/cli/rollingAuditDispatch.d.ts +1 -1
  55. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  56. package/dist/audit/cli/semanticReviewStep.js +35 -54
  57. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  58. package/dist/audit/cli/steps.d.ts +4 -4
  59. package/dist/audit/cli/steps.d.ts.map +1 -1
  60. package/dist/audit/cli/steps.js +0 -1
  61. package/dist/audit/cli/steps.js.map +1 -1
  62. package/dist/audit/cli/workPartitionRuntime.d.ts +11 -0
  63. package/dist/audit/cli/workPartitionRuntime.d.ts.map +1 -0
  64. package/dist/audit/cli/workPartitionRuntime.js +39 -0
  65. package/dist/audit/cli/workPartitionRuntime.js.map +1 -0
  66. package/dist/audit/contracts/wrapperResponse.d.ts +6 -6
  67. package/dist/audit/extractors/analyzers/candidates.d.ts.map +1 -1
  68. package/dist/audit/extractors/analyzers/candidates.js +45 -54
  69. package/dist/audit/extractors/analyzers/candidates.js.map +1 -1
  70. package/dist/audit/io/artifacts.d.ts +1 -3
  71. package/dist/audit/io/artifacts.d.ts.map +1 -1
  72. package/dist/audit/io/artifacts.js +0 -3
  73. package/dist/audit/io/artifacts.js.map +1 -1
  74. package/dist/audit/orchestrator/advance.d.ts.map +1 -1
  75. package/dist/audit/orchestrator/advance.js +0 -35
  76. package/dist/audit/orchestrator/advance.js.map +1 -1
  77. package/dist/audit/orchestrator/advanceTypes.d.ts +4 -63
  78. package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
  79. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  80. package/dist/audit/orchestrator/executorRunners.js +9 -12
  81. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  82. package/dist/audit/orchestrator/executors.d.ts +2 -0
  83. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  84. package/dist/audit/orchestrator/executors.js +8 -7
  85. package/dist/audit/orchestrator/executors.js.map +1 -1
  86. package/dist/audit/orchestrator/hostInputPause.d.ts +1 -1
  87. package/dist/audit/orchestrator/hostInputPause.js +1 -1
  88. package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
  89. package/dist/audit/orchestrator/ingestionExecutors.js +4 -1
  90. package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
  91. package/dist/audit/orchestrator/intakeExecutors.d.ts +1 -65
  92. package/dist/audit/orchestrator/intakeExecutors.d.ts.map +1 -1
  93. package/dist/audit/orchestrator/intakeExecutors.js +3 -425
  94. package/dist/audit/orchestrator/intakeExecutors.js.map +1 -1
  95. package/dist/audit/orchestrator/nextStep.d.ts +0 -13
  96. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  97. package/dist/audit/orchestrator/nextStep.js +2 -9
  98. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  99. package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
  100. package/dist/audit/orchestrator/planningExecutors.js +4 -1
  101. package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
  102. package/dist/audit/orchestrator/rollingDispatch.d.ts +1 -1
  103. package/dist/audit/orchestrator/rollingDispatch.d.ts.map +1 -1
  104. package/dist/audit/orchestrator/rollingDispatch.js +5 -4
  105. package/dist/audit/orchestrator/rollingDispatch.js.map +1 -1
  106. package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
  107. package/dist/audit/orchestrator/staleness.js +3 -3
  108. package/dist/audit/orchestrator/staleness.js.map +1 -1
  109. package/dist/audit/orchestrator/state.d.ts +0 -39
  110. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  111. package/dist/audit/orchestrator/state.js +3 -29
  112. package/dist/audit/orchestrator/state.js.map +1 -1
  113. package/dist/audit/orchestrator/synthesisExecutors.d.ts +8 -2
  114. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  115. package/dist/audit/orchestrator/synthesisExecutors.js +7 -5
  116. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  117. package/dist/audit/providers/index.d.ts +12 -6
  118. package/dist/audit/providers/index.d.ts.map +1 -1
  119. package/dist/audit/providers/index.js +24 -14
  120. package/dist/audit/providers/index.js.map +1 -1
  121. package/dist/audit/quota/hostLimits.d.ts +4 -6
  122. package/dist/audit/quota/hostLimits.d.ts.map +1 -1
  123. package/dist/audit/quota/hostLimits.js +5 -8
  124. package/dist/audit/quota/hostLimits.js.map +1 -1
  125. package/dist/audit/reporting/findingIdentity.d.ts +2 -2
  126. package/dist/audit/reporting/findingIdentity.js +2 -2
  127. package/dist/audit/reporting/synthesis.d.ts +7 -1
  128. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  129. package/dist/audit/reporting/synthesis.js +27 -7
  130. package/dist/audit/reporting/synthesis.js.map +1 -1
  131. package/dist/audit/reporting/workBlocks.d.ts +14 -3
  132. package/dist/audit/reporting/workBlocks.d.ts.map +1 -1
  133. package/dist/audit/reporting/workBlocks.js +163 -73
  134. package/dist/audit/reporting/workBlocks.js.map +1 -1
  135. package/dist/audit/types/activeDispatch.d.ts +8 -7
  136. package/dist/audit/types/activeDispatch.d.ts.map +1 -1
  137. package/dist/audit/types/auditState.d.ts +6 -6
  138. package/dist/audit/types/externalAnalyzer.d.ts +6 -6
  139. package/dist/audit/validation/auditResults.d.ts.map +1 -1
  140. package/dist/audit/validation/auditResults.js +6 -1
  141. package/dist/audit/validation/auditResults.js.map +1 -1
  142. package/dist/audit/validation/sessionConfig.d.ts.map +1 -1
  143. package/dist/audit/validation/sessionConfig.js +27 -29
  144. package/dist/audit/validation/sessionConfig.js.map +1 -1
  145. package/dist/remediate/contractPipeline/phaseCut.d.ts +8 -0
  146. package/dist/remediate/contractPipeline/phaseCut.d.ts.map +1 -1
  147. package/dist/remediate/contractPipeline/phaseCut.js +63 -0
  148. package/dist/remediate/contractPipeline/phaseCut.js.map +1 -1
  149. package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts.map +1 -1
  150. package/dist/remediate/contractPipeline/phaseCutArtifact.js +5 -3
  151. package/dist/remediate/contractPipeline/phaseCutArtifact.js.map +1 -1
  152. package/dist/remediate/phases/plan.d.ts.map +1 -1
  153. package/dist/remediate/phases/plan.js +35 -12
  154. package/dist/remediate/phases/plan.js.map +1 -1
  155. package/dist/remediate/providers/index.d.ts +12 -7
  156. package/dist/remediate/providers/index.d.ts.map +1 -1
  157. package/dist/remediate/providers/index.js +24 -15
  158. package/dist/remediate/providers/index.js.map +1 -1
  159. package/dist/remediate/quota/hostLimits.d.ts +4 -6
  160. package/dist/remediate/quota/hostLimits.d.ts.map +1 -1
  161. package/dist/remediate/quota/hostLimits.js +5 -8
  162. package/dist/remediate/quota/hostLimits.js.map +1 -1
  163. package/dist/remediate/steps/contractPipeline.d.ts +6 -2
  164. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  165. package/dist/remediate/steps/contractPipeline.js +90 -6
  166. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  167. package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
  168. package/dist/remediate/steps/contractPipelinePrompts.js +4 -2
  169. package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
  170. package/dist/remediate/steps/dispatch/marshal.d.ts +6 -0
  171. package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -1
  172. package/dist/remediate/steps/dispatch/marshal.js +16 -17
  173. package/dist/remediate/steps/dispatch/marshal.js.map +1 -1
  174. package/dist/remediate/steps/dispatch/waveScheduling.d.ts +7 -15
  175. package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +1 -1
  176. package/dist/remediate/steps/dispatch/waveScheduling.js +26 -19
  177. package/dist/remediate/steps/dispatch/waveScheduling.js.map +1 -1
  178. package/dist/remediate/steps/nextStep.d.ts +6 -8
  179. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  180. package/dist/remediate/steps/nextStep.js +264 -219
  181. package/dist/remediate/steps/nextStep.js.map +1 -1
  182. package/dist/remediate/steps/rollingSession.d.ts +2 -1
  183. package/dist/remediate/steps/rollingSession.d.ts.map +1 -1
  184. package/dist/remediate/steps/rollingSession.js +14 -8
  185. package/dist/remediate/steps/rollingSession.js.map +1 -1
  186. package/dist/remediate/steps/sessionConfigLoad.d.ts +3 -2
  187. package/dist/remediate/steps/sessionConfigLoad.d.ts.map +1 -1
  188. package/dist/remediate/steps/sessionConfigLoad.js +16 -13
  189. package/dist/remediate/steps/sessionConfigLoad.js.map +1 -1
  190. package/dist/remediate/validation/contractPipeline.d.ts +1 -1
  191. package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
  192. package/dist/remediate/validation/contractPipeline.js +7 -1
  193. package/dist/remediate/validation/contractPipeline.js.map +1 -1
  194. package/dist/remediate/validation/contractPipelineGates.d.ts +8 -0
  195. package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
  196. package/dist/remediate/validation/contractPipelineGates.js +92 -8
  197. package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
  198. package/dist/shared/config/resolveSessionConfig.d.ts.map +1 -1
  199. package/dist/shared/config/resolveSessionConfig.js +6 -5
  200. package/dist/shared/config/resolveSessionConfig.js.map +1 -1
  201. package/dist/shared/decompose/workPartition.d.ts +66 -0
  202. package/dist/shared/decompose/workPartition.d.ts.map +1 -0
  203. package/dist/shared/decompose/workPartition.js +523 -0
  204. package/dist/shared/decompose/workPartition.js.map +1 -0
  205. package/dist/shared/dispatch/admissionLoop.d.ts +5 -44
  206. package/dist/shared/dispatch/admissionLoop.d.ts.map +1 -1
  207. package/dist/shared/dispatch/admissionLoop.js +20 -82
  208. package/dist/shared/dispatch/admissionLoop.js.map +1 -1
  209. package/dist/shared/dispatch/coordinator.d.ts +5 -5
  210. package/dist/shared/dispatch/coordinator.d.ts.map +1 -1
  211. package/dist/shared/dispatch/coordinator.js +12 -11
  212. package/dist/shared/dispatch/coordinator.js.map +1 -1
  213. package/dist/shared/dispatch/costRank.d.ts +5 -155
  214. package/dist/shared/dispatch/costRank.d.ts.map +1 -1
  215. package/dist/shared/dispatch/costRank.js +2 -179
  216. package/dist/shared/dispatch/costRank.js.map +1 -1
  217. package/dist/shared/dispatch/dispatchQuotaContract.d.ts +37 -38
  218. package/dist/shared/dispatch/dispatchQuotaContract.d.ts.map +1 -1
  219. package/dist/shared/dispatch/dispatchQuotaContract.js +0 -1
  220. package/dist/shared/dispatch/dispatchQuotaContract.js.map +1 -1
  221. package/dist/shared/dispatch/hybridDispatch.d.ts +6 -2
  222. package/dist/shared/dispatch/hybridDispatch.d.ts.map +1 -1
  223. package/dist/shared/dispatch/hybridDispatch.js +1 -1
  224. package/dist/shared/dispatch/hybridDispatch.js.map +1 -1
  225. package/dist/shared/dispatch/rollingDispatch.d.ts +4 -4
  226. package/dist/shared/dispatch/rollingDispatch.d.ts.map +1 -1
  227. package/dist/shared/dispatch/rollingDispatch.js +13 -11
  228. package/dist/shared/dispatch/rollingDispatch.js.map +1 -1
  229. package/dist/shared/dispatch/unifiedRolling.d.ts +2 -2
  230. package/dist/shared/dispatch/unifiedRolling.d.ts.map +1 -1
  231. package/dist/shared/dispatch/unifiedRolling.js +1 -1
  232. package/dist/shared/dispatch/unifiedRolling.js.map +1 -1
  233. package/dist/shared/engine/obligationEngine.d.ts +2 -2
  234. package/dist/shared/friction/stepBoundaryCapture.d.ts +5 -59
  235. package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
  236. package/dist/shared/friction/stepBoundaryCapture.js +11 -107
  237. package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
  238. package/dist/shared/index.d.ts +16 -17
  239. package/dist/shared/index.d.ts.map +1 -1
  240. package/dist/shared/index.js +11 -14
  241. package/dist/shared/index.js.map +1 -1
  242. package/dist/shared/io/stateDir.d.ts +2 -2
  243. package/dist/shared/io/stateDir.js +2 -2
  244. package/dist/shared/providers/agyProvider.d.ts.map +1 -1
  245. package/dist/shared/providers/agyProvider.js +12 -26
  246. package/dist/shared/providers/agyProvider.js.map +1 -1
  247. package/dist/shared/providers/auditorSources.d.ts +10 -84
  248. package/dist/shared/providers/auditorSources.d.ts.map +1 -1
  249. package/dist/shared/providers/auditorSources.js +42 -267
  250. package/dist/shared/providers/auditorSources.js.map +1 -1
  251. package/dist/shared/providers/dispatchExclusion.d.ts +22 -0
  252. package/dist/shared/providers/dispatchExclusion.d.ts.map +1 -0
  253. package/dist/shared/providers/dispatchExclusion.js +23 -0
  254. package/dist/shared/providers/dispatchExclusion.js.map +1 -0
  255. package/dist/shared/providers/identity.d.ts +2 -66
  256. package/dist/shared/providers/identity.d.ts.map +1 -1
  257. package/dist/shared/providers/identity.js +2 -72
  258. package/dist/shared/providers/identity.js.map +1 -1
  259. package/dist/shared/providers/orchestratorBindings.d.ts +42 -0
  260. package/dist/shared/providers/orchestratorBindings.d.ts.map +1 -0
  261. package/dist/shared/providers/orchestratorBindings.js +30 -0
  262. package/dist/shared/providers/orchestratorBindings.js.map +1 -0
  263. package/dist/shared/providers/providerFactory.d.ts +0 -3
  264. package/dist/shared/providers/providerFactory.d.ts.map +1 -1
  265. package/dist/shared/providers/providerFactory.js +8 -37
  266. package/dist/shared/providers/providerFactory.js.map +1 -1
  267. package/dist/shared/providers/providerPathGuard.d.ts +3 -3
  268. package/dist/shared/providers/providerPathGuard.d.ts.map +1 -1
  269. package/dist/shared/providers/providerPathGuard.js +24 -27
  270. package/dist/shared/providers/providerPathGuard.js.map +1 -1
  271. package/dist/shared/quota/apiPool.d.ts +19 -22
  272. package/dist/shared/quota/apiPool.d.ts.map +1 -1
  273. package/dist/shared/quota/apiPool.js +66 -47
  274. package/dist/shared/quota/apiPool.js.map +1 -1
  275. package/dist/shared/quota/capacity.d.ts +29 -24
  276. package/dist/shared/quota/capacity.d.ts.map +1 -1
  277. package/dist/shared/quota/capacity.js +30 -4
  278. package/dist/shared/quota/capacity.js.map +1 -1
  279. package/dist/shared/quota/codexHostConfig.d.ts +6 -13
  280. package/dist/shared/quota/codexHostConfig.d.ts.map +1 -1
  281. package/dist/shared/quota/codexHostConfig.js +8 -14
  282. package/dist/shared/quota/codexHostConfig.js.map +1 -1
  283. package/dist/shared/quota/fileLock.d.ts +7 -0
  284. package/dist/shared/quota/fileLock.d.ts.map +1 -1
  285. package/dist/shared/quota/fileLock.js +32 -4
  286. package/dist/shared/quota/fileLock.js.map +1 -1
  287. package/dist/shared/quota/hostLimits.d.ts +19 -1
  288. package/dist/shared/quota/hostLimits.d.ts.map +1 -1
  289. package/dist/shared/quota/hostLimits.js +21 -11
  290. package/dist/shared/quota/hostLimits.js.map +1 -1
  291. package/dist/shared/quota/hostPool.d.ts +1 -1
  292. package/dist/shared/quota/hostPool.js +2 -2
  293. package/dist/shared/quota/hostPool.js.map +1 -1
  294. package/dist/shared/quota/limits.d.ts +6 -9
  295. package/dist/shared/quota/limits.d.ts.map +1 -1
  296. package/dist/shared/quota/limits.js +67 -50
  297. package/dist/shared/quota/limits.js.map +1 -1
  298. package/dist/shared/quota/scheduler.d.ts +2 -3
  299. package/dist/shared/quota/scheduler.d.ts.map +1 -1
  300. package/dist/shared/quota/scheduler.js +3 -12
  301. package/dist/shared/quota/scheduler.js.map +1 -1
  302. package/dist/shared/quota/types.d.ts +10 -10
  303. package/dist/shared/quota/types.d.ts.map +1 -1
  304. package/dist/shared/quota/types.js +4 -7
  305. package/dist/shared/quota/types.js.map +1 -1
  306. package/dist/shared/repair/brokeredDispatch.d.ts.map +1 -1
  307. package/dist/shared/repair/brokeredDispatch.js +3 -0
  308. package/dist/shared/repair/brokeredDispatch.js.map +1 -1
  309. package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -1
  310. package/dist/shared/reporting/auditDeliverable.js +1 -0
  311. package/dist/shared/reporting/auditDeliverable.js.map +1 -1
  312. package/dist/shared/rolling/pausedState.d.ts +7 -7
  313. package/dist/shared/rolling/pausedState.js +3 -3
  314. package/dist/shared/tokens.d.ts +2 -5
  315. package/dist/shared/tokens.d.ts.map +1 -1
  316. package/dist/shared/tokens.js +15 -15
  317. package/dist/shared/tokens.js.map +1 -1
  318. package/dist/shared/types/auditorDescriptor.d.ts +3 -2
  319. package/dist/shared/types/auditorDescriptor.d.ts.map +1 -1
  320. package/dist/shared/types/auditorDescriptor.js +3 -2
  321. package/dist/shared/types/auditorDescriptor.js.map +1 -1
  322. package/dist/shared/types/finding.d.ts +80 -0
  323. package/dist/shared/types/finding.d.ts.map +1 -1
  324. package/dist/shared/types/finding.js +17 -0
  325. package/dist/shared/types/finding.js.map +1 -1
  326. package/dist/shared/types/sessionConfig.d.ts +8 -8
  327. package/dist/shared/types/sessionConfig.d.ts.map +1 -1
  328. package/dist/shared/types/sessionConfig.js +1 -1
  329. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  330. package/dist/shared/validation/findingsReport.js +3 -0
  331. package/dist/shared/validation/findingsReport.js.map +1 -1
  332. package/docs/audit-pkg/development.md +3 -2
  333. package/docs/audit-pkg/operator-guide.md +13 -106
  334. package/docs/audit-pkg/product.md +8 -7
  335. package/docs/audit-pkg/release.md +38 -29
  336. package/opencode.json +2 -2
  337. package/package.json +6 -4
  338. package/skills/audit-code/SKILL.md +2 -1
  339. package/skills/audit-code/audit-code.prompt.md +4 -3
  340. package/skills/remediate-code/remediate-code.prompt.md +2 -1
  341. package/dist/audit/cli/providerConfirmationStep.d.ts +0 -106
  342. package/dist/audit/cli/providerConfirmationStep.d.ts.map +0 -1
  343. package/dist/audit/cli/providerConfirmationStep.js +0 -396
  344. package/dist/audit/cli/providerConfirmationStep.js.map +0 -1
  345. package/dist/audit/orchestrator/providerConfirmation.d.ts +0 -25
  346. package/dist/audit/orchestrator/providerConfirmation.d.ts.map +0 -1
  347. package/dist/audit/orchestrator/providerConfirmation.js +0 -60
  348. package/dist/audit/orchestrator/providerConfirmation.js.map +0 -1
  349. package/dist/audit/providers/agyProvider.d.ts +0 -11
  350. package/dist/audit/providers/agyProvider.d.ts.map +0 -1
  351. package/dist/audit/providers/agyProvider.js +0 -18
  352. package/dist/audit/providers/agyProvider.js.map +0 -1
  353. package/dist/audit/providers/claudeCodeProvider.d.ts +0 -11
  354. package/dist/audit/providers/claudeCodeProvider.d.ts.map +0 -1
  355. package/dist/audit/providers/claudeCodeProvider.js +0 -23
  356. package/dist/audit/providers/claudeCodeProvider.js.map +0 -1
  357. package/dist/audit/providers/claudeWorkerProvider.d.ts +0 -10
  358. package/dist/audit/providers/claudeWorkerProvider.d.ts.map +0 -1
  359. package/dist/audit/providers/claudeWorkerProvider.js +0 -15
  360. package/dist/audit/providers/claudeWorkerProvider.js.map +0 -1
  361. package/dist/audit/providers/opencodeProvider.d.ts +0 -2
  362. package/dist/audit/providers/opencodeProvider.d.ts.map +0 -1
  363. package/dist/audit/providers/opencodeProvider.js +0 -7
  364. package/dist/audit/providers/opencodeProvider.js.map +0 -1
  365. package/dist/remediate/providers/agyProvider.d.ts +0 -12
  366. package/dist/remediate/providers/agyProvider.d.ts.map +0 -1
  367. package/dist/remediate/providers/agyProvider.js +0 -19
  368. package/dist/remediate/providers/agyProvider.js.map +0 -1
  369. package/dist/remediate/providers/claudeCodeProvider.d.ts +0 -12
  370. package/dist/remediate/providers/claudeCodeProvider.d.ts.map +0 -1
  371. package/dist/remediate/providers/claudeCodeProvider.js +0 -24
  372. package/dist/remediate/providers/claudeCodeProvider.js.map +0 -1
  373. package/dist/remediate/providers/claudeWorkerProvider.d.ts +0 -11
  374. package/dist/remediate/providers/claudeWorkerProvider.d.ts.map +0 -1
  375. package/dist/remediate/providers/claudeWorkerProvider.js +0 -16
  376. package/dist/remediate/providers/claudeWorkerProvider.js.map +0 -1
  377. package/dist/remediate/providers/opencodeProvider.d.ts +0 -2
  378. package/dist/remediate/providers/opencodeProvider.d.ts.map +0 -1
  379. package/dist/remediate/providers/opencodeProvider.js +0 -7
  380. package/dist/remediate/providers/opencodeProvider.js.map +0 -1
  381. package/dist/shared/providers/providerConfirmation.d.ts +0 -141
  382. package/dist/shared/providers/providerConfirmation.d.ts.map +0 -1
  383. package/dist/shared/providers/providerConfirmation.js +0 -420
  384. package/dist/shared/providers/providerConfirmation.js.map +0 -1
  385. package/dist/shared/providers/proxyCatalog.d.ts +0 -158
  386. package/dist/shared/providers/proxyCatalog.d.ts.map +0 -1
  387. package/dist/shared/providers/proxyCatalog.js +0 -658
  388. package/dist/shared/providers/proxyCatalog.js.map +0 -1
  389. package/dist/shared/providers/sharedProviderConfirmation.d.ts +0 -802
  390. package/dist/shared/providers/sharedProviderConfirmation.d.ts.map +0 -1
  391. package/dist/shared/providers/sharedProviderConfirmation.js +0 -1865
  392. package/dist/shared/providers/sharedProviderConfirmation.js.map +0 -1
  393. package/dist/shared/types/providerConfirmation.d.ts +0 -334
  394. package/dist/shared/types/providerConfirmation.d.ts.map +0 -1
  395. package/dist/shared/types/providerConfirmation.js +0 -35
  396. package/dist/shared/types/providerConfirmation.js.map +0 -1
@@ -1,420 +0,0 @@
1
- import { hasConfiguredOpenAiCompatible, hasConfiguredOpenCode, } from "./providerFactory.js";
2
- import { commandExists, isSelfSpawnBlocked, resolveConversationHostProvider, } from "./providerPathGuard.js";
3
- import { suggestCostOrdering, resolveModelPrice } from "../dispatch/costRank.js";
4
- import { backendIdentity, sourceService } from "./identity.js";
5
- // ---------------------------------------------------------------------------
6
- // Internal helpers
7
- // ---------------------------------------------------------------------------
8
- /**
9
- * Default capability tier for a given provider name.
10
- *
11
- * This is a fallback used only when no session-config override is available.
12
- * Tiers are intentionally coarse and static here; the scheduler discovery
13
- * path (HostModelRosterEntry / DiscoveredRateLimitsInput) is the authoritative
14
- * source of per-model capability at dispatch time.
15
- *
16
- * INV-shared-core-02: provider-name → tier mapping must NOT be a flat lookup
17
- * table that gates dispatch routing. Capability tier on DiscoveredProvider is
18
- * a declared/discoverable input, not an opaque internal enum. This function
19
- * is the single place where a default is applied; all routing uses the
20
- * DispatchModelTier vocabulary on CapacityPool, not this field.
21
- */
22
- function defaultCapabilityTier(name) {
23
- switch (name) {
24
- case "claude-code":
25
- return "frontier";
26
- case "opencode":
27
- case "codex":
28
- case "openai-compatible":
29
- case "subprocess-template":
30
- case "vscode-task":
31
- case "antigravity":
32
- case "agy":
33
- case "claude-worker":
34
- // Proxied non-Claude backend behind the Claude harness — ranks strictly below
35
- // the host tier by default (the operator promotes deliberately; plan §risks).
36
- return "capable";
37
- case "worker-command":
38
- return "unknown";
39
- }
40
- }
41
- const CLI_PROBES = [
42
- {
43
- providerName: "claude-code",
44
- defaultCommand: "claude",
45
- configCommand: (cfg) => cfg.claude_code?.command,
46
- },
47
- {
48
- providerName: "opencode",
49
- defaultCommand: "opencode",
50
- configCommand: (cfg) => cfg.opencode?.command,
51
- },
52
- {
53
- providerName: "codex",
54
- defaultCommand: "codex",
55
- configCommand: (cfg) => cfg.codex?.command,
56
- },
57
- {
58
- providerName: "agy",
59
- defaultCommand: "agy",
60
- configCommand: (cfg) => {
61
- if (cfg.agy?.command)
62
- return cfg.agy.command;
63
- // Gated for July 18, 2026 sunset cleanup: fallback to gemini command
64
- if (commandExists("agy"))
65
- return "agy";
66
- if (commandExists("gemini"))
67
- return "gemini";
68
- return undefined;
69
- },
70
- },
71
- ];
72
- // ---------------------------------------------------------------------------
73
- // Public API
74
- // ---------------------------------------------------------------------------
75
- /**
76
- * Probe PATH for each known CLI and return a DiscoveredProvider entry for each
77
- * detected tool. Session-config `command` overrides decide which binary is probed.
78
- *
79
- * @param sessionConfig - Current session config (may be empty `{}`).
80
- * @param env - Process env snapshot; defaults to `process.env`.
81
- * @param detectCommand - Injectable PATH-detection hook (defaults to the
82
- * single-sourced `commandExists`). Lets tests drive discovery deterministically
83
- * without a real CLI on PATH, so the self-spawn-blocked security obligations are
84
- * testable red-before-green regardless of what is installed in CI.
85
- */
86
- export function discoverProviders(sessionConfig, env = process.env, detectCommand = commandExists) {
87
- const discovered = [];
88
- for (const probe of CLI_PROBES) {
89
- const command = (probe.configCommand(sessionConfig) ?? "").trim() || probe.defaultCommand;
90
- const available = detectCommand(command);
91
- if (!available)
92
- continue;
93
- // PB-1: a bare-PATH opencode (no opencode.* config) is OPT-IN, not an
94
- // eligible auto-dispatch target. Surfacing it here would let it join the
95
- // confirmed pool and be launched unprompted. Only surface opencode when the
96
- // operator has explicitly configured it (opencode.command / opencode.extra_args);
97
- // all other PATH-detected providers are surfaced as before.
98
- if (probe.providerName === "opencode" && !hasConfiguredOpenCode(sessionConfig)) {
99
- continue;
100
- }
101
- // Machine-readable self-spawn-blocked flag, derived from the single-sourced
102
- // guard. A self-spawn-blocked provider is still SURFACED (the operator may
103
- // override) but carries the flag so Gate-0 can EXCLUDE it from the
104
- // dispatchable pool without parsing free text.
105
- const blocked = isSelfSpawnBlocked(probe.providerName, env);
106
- discovered.push({
107
- name: probe.providerName,
108
- command,
109
- capabilityTier: defaultCapabilityTier(probe.providerName),
110
- detected: true,
111
- selfSpawnBlocked: blocked,
112
- });
113
- }
114
- // openai-compatible (NIM / vLLM / LM Studio / …) is an API pool, not a CLI: it
115
- // is config-gated (base_url + model), never PATH-probed, so the CLI loop above
116
- // can't surface it. Surface it here when configured so it joins the confirmed
117
- // pool as a real spill target (INV-QD-14) alongside the PATH-detected CLIs.
118
- if (hasConfiguredOpenAiCompatible(sessionConfig.openai_compatible)) {
119
- discovered.push({
120
- name: "openai-compatible",
121
- command: sessionConfig.openai_compatible?.model,
122
- capabilityTier: defaultCapabilityTier("openai-compatible"),
123
- detected: true,
124
- });
125
- }
126
- return discovered;
127
- }
128
- /**
129
- * Query the rate-limit state from a live provider if the `queryLimits` method
130
- * is available. Returns `null` on timeout/error — never throws.
131
- *
132
- * OBS-9a9091ad: a `queryLimits` rejection was previously swallowed with no
133
- * signal, so a provider whose rate-limit query consistently fails was invisible
134
- * to operators (the sibling CompositeQuotaSource logs the same swallow). Accept
135
- * an optional injectable `log` (mirroring analyzerDeps' injectable-log pattern)
136
- * that is invoked with the provider name + error on the swallowed-error path.
137
- * The contract is unchanged — `log` is optional, the function still never throws
138
- * and still returns null — so existing callers need no change while a caller
139
- * that cares can route the diagnostic into its RunLogger.
140
- */
141
- export async function queryProviderQuota(provider, freshSessionProvider, log) {
142
- if (typeof freshSessionProvider.queryLimits !== "function") {
143
- return null;
144
- }
145
- try {
146
- return await freshSessionProvider.queryLimits(null);
147
- }
148
- catch (error) {
149
- log?.(provider.name, error);
150
- return null;
151
- }
152
- }
153
- /**
154
- * The representative model id a provider is priced/ordered by at Gate-0 (cost-first
155
- * routing; spec/dispatch-quota.md). Only the providers that carry a configured
156
- * model in session config are knowable here — a host-native model roster and a CLI
157
- * backend's model arrive only at the dispatch handshake, so those return `undefined`
158
- * and are priced deterministically at dispatch instead. Never hardcodes a model
159
- * name; reads only operator-supplied config.
160
- */
161
- export function representativeModelId(name, sessionConfig) {
162
- switch (name) {
163
- case "openai-compatible":
164
- return sessionConfig.openai_compatible?.model?.trim() || undefined;
165
- case "codex":
166
- return sessionConfig.codex?.model?.trim() || undefined;
167
- default:
168
- return undefined;
169
- }
170
- }
171
- /** Stable source id (matches `deriveSourcePoolDisplay` / the dispatch id convention). */
172
- function dispatchSourceKey(source) {
173
- return source.id ?? `${source.transport}:${source.model ?? source.endpoint ?? "default"}`;
174
- }
175
- /**
176
- * Internal candidate key for a source in the unified cost ordering. Prefixed so a source's
177
- * operator-set id can never collide with a provider-NAME key or a host `model_id` key in
178
- * the shared position map (they share one keyspace in `resolveFinalCostOrder`) — a collision
179
- * would let one entry's `cost_order` silently overwrite the other's. The prefix is internal
180
- * only; the emitted `source_id` + the operator `cost_order` keyspace are unaffected.
181
- */
182
- const SOURCE_CANDIDATE_KEY_PREFIX = "source::";
183
- function sourceCandidateKey(source) {
184
- return `${SOURCE_CANDIDATE_KEY_PREFIX}${dispatchSourceKey(source)}`;
185
- }
186
- /**
187
- * Resolve the FINAL 0-based cost position for every candidate key. Without an
188
- * operator ordering this is the tool's price-ascending suggestion. With one, the
189
- * operator's `cost_order` wins for the keys it names (dense from 0, unknown keys
190
- * ignored); candidates it omits keep their suggested relative order, appended
191
- * after. Single-sourced so provider pools and host models share one total order.
192
- */
193
- function resolveFinalCostOrder(candidates, operatorOrder) {
194
- const suggested = suggestCostOrdering(candidates);
195
- if (!operatorOrder || operatorOrder.length === 0) {
196
- return new Map(suggested.map((c) => [c.key, c.suggested_order]));
197
- }
198
- const knownKeys = new Set(candidates.map((c) => c.key));
199
- // Display keyspace ≡ match keyspace (backlog: source pools were displayed as
200
- // orderable but silently ignored). A source candidate is keyed
201
- // `source::<id>` internally (collision-proofing against provider names / host
202
- // model ids in this shared position map) but the Gate-0 prompt DISPLAYS it under
203
- // its bare id — so the bare id must match too. An exact candidate key always
204
- // wins the token: a bare alias never shadows a genuine provider/model key, which
205
- // preserves exactly the collision-safety the prefix exists for.
206
- const bareSourceAliases = new Map();
207
- for (const key of knownKeys) {
208
- if (!key.startsWith(SOURCE_CANDIDATE_KEY_PREFIX))
209
- continue;
210
- const bare = key.slice(SOURCE_CANDIDATE_KEY_PREFIX.length);
211
- if (!knownKeys.has(bare) && !bareSourceAliases.has(bare)) {
212
- bareSourceAliases.set(bare, key);
213
- }
214
- }
215
- const seen = new Set();
216
- const orderedNamed = [];
217
- for (const token of operatorOrder) {
218
- const key = knownKeys.has(token) ? token : bareSourceAliases.get(token);
219
- if (key !== undefined && !seen.has(key)) {
220
- seen.add(key);
221
- orderedNamed.push(key);
222
- }
223
- }
224
- const rest = suggested.map((c) => c.key).filter((k) => !seen.has(k));
225
- const finalOrder = [...orderedNamed, ...rest];
226
- return new Map(finalOrder.map((key, index) => [key, index]));
227
- }
228
- /**
229
- * Annotate + order a confirmed pool with cost-first-routing fields, optionally
230
- * applying an operator Gate-0 input. Each provider entry gets its representative
231
- * `model_id`, `blended_price_usd_per_mtok` (or `null` when the dataset can't price
232
- * it), and a `cost_order`. When `input` is absent this is the tool's
233
- * price-ascending SUGGESTION (headless / no-operator path). When present, the
234
- * operator's `cost_order` overrides the suggested positions and each
235
- * `host_models` entry becomes a priced, orderable candidate whose confirmed
236
- * position threads to dispatch by `model_id` via `host_model_cost_order`. Read
237
- * back at dispatch (`resolveConfirmedCostPositions`) as rung 1 of `costRank`.
238
- * Single-sourced so every confirmation site annotates identically.
239
- */
240
- export function annotateConfirmedPool(pool, sessionConfig, input, sources = [], env = process.env) {
241
- const hostModels = input?.host_models ?? [];
242
- // The host roster is by definition the CONVERSATION HOST's own models, so the
243
- // service half of each tier's identity is the resolved host. Resolved HERE (above
244
- // the source fold) because the fold dedups on identity and therefore needs it.
245
- const hostProvider = resolveConversationHostProvider({ sessionConfig, env });
246
- const providerCandidates = pool.map((entry) => ({
247
- key: entry.name,
248
- model: representativeModelId(entry.name, sessionConfig),
249
- }));
250
- // tier is omitted: it only tiebreaks UNPRICED candidates, and HostRosterModel's
251
- // CapabilityTier is a different vocabulary from CostCandidate's DispatchModelTier
252
- // — host models are keyed + priced by model_id, which is what threads to dispatch.
253
- const hostCandidates = hostModels.map((m) => ({
254
- key: m.model_id,
255
- model: m.model_id,
256
- }));
257
- // A source whose model is ALREADY represented by a provider candidate (the legacy
258
- // `openai_compatible` block folds into BOTH the `openai-compatible` provider entry AND
259
- // a `collectDispatchableSources` source) or a host tier is the SAME pool — folding it
260
- // again would double-rank one model_id and let the source position overwrite the
261
- // provider's in the model-keyed dispatch map. Dedup by model_id so each pool is ranked
262
- // once. Repair-proxy sources carry distinct namespaced models, so they're never skipped.
263
- // Dedup on BACKEND IDENTITY, never on the bare model string. A bare-model fold
264
- // drops a source that merely SHARES a model id with a host tier or a configured
265
- // pool on a DIFFERENT service — and since the confirmed set is derived from what
266
- // survives this fold, that source could then never be confirmed: it would delta,
267
- // the operator would confirm it, the fold would drop it again, and it would delta
268
- // forever. (Before the gate key was service-qualified, the same bare-model collapse
269
- // hid this as a silent BYPASS instead — the two are one defect seen from either
270
- // side.) Identity-keyed, only a genuine duplicate folds: the legacy
271
- // `openai_compatible` block, which really is represented twice (once as a provider
272
- // entry, once as a `collectDispatchableSources` source) on ONE service.
273
- const claimedIdentities = new Set();
274
- for (const entry of pool) {
275
- const m = representativeModelId(entry.name, sessionConfig);
276
- if (m)
277
- claimedIdentities.add(backendIdentity(m, entry.name));
278
- }
279
- for (const m of hostModels) {
280
- claimedIdentities.add(backendIdentity(m.model_id, hostProvider));
281
- }
282
- const foldedSources = sources.filter((source) => !claimedIdentities.has(backendIdentity(source.model, sourceService(source))));
283
- // Gate-0 source fold: every remaining dispatchable source pool (explicit sources[] +
284
- // proxy expansion) becomes a ranked candidate, keyed by its stable source id so a
285
- // namespaced `transport/model` never collides with a provider-name key. Each carries its
286
- // declared cost (authoritative; 0 = free) and raw capability rank so the suggestion is
287
- // truthful and the capability tiebreak applies among cost-equal source pools.
288
- const sourceCandidates = foldedSources.map((source) => ({
289
- key: sourceCandidateKey(source),
290
- model: source.model ?? null,
291
- // Price binds to the SERVICE, never the transport: `resolveModelStatics` falls
292
- // through to the cheapest-collision default entry for a provider string the price
293
- // table has never heard of, so passing a transport here (`claude-worker`) silently
294
- // prices a proxied lane at some other vendor's rate.
295
- provider: sourceService(source),
296
- ...(source.cost_per_mtok !== undefined ? { declaredCost: source.cost_per_mtok } : {}),
297
- ...(source.capability_rank != null ? { capabilityRank: source.capability_rank } : {}),
298
- }));
299
- const positions = resolveFinalCostOrder([...providerCandidates, ...hostCandidates, ...sourceCandidates], input?.cost_order);
300
- // Capability-evidence ordering: the operator/LLM answer to the capability gate, over
301
- // the SAME candidate keyspace the cost order uses. Position ⇒ `capability_rank`
302
- // (LOWER = more capable), so the list is most-capable-first. Unlike the cost order
303
- // there is no tool-computed suggestion to fall back to: absent input ⇒ no confirmed
304
- // ranks at all, and pools keep whatever external evidence they carry.
305
- //
306
- // First occurrence wins on a duplicated key — a positional list is the operator's
307
- // ORDERING, and silently re-ranking on a later repeat would make the tail of a
308
- // typo'd list authoritative over its head.
309
- const capabilityPositions = new Map();
310
- (input?.capability_order ?? []).forEach((key, index) => {
311
- if (!capabilityPositions.has(key))
312
- capabilityPositions.set(key, index);
313
- });
314
- const provider_pool = pool.map((entry) => {
315
- const model = representativeModelId(entry.name, sessionConfig);
316
- const order = positions.get(entry.name);
317
- return {
318
- ...entry,
319
- ...(model ? { model_id: model } : {}),
320
- blended_price_usd_per_mtok: model ? resolveModelPrice(model) ?? null : null,
321
- ...(order !== undefined ? { cost_order: order } : {}),
322
- // Keyed on the MODEL, never the provider name: `capability_rank` is read back
323
- // by the model-keyed dispatch join (`readConfirmedCapabilityRanks` →
324
- // `pool.hostModel`), and the delta + prompt both name models. Matching on the
325
- // provider name here would silently drop the operator's answer, leaving the
326
- // delta non-empty ⇒ `PRIORITY[0]` re-prompts the same question forever.
327
- ...(model && capabilityPositions.has(model)
328
- ? { capability_rank: capabilityPositions.get(model) }
329
- : {}),
330
- };
331
- });
332
- // Recorded at the only point the host is known for certain, rather than re-derived
333
- // by a later reader running under a possibly different host.
334
- const host_model_cost_order = hostModels.map((m) => ({
335
- model_id: m.model_id,
336
- provider: hostProvider,
337
- blended_price_usd_per_mtok: resolveModelPrice(m.model_id) ?? null,
338
- cost_order: positions.get(m.model_id) ?? 0,
339
- // A host model is ranked exactly like any other model. The roster carries no
340
- // capability field (HostModelRosterEntrySchema is .strict()), so the confirmed
341
- // order is the ONLY road a host model's rank travels to dispatch.
342
- ...(capabilityPositions.has(m.model_id)
343
- ? { capability_rank: capabilityPositions.get(m.model_id) }
344
- : {}),
345
- }));
346
- const source_pool_cost_order = foldedSources.map((source) => {
347
- const key = sourceCandidateKey(source);
348
- const declared = typeof source.cost_per_mtok === "number" && Number.isFinite(source.cost_per_mtok) && source.cost_per_mtok >= 0
349
- ? source.cost_per_mtok
350
- : undefined;
351
- const price =
352
- // Service, not transport — see the CostCandidate note above.
353
- declared ?? (source.model ? resolveModelPrice(source.model, sourceService(source)) ?? null : null);
354
- return {
355
- source_id: dispatchSourceKey(source),
356
- transport: source.transport,
357
- // Recorded so `confirmedBackendKeys` can reproduce the gate identity the delta
358
- // computes for a proxied lane — see SourcePoolCostEntry.service.
359
- ...(source.service ? { service: source.service } : {}),
360
- ...(source.model ? { model_id: source.model } : {}),
361
- blended_price_usd_per_mtok: price,
362
- price_declared: declared !== undefined,
363
- // External evidence FIRST: a source's own registry/declared rank is
364
- // someone-else-maintained data about the model, so the confirmed ordering only
365
- // fills the gap where none exists. Same precedence the pool constructors apply.
366
- ...(source.capability_rank != null
367
- ? { capability_rank: source.capability_rank }
368
- : source.model && capabilityPositions.has(source.model)
369
- ? { capability_rank: capabilityPositions.get(source.model) }
370
- : {}),
371
- cost_order: positions.get(key) ?? 0,
372
- };
373
- });
374
- return { provider_pool, host_model_cost_order, source_pool_cost_order };
375
- }
376
- /**
377
- * The suggestion-only annotation (no operator input, no host models). Preserved
378
- * for the headless / auto-complete callers that just need the provider pool with
379
- * the tool's price-ascending `cost_order`. Delegates to `annotateConfirmedPool`.
380
- */
381
- export function annotateConfirmedPoolCost(pool, sessionConfig) {
382
- return annotateConfirmedPool(pool, sessionConfig).provider_pool;
383
- }
384
- /**
385
- * Derive the Gate-0 display view of every configured `sessionConfig.sources[]`
386
- * entry (backlog follow-up a). Read-only and additive: mirrors the same
387
- * `sessionConfig.sources` array `collectDispatchableSources` (apiPool.ts) folds
388
- * into dispatch, so what the operator sees at Gate-0 includes every pool that will
389
- * actually route. Order is preserved from the operator-authored config array
390
- * (content-derived, stable — never re-sorted by iteration/readdir order).
391
- */
392
- export function deriveSourcePoolDisplay(sessionConfig) {
393
- return deriveSourcePoolDisplayFromSources(sessionConfig.sources ?? []);
394
- }
395
- /**
396
- * Same display derivation as {@link deriveSourcePoolDisplay} but over an EXPLICIT source
397
- * list — used by the Gate-0 confirmation display so the roster includes the async
398
- * proxy catalog expansion (which is not in `sessionConfig.sources`), matching
399
- * exactly what {@link gatherDispatchableSources} folds into dispatch.
400
- */
401
- export function deriveSourcePoolDisplayFromSources(sources) {
402
- return sources.map((source) => {
403
- const id = source.id ?? `${source.transport}:${source.model ?? source.endpoint ?? "default"}`;
404
- const entry = {
405
- id,
406
- transport: source.transport,
407
- ...(source.model ? { model: source.model } : {}),
408
- ...(source.cost_per_mtok !== undefined
409
- ? { declared_cost_per_mtok: source.cost_per_mtok }
410
- : {}),
411
- };
412
- if (source.cost_per_mtok === undefined) {
413
- entry.blended_price_usd_per_mtok = source.model
414
- ? (resolveModelPrice(source.model) ?? null)
415
- : null;
416
- }
417
- return entry;
418
- });
419
- }
420
- //# sourceMappingURL=providerConfirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"providerConfirmation.js","sourceRoot":"","sources":["../../../src/shared/providers/providerConfirmation.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,+BA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5B,MAAM,EAAE,GACN,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,IAAI,SAAS,EAAE,CAAC;QACrF,MAAM,KAAK,GAA2B;YACpC,EAAE;YACF,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,GAAG,CAAC,MAAM,CAAC,aAAa,KAAK,SAAS;gBACpC,CAAC,CAAC,EAAE,sBAAsB,EAAE,MAAM,CAAC,aAAa,EAAE;gBAClD,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;QACF,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,KAAK,CAAC,0BAA0B,GAAG,MAAM,CAAC,KAAK;gBAC7C,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;gBAC3C,CAAC,CAAC,IAAI,CAAC;QACX,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,158 +0,0 @@
1
- import type { DispatchableSource } from "../types/sessionConfig.js";
2
- /**
3
- * The POPULATE cache for the proxy lane: discovered via `GET <proxy>/v1/models` +
4
- * `GET <proxy>/model/info` (OpenAI-compatible surfaces) expanded into ready-to-fold
5
- * `claude-worker` {@link DispatchableSource}s, written once per populate (Gate-0 build
6
- * / explicit refresh) and READ by resolve — never fetched mid-resolve.
7
- *
8
- * Named `catalog-cache.json`, NOT the `catalog-<auditor-id>.json` the reserved-name
9
- * comment at `auditorSources.ts` anticipates: populate/resolve run on the AMBIENT
10
- * path, where no auditor id exists to key on. The cache is machine-level like the
11
- * declaration beside it — and it is a CACHE of live discovery state, not resolved
12
- * per-auditor capability, so an auditor-id key would assert an isolation the data
13
- * doesn't have. Per-auditor never-inherit still holds: every resolve re-proves proxy
14
- * REACH itself; the cache only supplies the expansion.
15
- */
16
- export declare const PROXY_CATALOG_FILENAME = "catalog-cache.json";
17
- /** Top-K models expanded per backend provider when the operator declares no `top_k`. */
18
- export declare const DEFAULT_PROXY_TOP_K = 3;
19
- /** Timeout (ms) for populate-time model verification probes. */
20
- export declare const POPULATE_PROBE_TIMEOUT_MS = 3000;
21
- /** Concurrency limit for populate-time model verification probes. */
22
- export declare const POPULATE_PROBE_CONCURRENCY = 4;
23
- /**
24
- * A same-endpoint cache younger than this skips the registry fetch + probes
25
- * entirely (see the freshness short-circuit in {@link populateProxyCatalog}).
26
- * Refresh THROTTLE — how often we are willing to PAY for a refresh, which is a
27
- * different question from how long an unrefreshed cache may still be believed
28
- * ({@link PROXY_CATALOG_MAX_READ_AGE_MS}). The two thresholds share one age
29
- * derivation and nothing else.
30
- */
31
- export declare const POPULATE_CACHE_FRESH_TTL_MS: number;
32
- /**
33
- * Past this age a cache is returned STALE by {@link readProxyCatalog} — the
34
- * expansion still travels, with a verdict attached, so the caller decides rather
35
- * than consuming an unbounded-age cache blind.
36
- *
37
- * A day: comfortably longer than any single run (a mid-run flip to stale would be
38
- * churn, not signal), and short enough that a roster the operator changed — a model
39
- * added to or dropped from the proxy config — cannot go unnoticed indefinitely.
40
- * The cache is machine-global and tool-written, so being wrong here costs one
41
- * repopulate, never data.
42
- */
43
- export declare const PROXY_CATALOG_MAX_READ_AGE_MS: number;
44
- /** Resolve the populate-cache path for this machine (state dir via `io/stateDir.ts`). */
45
- export declare function resolveProxyCatalogPath(homeDir?: string): string;
46
- /**
47
- * Shape version of the on-disk cache. Bump whenever a written entry's meaning changes,
48
- * so a cache written by older code degrades to "absent" rather than being read under
49
- * new semantics. The cache is tool-written and fully regenerable, so degrading is free —
50
- * `readProxyCatalog` returns null, and `populateProxyCatalogIfMissing` then repopulates.
51
- *
52
- * v2: entries no longer carry a tool-stamped `id`. A v1 entry does, and since `id` now
53
- * outranks the `service` derivation in `dispatchableSourceId`, reading one under v2
54
- * semantics would key a proxied lane to `claude-worker:<service>/<model>` instead of
55
- * `<service>/<model>` — silently splitting it from the direct lane to the same backend
56
- * and reopening the double-grant boundary.
57
- */
58
- export declare const PROXY_CATALOG_VERSION = 2;
59
- /** The on-disk cache shape: the expansion + when it was fetched. */
60
- export interface ProxyCatalog {
61
- /** Shape version — see {@link PROXY_CATALOG_VERSION}. Absent ⇒ pre-versioned (v1). */
62
- version: number;
63
- /**
64
- * ISO timestamp of the populate fetch. REQUIRED to be parseable — the read-side
65
- * age rule is derived from it, and an age derived from a substituted default
66
- * would launder a corrupt file into a fresh-looking one.
67
- */
68
- fetched_at: string;
69
- /** The proxy endpoint the registry was fetched from. */
70
- endpoint: string;
71
- /** Expanded `claude-worker` sources, ready to fold into the dispatch pool. */
72
- sources: DispatchableSource[];
73
- }
74
- /**
75
- * The cache as READ: the persisted shape plus the read-time age verdict.
76
- *
77
- * Staleness is DERIVED at read, never persisted — a stored flag would age into a lie
78
- * the moment the clock moved past it. A stale cache is returned, not withheld: the
79
- * expansion is the caller's to keep (dropping it would surface as "cache absent, run
80
- * the populate", which sends the operator after a file that is right there), and it is
81
- * not thrown either (the resolve path must not be failable by an old file).
82
- *
83
- * `stale_reason` rides the `stale: true` branch so it cannot be read without branching
84
- * on the verdict, and so every caller reports one wording instead of composing its own.
85
- */
86
- export type ProxyCatalogRead = ProxyCatalog & {
87
- /** Cache age at read time, ms. Negative ⇒ stamped ahead of this machine's clock. */
88
- age_ms: number;
89
- } & ({
90
- stale: false;
91
- stale_reason?: undefined;
92
- } | {
93
- stale: true;
94
- stale_reason: string;
95
- });
96
- export interface PopulateProxyCatalogOptions {
97
- /** The proxy base url (`GET <endpoint>/v1/models`, `GET <endpoint>/model/info`). */
98
- endpoint: string;
99
- /** Models expanded per backend provider (declared `proxy.top_k`); default {@link DEFAULT_PROXY_TOP_K}. */
100
- topK?: number;
101
- /**
102
- * Operator-declared blended $/Mtok for the proxied lane (`proxy.cost_per_mtok`,
103
- * the free-to-operator axis). WINS over any advert price.
104
- */
105
- costPerMtok?: number;
106
- /** Env var holding the proxy's master key when authentication is required. */
107
- apiKeyEnv?: string;
108
- /** Injectable fetch (tests); defaults to global fetch. */
109
- fetchImpl?: typeof fetch;
110
- /** Home dir override for the cache path (tests). */
111
- homeDir?: string;
112
- /** Clock (tests); defaults to `Date.now`-based ISO. */
113
- now?: () => Date;
114
- }
115
- export interface PopulateProxyCatalogResult {
116
- /** The expanded sources (also what was written when `written` is true). */
117
- sources: DispatchableSource[];
118
- /** Whether the cache file was (re)written. False only when the fetch itself failed. */
119
- written: boolean;
120
- /** Operator-facing explanation when the registry could not be fetched/parsed. */
121
- reason?: string;
122
- /** Models dropped during probe verification, with reasons. */
123
- dropped: Array<{
124
- id: string;
125
- reason: string;
126
- }>;
127
- }
128
- /**
129
- * POPULATE: discover and expand models from an OpenAI-compatible proxy
130
- * (`GET <endpoint>/v1/models` + `GET <endpoint>/model/info`) into
131
- * ready-to-fold `claude-worker` sources, then write to the machine-level cache.
132
- * Network-bound and cacheable — runs at Gate-0 build / explicit refresh, NEVER
133
- * inside `resolveAmbientSources` (which only READS via {@link readProxyCatalog}).
134
- * Never throws: a failed fetch returns `{written:false, reason}` and leaves any
135
- * prior cache untouched; an empty discovery WRITES an empty expansion (fresh
136
- * knowledge — resolve reports the lane unexpanded with a reason).
137
- */
138
- export declare function populateProxyCatalog(options: PopulateProxyCatalogOptions): Promise<PopulateProxyCatalogResult>;
139
- export interface ReadProxyCatalogDeps {
140
- /** Home dir override for the cache path (tests). */
141
- homeDir?: string;
142
- /** Raw cache reader (tests inject); defaults to reading the cache file. */
143
- readCatalogFile?: (path: string) => string | null;
144
- /** Clock (tests); defaults to `new Date()`. Fixes the age rule's reference point. */
145
- now?: () => Date;
146
- }
147
- /**
148
- * READ the populate cache, with the read-side age rule applied: every result carries
149
- * `age_ms` and a `stale` verdict against {@link PROXY_CATALOG_MAX_READ_AGE_MS}, so an
150
- * old cache reaches its caller labelled rather than indistinguishable from a fresh one.
151
- * Degrades to `null` on absent / unparseable / structurally-invalid content — never
152
- * throws (same bar as `readSourceDeclaration`: the resolve path must not be failable by
153
- * a bad file). Cached sources are held to the shared source validator, so a hand-edited
154
- * or version-skewed cache degrades to "no cache" rather than admitting a half-checked
155
- * pool.
156
- */
157
- export declare function readProxyCatalog(deps?: ReadProxyCatalogDeps): ProxyCatalogRead | null;
158
- //# sourceMappingURL=proxyCatalog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxyCatalog.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/proxyCatalog.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAUrC,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,QAAc,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,QAAmB,CAAC;AAE9D,yFAAyF;AACzF,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED;;;;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