audit-tools 0.39.15 → 0.41.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 (1107) hide show
  1. package/README.md +28 -29
  2. package/dist/audit/cli/args.d.ts +2 -57
  3. package/dist/audit/cli/args.d.ts.map +1 -1
  4. package/dist/audit/cli/args.js +16 -250
  5. package/dist/audit/cli/args.js.map +1 -1
  6. package/dist/audit/cli/auditStep.d.ts +9 -6
  7. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  8. package/dist/audit/cli/auditStep.js +32 -144
  9. package/dist/audit/cli/auditStep.js.map +1 -1
  10. package/dist/audit/cli/cleanup.js +4 -4
  11. package/dist/audit/cli/cleanup.js.map +1 -1
  12. package/dist/audit/cli/cliHelpers.d.ts +1 -10
  13. package/dist/audit/cli/cliHelpers.d.ts.map +1 -1
  14. package/dist/audit/cli/cliHelpers.js +1 -10
  15. package/dist/audit/cli/cliHelpers.js.map +1 -1
  16. package/dist/audit/cli/conceptualDispatch.d.ts +11 -32
  17. package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
  18. package/dist/audit/cli/conceptualDispatch.js +91 -72
  19. package/dist/audit/cli/conceptualDispatch.js.map +1 -1
  20. package/dist/audit/cli/confirmIntentStep.js +3 -3
  21. package/dist/audit/cli/confirmIntentStep.js.map +1 -1
  22. package/dist/audit/cli/dispatch/hostHandoff.d.ts +86 -0
  23. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -0
  24. package/dist/audit/cli/dispatch/hostHandoff.js +616 -0
  25. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -0
  26. package/dist/audit/cli/dispatch/packetFilter.d.ts +12 -86
  27. package/dist/audit/cli/dispatch/packetFilter.d.ts.map +1 -1
  28. package/dist/audit/cli/dispatch/packetFilter.js +6 -161
  29. package/dist/audit/cli/dispatch/packetFilter.js.map +1 -1
  30. package/dist/audit/cli/dispatch.d.ts +7 -115
  31. package/dist/audit/cli/dispatch.d.ts.map +1 -1
  32. package/dist/audit/cli/dispatch.js +7 -711
  33. package/dist/audit/cli/dispatch.js.map +1 -1
  34. package/dist/audit/cli/envelope.d.ts +4 -20
  35. package/dist/audit/cli/envelope.d.ts.map +1 -1
  36. package/dist/audit/cli/envelope.js +5 -33
  37. package/dist/audit/cli/envelope.js.map +1 -1
  38. package/dist/audit/cli/fanoutLanes.d.ts +47 -11
  39. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  40. package/dist/audit/cli/fanoutLanes.js +15 -7
  41. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  42. package/dist/audit/cli/forceSynthesisCommand.d.ts +3 -16
  43. package/dist/audit/cli/forceSynthesisCommand.d.ts.map +1 -1
  44. package/dist/audit/cli/forceSynthesisCommand.js +3 -74
  45. package/dist/audit/cli/forceSynthesisCommand.js.map +1 -1
  46. package/dist/audit/cli/laneSubmissions.d.ts +241 -0
  47. package/dist/audit/cli/laneSubmissions.d.ts.map +1 -0
  48. package/dist/audit/cli/laneSubmissions.js +438 -0
  49. package/dist/audit/cli/laneSubmissions.js.map +1 -0
  50. package/dist/audit/cli/laneValidators.d.ts +65 -0
  51. package/dist/audit/cli/laneValidators.d.ts.map +1 -0
  52. package/dist/audit/cli/laneValidators.js +145 -0
  53. package/dist/audit/cli/laneValidators.js.map +1 -0
  54. package/dist/audit/cli/lineIndex.d.ts.map +1 -1
  55. package/dist/audit/cli/lineIndex.js +4 -3
  56. package/dist/audit/cli/lineIndex.js.map +1 -1
  57. package/dist/audit/cli/nextStepCommand.d.ts +1 -1
  58. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  59. package/dist/audit/cli/nextStepCommand.js +153 -382
  60. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  61. package/dist/audit/cli/nextStepHelpers.d.ts +74 -116
  62. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  63. package/dist/audit/cli/nextStepHelpers.js +421 -667
  64. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  65. package/dist/audit/cli/prompts.d.ts +2 -67
  66. package/dist/audit/cli/prompts.d.ts.map +1 -1
  67. package/dist/audit/cli/prompts.js +33 -304
  68. package/dist/audit/cli/prompts.js.map +1 -1
  69. package/dist/audit/cli/recoverSubmissionCommand.d.ts +16 -0
  70. package/dist/audit/cli/recoverSubmissionCommand.d.ts.map +1 -0
  71. package/dist/audit/cli/recoverSubmissionCommand.js +73 -0
  72. package/dist/audit/cli/recoverSubmissionCommand.js.map +1 -0
  73. package/dist/audit/cli/reviewRun.d.ts +6 -35
  74. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  75. package/dist/audit/cli/reviewRun.js +78 -172
  76. package/dist/audit/cli/reviewRun.js.map +1 -1
  77. package/dist/audit/cli/semanticReviewStep.d.ts +8 -26
  78. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  79. package/dist/audit/cli/semanticReviewStep.js +95 -171
  80. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  81. package/dist/audit/cli/statusCommand.d.ts.map +1 -1
  82. package/dist/audit/cli/statusCommand.js +0 -16
  83. package/dist/audit/cli/statusCommand.js.map +1 -1
  84. package/dist/audit/cli/steps.d.ts +112 -40
  85. package/dist/audit/cli/steps.d.ts.map +1 -1
  86. package/dist/audit/cli/steps.js +14 -0
  87. package/dist/audit/cli/steps.js.map +1 -1
  88. package/dist/audit/cli/validateCommand.d.ts.map +1 -1
  89. package/dist/audit/cli/validateCommand.js +12 -37
  90. package/dist/audit/cli/validateCommand.js.map +1 -1
  91. package/dist/audit/cli.d.ts.map +1 -1
  92. package/dist/audit/cli.js +6 -46
  93. package/dist/audit/cli.js.map +1 -1
  94. package/dist/audit/contracts/workerSchemas.d.ts +138 -195
  95. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  96. package/dist/audit/contracts/workerSchemas.js +2 -41
  97. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  98. package/dist/audit/contracts/wrapperResponse.d.ts +61 -71
  99. package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
  100. package/dist/audit/contracts/wrapperResponse.js +7 -9
  101. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  102. package/dist/audit/io/artifacts.d.ts +14 -10
  103. package/dist/audit/io/artifacts.d.ts.map +1 -1
  104. package/dist/audit/io/artifacts.js +34 -12
  105. package/dist/audit/io/artifacts.js.map +1 -1
  106. package/dist/audit/io/runArtifactTypes.d.ts +4 -6
  107. package/dist/audit/io/runArtifactTypes.d.ts.map +1 -1
  108. package/dist/audit/io/runArtifacts.d.ts +3 -23
  109. package/dist/audit/io/runArtifacts.d.ts.map +1 -1
  110. package/dist/audit/io/runArtifacts.js +18 -170
  111. package/dist/audit/io/runArtifacts.js.map +1 -1
  112. package/dist/audit/orchestrator/advance.js +4 -4
  113. package/dist/audit/orchestrator/advance.js.map +1 -1
  114. package/dist/audit/orchestrator/advanceTypes.d.ts +2 -6
  115. package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
  116. package/dist/audit/orchestrator/designReviewPrompt.d.ts +0 -14
  117. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  118. package/dist/audit/orchestrator/designReviewPrompt.js +1 -59
  119. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  120. package/dist/audit/orchestrator/executorRunners.d.ts +2 -2
  121. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  122. package/dist/audit/orchestrator/executorRunners.js +5 -15
  123. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  124. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  125. package/dist/audit/orchestrator/executors.js +1 -9
  126. package/dist/audit/orchestrator/executors.js.map +1 -1
  127. package/dist/audit/orchestrator/fileAnchors.js +1 -1
  128. package/dist/audit/orchestrator/fileAnchors.js.map +1 -1
  129. package/dist/audit/orchestrator/graphEdgeCache.js +1 -1
  130. package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
  131. package/dist/audit/orchestrator/ingestionExecutors.js +37 -8
  132. package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
  133. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +2 -19
  134. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
  135. package/dist/audit/orchestrator/intentCheckpointExecutor.js +0 -64
  136. package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
  137. package/dist/audit/orchestrator/intentEquivalenceExecutor.d.ts +3 -6
  138. package/dist/audit/orchestrator/intentEquivalenceExecutor.d.ts.map +1 -1
  139. package/dist/audit/orchestrator/intentEquivalenceExecutor.js +4 -7
  140. package/dist/audit/orchestrator/intentEquivalenceExecutor.js.map +1 -1
  141. package/dist/audit/orchestrator/intentInterpreter.d.ts +1 -1
  142. package/dist/audit/orchestrator/partitionTaskGraph.d.ts +11 -43
  143. package/dist/audit/orchestrator/partitionTaskGraph.d.ts.map +1 -1
  144. package/dist/audit/orchestrator/partitionTaskGraph.js +48 -101
  145. package/dist/audit/orchestrator/partitionTaskGraph.js.map +1 -1
  146. package/dist/audit/orchestrator/pendingTasks.d.ts +5 -7
  147. package/dist/audit/orchestrator/pendingTasks.d.ts.map +1 -1
  148. package/dist/audit/orchestrator/pendingTasks.js +4 -2
  149. package/dist/audit/orchestrator/pendingTasks.js.map +1 -1
  150. package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
  151. package/dist/audit/orchestrator/planningExecutors.js +18 -21
  152. package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
  153. package/dist/audit/orchestrator/requeueCommand.d.ts +6 -6
  154. package/dist/audit/orchestrator/resultBaseline.d.ts +4 -3
  155. package/dist/audit/orchestrator/resultBaseline.d.ts.map +1 -1
  156. package/dist/audit/orchestrator/resultBaseline.js +4 -3
  157. package/dist/audit/orchestrator/resultBaseline.js.map +1 -1
  158. package/dist/audit/orchestrator/reviewPacketGraph.d.ts +1 -2
  159. package/dist/audit/orchestrator/reviewPacketGraph.d.ts.map +1 -1
  160. package/dist/audit/orchestrator/reviewPacketGraph.js +2 -6
  161. package/dist/audit/orchestrator/reviewPacketGraph.js.map +1 -1
  162. package/dist/audit/orchestrator/reviewPacketGraphEdges.d.ts +0 -2
  163. package/dist/audit/orchestrator/reviewPacketGraphEdges.d.ts.map +1 -1
  164. package/dist/audit/orchestrator/reviewPacketGraphEdges.js +2 -65
  165. package/dist/audit/orchestrator/reviewPacketGraphEdges.js.map +1 -1
  166. package/dist/audit/orchestrator/reviewPacketSizing.d.ts +0 -1
  167. package/dist/audit/orchestrator/reviewPacketSizing.d.ts.map +1 -1
  168. package/dist/audit/orchestrator/reviewPacketSizing.js +0 -1
  169. package/dist/audit/orchestrator/reviewPacketSizing.js.map +1 -1
  170. package/dist/audit/orchestrator/reviewPackets.d.ts +5 -68
  171. package/dist/audit/orchestrator/reviewPackets.d.ts.map +1 -1
  172. package/dist/audit/orchestrator/reviewPackets.js +55 -278
  173. package/dist/audit/orchestrator/reviewPackets.js.map +1 -1
  174. package/dist/audit/orchestrator/runtimeCommand.d.ts.map +1 -1
  175. package/dist/audit/orchestrator/runtimeCommand.js +4 -4
  176. package/dist/audit/orchestrator/runtimeCommand.js.map +1 -1
  177. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  178. package/dist/audit/orchestrator/state.js +1 -35
  179. package/dist/audit/orchestrator/state.js.map +1 -1
  180. package/dist/audit/orchestrator/structureExecutors.d.ts +0 -1
  181. package/dist/audit/orchestrator/structureExecutors.d.ts.map +1 -1
  182. package/dist/audit/orchestrator/structureExecutors.js +0 -45
  183. package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
  184. package/dist/audit/orchestrator/synthesisExecutors.d.ts +4 -6
  185. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  186. package/dist/audit/orchestrator/synthesisExecutors.js +3 -3
  187. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  188. package/dist/audit/orchestrator/taskAffinityGraph.d.ts +55 -21
  189. package/dist/audit/orchestrator/taskAffinityGraph.d.ts.map +1 -1
  190. package/dist/audit/orchestrator/taskAffinityGraph.js +67 -29
  191. package/dist/audit/orchestrator/taskAffinityGraph.js.map +1 -1
  192. package/dist/audit/reporting/scoreShared.js +1 -1
  193. package/dist/audit/reporting/scoreShared.js.map +1 -1
  194. package/dist/audit/reporting/synthesis.d.ts +11 -21
  195. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  196. package/dist/audit/reporting/synthesis.js +76 -29
  197. package/dist/audit/reporting/synthesis.js.map +1 -1
  198. package/dist/audit/reporting/workBlocks.d.ts +12 -12
  199. package/dist/audit/reporting/workBlocks.d.ts.map +1 -1
  200. package/dist/audit/reporting/workBlocks.js +195 -180
  201. package/dist/audit/reporting/workBlocks.js.map +1 -1
  202. package/dist/audit/supervisor/operatorHandoff.d.ts +17 -24
  203. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  204. package/dist/audit/supervisor/operatorHandoff.js +60 -125
  205. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  206. package/dist/audit/supervisor/runLedger.d.ts.map +1 -1
  207. package/dist/audit/supervisor/runLedger.js +0 -1
  208. package/dist/audit/supervisor/runLedger.js.map +1 -1
  209. package/dist/audit/types/analyzerCapability.d.ts +12 -12
  210. package/dist/audit/types/auditScope.d.ts +4 -19
  211. package/dist/audit/types/auditScope.d.ts.map +1 -1
  212. package/dist/audit/types/auditScope.js +2 -13
  213. package/dist/audit/types/auditScope.js.map +1 -1
  214. package/dist/audit/types/designAssessment.d.ts +9 -13
  215. package/dist/audit/types/designAssessment.d.ts.map +1 -1
  216. package/dist/audit/types/reviewPlanning.d.ts +24 -29
  217. package/dist/audit/types/reviewPlanning.d.ts.map +1 -1
  218. package/dist/audit/types/reviewPlanning.js +2 -7
  219. package/dist/audit/types/reviewPlanning.js.map +1 -1
  220. package/dist/audit/types.d.ts +90 -120
  221. package/dist/audit/types.d.ts.map +1 -1
  222. package/dist/audit/types.js +2 -21
  223. package/dist/audit/types.js.map +1 -1
  224. package/dist/audit/validation/anchorGrounding.d.ts +22 -10
  225. package/dist/audit/validation/anchorGrounding.d.ts.map +1 -1
  226. package/dist/audit/validation/anchorGrounding.js +0 -13
  227. package/dist/audit/validation/anchorGrounding.js.map +1 -1
  228. package/dist/audit/validation/auditResults.d.ts +0 -33
  229. package/dist/audit/validation/auditResults.d.ts.map +1 -1
  230. package/dist/audit/validation/auditResults.js +1 -114
  231. package/dist/audit/validation/auditResults.js.map +1 -1
  232. package/dist/remediate/index.d.ts +0 -8
  233. package/dist/remediate/index.d.ts.map +1 -1
  234. package/dist/remediate/index.js +49 -127
  235. package/dist/remediate/index.js.map +1 -1
  236. package/dist/remediate/intake.d.ts +6 -6
  237. package/dist/remediate/phases/close.d.ts +5 -17
  238. package/dist/remediate/phases/close.d.ts.map +1 -1
  239. package/dist/remediate/phases/close.js +30 -258
  240. package/dist/remediate/phases/close.js.map +1 -1
  241. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts +4 -4
  242. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts.map +1 -1
  243. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +14 -11
  244. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
  245. package/dist/remediate/phases/constants.d.ts +0 -1
  246. package/dist/remediate/phases/constants.d.ts.map +1 -1
  247. package/dist/remediate/phases/constants.js +0 -1
  248. package/dist/remediate/phases/constants.js.map +1 -1
  249. package/dist/remediate/phases/plan.d.ts +5 -30
  250. package/dist/remediate/phases/plan.d.ts.map +1 -1
  251. package/dist/remediate/phases/plan.js +34 -191
  252. package/dist/remediate/phases/plan.js.map +1 -1
  253. package/dist/remediate/phases/triage.d.ts.map +1 -1
  254. package/dist/remediate/phases/triage.js +33 -57
  255. package/dist/remediate/phases/triage.js.map +1 -1
  256. package/dist/remediate/review/autonomousGate.js +1 -1
  257. package/dist/remediate/review/autonomousGate.js.map +1 -1
  258. package/dist/remediate/state/closingActions.d.ts +1 -1
  259. package/dist/remediate/state/closingActions.d.ts.map +1 -1
  260. package/dist/remediate/state/closingActions.js +0 -1
  261. package/dist/remediate/state/closingActions.js.map +1 -1
  262. package/dist/remediate/state/store.d.ts +16 -45
  263. package/dist/remediate/state/store.d.ts.map +1 -1
  264. package/dist/remediate/state/store.js +12 -0
  265. package/dist/remediate/state/store.js.map +1 -1
  266. package/dist/remediate/state/types.d.ts +58 -30
  267. package/dist/remediate/state/types.d.ts.map +1 -1
  268. package/dist/remediate/state/types.js +22 -2
  269. package/dist/remediate/state/types.js.map +1 -1
  270. package/dist/remediate/steps/contractPipeline.d.ts +1 -8
  271. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  272. package/dist/remediate/steps/contractPipeline.js +122 -144
  273. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  274. package/dist/remediate/steps/dispatch/common.d.ts +0 -42
  275. package/dist/remediate/steps/dispatch/common.d.ts.map +1 -1
  276. package/dist/remediate/steps/dispatch/common.js +1 -96
  277. package/dist/remediate/steps/dispatch/common.js.map +1 -1
  278. package/dist/remediate/steps/dispatch/dagNodeFields.d.ts +0 -12
  279. package/dist/remediate/steps/dispatch/dagNodeFields.d.ts.map +1 -1
  280. package/dist/remediate/steps/dispatch/dagNodeFields.js +4 -18
  281. package/dist/remediate/steps/dispatch/dagNodeFields.js.map +1 -1
  282. package/dist/remediate/steps/dispatch/hostHandoff.d.ts +110 -0
  283. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -0
  284. package/dist/remediate/steps/dispatch/hostHandoff.js +921 -0
  285. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -0
  286. package/dist/remediate/steps/dispatch/implementPrompt.d.ts +0 -38
  287. package/dist/remediate/steps/dispatch/implementPrompt.d.ts.map +1 -1
  288. package/dist/remediate/steps/dispatch/implementPrompt.js +3 -479
  289. package/dist/remediate/steps/dispatch/implementPrompt.js.map +1 -1
  290. package/dist/remediate/steps/dispatch/marshal.d.ts +5 -38
  291. package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -1
  292. package/dist/remediate/steps/dispatch/marshal.js +4 -1332
  293. package/dist/remediate/steps/dispatch/marshal.js.map +1 -1
  294. package/dist/remediate/steps/dispatch/verifyCommands.d.ts +1 -13
  295. package/dist/remediate/steps/dispatch/verifyCommands.d.ts.map +1 -1
  296. package/dist/remediate/steps/dispatch/verifyCommands.js +1 -21
  297. package/dist/remediate/steps/dispatch/verifyCommands.js.map +1 -1
  298. package/dist/remediate/steps/dispatch/writeScope.d.ts +6 -107
  299. package/dist/remediate/steps/dispatch/writeScope.d.ts.map +1 -1
  300. package/dist/remediate/steps/dispatch/writeScope.js +32 -286
  301. package/dist/remediate/steps/dispatch/writeScope.js.map +1 -1
  302. package/dist/remediate/steps/dispatch.d.ts +7 -12
  303. package/dist/remediate/steps/dispatch.d.ts.map +1 -1
  304. package/dist/remediate/steps/dispatch.js +6 -8
  305. package/dist/remediate/steps/dispatch.js.map +1 -1
  306. package/dist/remediate/steps/gateCommands.d.ts +0 -29
  307. package/dist/remediate/steps/gateCommands.d.ts.map +1 -1
  308. package/dist/remediate/steps/gateCommands.js +0 -35
  309. package/dist/remediate/steps/gateCommands.js.map +1 -1
  310. package/dist/remediate/steps/nextStep.d.ts +9 -408
  311. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  312. package/dist/remediate/steps/nextStep.js +147 -1618
  313. package/dist/remediate/steps/nextStep.js.map +1 -1
  314. package/dist/remediate/steps/prompts.d.ts.map +1 -1
  315. package/dist/remediate/steps/prompts.js +1 -2
  316. package/dist/remediate/steps/prompts.js.map +1 -1
  317. package/dist/remediate/steps/sessionConfigLoad.d.ts +3 -42
  318. package/dist/remediate/steps/sessionConfigLoad.d.ts.map +1 -1
  319. package/dist/remediate/steps/sessionConfigLoad.js +3 -37
  320. package/dist/remediate/steps/sessionConfigLoad.js.map +1 -1
  321. package/dist/remediate/steps/stepUtils.d.ts +10 -47
  322. package/dist/remediate/steps/stepUtils.d.ts.map +1 -1
  323. package/dist/remediate/steps/stepUtils.js +11 -67
  324. package/dist/remediate/steps/stepUtils.js.map +1 -1
  325. package/dist/remediate/steps/types.d.ts +2 -81
  326. package/dist/remediate/steps/types.d.ts.map +1 -1
  327. package/dist/remediate/steps/types.js.map +1 -1
  328. package/dist/remediate/utils/fileIntegrity.d.ts.map +1 -1
  329. package/dist/remediate/utils/fileIntegrity.js +57 -5
  330. package/dist/remediate/utils/fileIntegrity.js.map +1 -1
  331. package/dist/remediate/validation/contractPipeline.d.ts +1 -1
  332. package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
  333. package/dist/remediate/validation/contractPipeline.js +1 -1
  334. package/dist/remediate/validation/contractPipeline.js.map +1 -1
  335. package/dist/remediate/validation/contractPipelineGates.d.ts +1 -39
  336. package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
  337. package/dist/remediate/validation/contractPipelineGates.js +1 -67
  338. package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
  339. package/dist/shared/affinityArtifacts.d.ts +42 -0
  340. package/dist/shared/affinityArtifacts.d.ts.map +1 -0
  341. package/dist/shared/affinityArtifacts.js +142 -0
  342. package/dist/shared/affinityArtifacts.js.map +1 -0
  343. package/dist/shared/analyzerPolicy.d.ts +40 -0
  344. package/dist/shared/analyzerPolicy.d.ts.map +1 -0
  345. package/dist/shared/analyzerPolicy.js +102 -0
  346. package/dist/shared/analyzerPolicy.js.map +1 -0
  347. package/dist/shared/analyzers/acquisitionEngine.d.ts +1 -1
  348. package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
  349. package/dist/shared/analyzers/types.d.ts +20 -20
  350. package/dist/shared/artifactFreshness.d.ts.map +1 -1
  351. package/dist/shared/artifactFreshness.js +5 -4
  352. package/dist/shared/artifactFreshness.js.map +1 -1
  353. package/dist/shared/constitutionalDocPaths.d.ts.map +1 -1
  354. package/dist/shared/constitutionalDocPaths.js +0 -1
  355. package/dist/shared/constitutionalDocPaths.js.map +1 -1
  356. package/dist/shared/contentKey.d.ts +1 -42
  357. package/dist/shared/contentKey.d.ts.map +1 -1
  358. package/dist/shared/contentKey.js +1 -45
  359. package/dist/shared/contentKey.js.map +1 -1
  360. package/dist/shared/decompose/charterClarification.d.ts +1 -1
  361. package/dist/shared/decompose/charterClarification.js +1 -1
  362. package/dist/shared/decompose/charterExtraction.d.ts +20 -20
  363. package/dist/shared/decompose/charterExtraction.js +1 -1
  364. package/dist/shared/decompose/charterExtraction.js.map +1 -1
  365. package/dist/shared/decompose/contentCoherence.d.ts +382 -0
  366. package/dist/shared/decompose/contentCoherence.d.ts.map +1 -0
  367. package/dist/shared/decompose/contentCoherence.js +290 -0
  368. package/dist/shared/decompose/contentCoherence.js.map +1 -0
  369. package/dist/shared/decompose/systemicChallenge.d.ts +4 -4
  370. package/dist/shared/decompose/systemicChallenge.js +1 -1
  371. package/dist/shared/decompose/systemicChallenge.js.map +1 -1
  372. package/dist/shared/friction/frictionRecord.js +1 -1
  373. package/dist/shared/friction/frictionRecord.js.map +1 -1
  374. package/dist/shared/friction/stepBoundaryCapture.d.ts +13 -175
  375. package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
  376. package/dist/shared/friction/stepBoundaryCapture.js +6 -232
  377. package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
  378. package/dist/shared/friction/triage.d.ts +3 -3
  379. package/dist/shared/friction/triage.d.ts.map +1 -1
  380. package/dist/shared/friction/triage.js +3 -20
  381. package/dist/shared/friction/triage.js.map +1 -1
  382. package/dist/shared/hostAssets.d.ts +3 -5
  383. package/dist/shared/hostAssets.d.ts.map +1 -1
  384. package/dist/shared/hostAssets.js +6 -7
  385. package/dist/shared/hostAssets.js.map +1 -1
  386. package/dist/shared/index.d.ts +32 -155
  387. package/dist/shared/index.d.ts.map +1 -1
  388. package/dist/shared/index.js +19 -133
  389. package/dist/shared/index.js.map +1 -1
  390. package/dist/shared/io/artifactName.js +2 -2
  391. package/dist/shared/io/artifactName.js.map +1 -1
  392. package/dist/shared/io/auditToolsPaths.d.ts +26 -6
  393. package/dist/shared/io/auditToolsPaths.d.ts.map +1 -1
  394. package/dist/shared/io/auditToolsPaths.js +31 -7
  395. package/dist/shared/io/auditToolsPaths.js.map +1 -1
  396. package/dist/shared/io/fileLock.d.ts.map +1 -0
  397. package/dist/shared/io/fileLock.js.map +1 -0
  398. package/dist/shared/io/json.d.ts +1 -1
  399. package/dist/shared/io/json.js +1 -1
  400. package/dist/shared/io/lockedJsonStore.d.ts +1 -1
  401. package/dist/shared/io/lockedJsonStore.js +4 -4
  402. package/dist/shared/io/lockedJsonStore.js.map +1 -1
  403. package/dist/shared/io/nodeWorktreeGuard.d.ts +14 -15
  404. package/dist/shared/io/nodeWorktreeGuard.d.ts.map +1 -1
  405. package/dist/shared/io/nodeWorktreeGuard.js +14 -15
  406. package/dist/shared/io/nodeWorktreeGuard.js.map +1 -1
  407. package/dist/shared/io/pathContainment.d.ts +3 -5
  408. package/dist/shared/io/pathContainment.d.ts.map +1 -1
  409. package/dist/shared/io/pathContainment.js.map +1 -1
  410. package/dist/shared/io/pathIdentity.d.ts.map +1 -0
  411. package/dist/shared/io/pathIdentity.js.map +1 -0
  412. package/dist/shared/io/schemaVersion.d.ts +5 -4
  413. package/dist/shared/io/schemaVersion.d.ts.map +1 -1
  414. package/dist/shared/io/schemaVersion.js +17 -5
  415. package/dist/shared/io/schemaVersion.js.map +1 -1
  416. package/dist/shared/io/stateDir.d.ts +3 -6
  417. package/dist/shared/io/stateDir.d.ts.map +1 -1
  418. package/dist/shared/io/stateDir.js +3 -6
  419. package/dist/shared/io/stateDir.js.map +1 -1
  420. package/dist/shared/io/stepContractWriter.d.ts +3 -3
  421. package/dist/shared/io/stepContractWriter.js +3 -3
  422. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  423. package/dist/shared/loopCorePaths.js +12 -14
  424. package/dist/shared/loopCorePaths.js.map +1 -1
  425. package/dist/shared/observability/runLog.d.ts +1 -2
  426. package/dist/shared/observability/runLog.d.ts.map +1 -1
  427. package/dist/shared/observability/runLog.js.map +1 -1
  428. package/dist/shared/prompts.d.ts +5 -7
  429. package/dist/shared/prompts.d.ts.map +1 -1
  430. package/dist/shared/prompts.js +2 -3
  431. package/dist/shared/prompts.js.map +1 -1
  432. package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -1
  433. package/dist/shared/reporting/auditDeliverable.js +37 -2
  434. package/dist/shared/reporting/auditDeliverable.js.map +1 -1
  435. package/dist/shared/sessionConfig.d.ts +30 -0
  436. package/dist/shared/sessionConfig.d.ts.map +1 -0
  437. package/dist/shared/sessionConfig.js +78 -0
  438. package/dist/shared/sessionConfig.js.map +1 -0
  439. package/dist/shared/stableStringify.d.ts +0 -12
  440. package/dist/shared/stableStringify.d.ts.map +1 -1
  441. package/dist/shared/stableStringify.js +4 -1
  442. package/dist/shared/stableStringify.js.map +1 -1
  443. package/dist/shared/submission/expectedSubmissions.d.ts +88 -0
  444. package/dist/shared/submission/expectedSubmissions.d.ts.map +1 -0
  445. package/dist/shared/submission/expectedSubmissions.js +84 -0
  446. package/dist/shared/submission/expectedSubmissions.js.map +1 -0
  447. package/dist/shared/submission/handRecovery.d.ts +37 -0
  448. package/dist/shared/submission/handRecovery.d.ts.map +1 -0
  449. package/dist/shared/submission/handRecovery.js +123 -0
  450. package/dist/shared/submission/handRecovery.js.map +1 -0
  451. package/dist/shared/submission/submissionClassifier.d.ts +48 -0
  452. package/dist/shared/submission/submissionClassifier.d.ts.map +1 -0
  453. package/dist/shared/submission/submissionClassifier.js +83 -0
  454. package/dist/shared/submission/submissionClassifier.js.map +1 -0
  455. package/dist/shared/submission/submissionIdentity.d.ts +49 -0
  456. package/dist/shared/submission/submissionIdentity.d.ts.map +1 -0
  457. package/dist/shared/submission/submissionIdentity.js +90 -0
  458. package/dist/shared/submission/submissionIdentity.js.map +1 -0
  459. package/dist/shared/submission/submissionLedger.d.ts +37 -0
  460. package/dist/shared/submission/submissionLedger.d.ts.map +1 -0
  461. package/dist/shared/submission/submissionLedger.js +81 -0
  462. package/dist/shared/submission/submissionLedger.js.map +1 -0
  463. package/dist/shared/tokens.d.ts +0 -11
  464. package/dist/shared/tokens.d.ts.map +1 -1
  465. package/dist/shared/tokens.js +2 -32
  466. package/dist/shared/tokens.js.map +1 -1
  467. package/dist/shared/tooling/allowlistedExec.d.ts +1 -1
  468. package/dist/shared/tooling/allowlistedExec.js +4 -4
  469. package/dist/shared/tooling/allowlistedExec.js.map +1 -1
  470. package/dist/shared/tooling/exec.d.ts +6 -6
  471. package/dist/shared/tooling/exec.d.ts.map +1 -1
  472. package/dist/shared/tooling/exec.js +9 -11
  473. package/dist/shared/tooling/exec.js.map +1 -1
  474. package/dist/shared/tooling/projectTestAdmission.d.ts +1 -1
  475. package/dist/shared/tooling/projectTestAdmission.js +3 -3
  476. package/dist/shared/tooling/projectTestAdmission.js.map +1 -1
  477. package/dist/shared/types/accessMemory.d.ts +6 -6
  478. package/dist/shared/types/charter.d.ts +19 -19
  479. package/dist/shared/types/charter.js +3 -3
  480. package/dist/shared/types/contractPipeline/verification.d.ts +0 -2
  481. package/dist/shared/types/contractPipeline/verification.d.ts.map +1 -1
  482. package/dist/shared/types/contractPipeline.d.ts +12 -1
  483. package/dist/shared/types/contractPipeline.d.ts.map +1 -1
  484. package/dist/shared/types/contractPipeline.js.map +1 -1
  485. package/dist/shared/types/executionRecord.d.ts +58 -0
  486. package/dist/shared/types/executionRecord.d.ts.map +1 -0
  487. package/dist/shared/types/executionRecord.js +26 -0
  488. package/dist/shared/types/executionRecord.js.map +1 -0
  489. package/dist/shared/types/finding.d.ts +671 -43
  490. package/dist/shared/types/finding.d.ts.map +1 -1
  491. package/dist/shared/types/finding.js +47 -13
  492. package/dist/shared/types/finding.js.map +1 -1
  493. package/dist/shared/types/intentCheckpoint.d.ts +30 -31
  494. package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
  495. package/dist/shared/types/intentCheckpoint.js +2 -3
  496. package/dist/shared/types/intentCheckpoint.js.map +1 -1
  497. package/dist/shared/types/remediationOutcome.d.ts +6 -6
  498. package/dist/shared/types/runLedger.d.ts +0 -1
  499. package/dist/shared/types/runLedger.d.ts.map +1 -1
  500. package/dist/shared/types/stepContract.d.ts +0 -6
  501. package/dist/shared/types/stepContract.d.ts.map +1 -1
  502. package/dist/shared/types/stepContract.js +0 -1
  503. package/dist/shared/types/stepContract.js.map +1 -1
  504. package/dist/shared/validation/findingsReport.d.ts +17 -1
  505. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  506. package/dist/shared/validation/findingsReport.js +137 -1
  507. package/dist/shared/validation/findingsReport.js.map +1 -1
  508. package/docs/audit-pkg/contracts.md +75 -201
  509. package/docs/audit-pkg/development.md +8 -7
  510. package/docs/audit-pkg/operator-guide.md +72 -174
  511. package/docs/audit-pkg/product.md +8 -15
  512. package/docs/audit-pkg/release.md +10 -21
  513. package/opencode.json +0 -34
  514. package/package.json +3 -5
  515. package/schemas/audit_result.schema.json +1 -17
  516. package/schemas/audit_results.schema.json +1 -17
  517. package/schemas/finding.schema.json +1 -1
  518. package/scripts/audit/postinstall.mjs +0 -8
  519. package/scripts/remediate/postinstall.mjs +27 -12
  520. package/skills/audit-code/SKILL.md +32 -150
  521. package/skills/audit-code/audit-code.prompt.md +24 -86
  522. package/skills/remediate-code/SKILL.md +27 -64
  523. package/skills/remediate-code/remediate-code.prompt.md +22 -79
  524. package/wrapper/audit-code-wrapper-install-hosts.mjs +3 -5
  525. package/wrapper/audit-code-wrapper-install-renderers.mjs +2 -2
  526. package/wrapper/audit-code-wrapper-lib.mjs +3 -23
  527. package/wrapper/audit-code-wrapper-opencode.mjs +21 -16
  528. package/wrapper/remediate-code-wrapper-install-hosts.mjs +5 -6
  529. package/wrapper/remediate-code-wrapper-install-renderers.mjs +1 -2
  530. package/wrapper/remediate-code-wrapper-opencode.mjs +31 -10
  531. package/dist/audit/cli/advanceAuditCommand.d.ts +0 -2
  532. package/dist/audit/cli/advanceAuditCommand.d.ts.map +0 -1
  533. package/dist/audit/cli/advanceAuditCommand.js +0 -104
  534. package/dist/audit/cli/advanceAuditCommand.js.map +0 -1
  535. package/dist/audit/cli/dispatch/hostFanoutGate.d.ts +0 -36
  536. package/dist/audit/cli/dispatch/hostFanoutGate.d.ts.map +0 -1
  537. package/dist/audit/cli/dispatch/hostFanoutGate.js +0 -28
  538. package/dist/audit/cli/dispatch/hostFanoutGate.js.map +0 -1
  539. package/dist/audit/cli/dispatch/packetPrompt.d.ts +0 -49
  540. package/dist/audit/cli/dispatch/packetPrompt.d.ts.map +0 -1
  541. package/dist/audit/cli/dispatch/packetPrompt.js +0 -355
  542. package/dist/audit/cli/dispatch/packetPrompt.js.map +0 -1
  543. package/dist/audit/cli/dispatch/paths.d.ts +0 -7
  544. package/dist/audit/cli/dispatch/paths.d.ts.map +0 -1
  545. package/dist/audit/cli/dispatch/paths.js +0 -32
  546. package/dist/audit/cli/dispatch/paths.js.map +0 -1
  547. package/dist/audit/cli/dispatch/pausePersist.d.ts +0 -111
  548. package/dist/audit/cli/dispatch/pausePersist.d.ts.map +0 -1
  549. package/dist/audit/cli/dispatch/pausePersist.js +0 -252
  550. package/dist/audit/cli/dispatch/pausePersist.js.map +0 -1
  551. package/dist/audit/cli/dispatch/quotaPool.d.ts +0 -142
  552. package/dist/audit/cli/dispatch/quotaPool.d.ts.map +0 -1
  553. package/dist/audit/cli/dispatch/quotaPool.js +0 -232
  554. package/dist/audit/cli/dispatch/quotaPool.js.map +0 -1
  555. package/dist/audit/cli/dispatch/sizingWindow.d.ts +0 -46
  556. package/dist/audit/cli/dispatch/sizingWindow.d.ts.map +0 -1
  557. package/dist/audit/cli/dispatch/sizingWindow.js +0 -34
  558. package/dist/audit/cli/dispatch/sizingWindow.js.map +0 -1
  559. package/dist/audit/cli/dispatch/tierRouting.d.ts +0 -64
  560. package/dist/audit/cli/dispatch/tierRouting.d.ts.map +0 -1
  561. package/dist/audit/cli/dispatch/tierRouting.js +0 -172
  562. package/dist/audit/cli/dispatch/tierRouting.js.map +0 -1
  563. package/dist/audit/cli/dispatch/tokenUsageObservation.d.ts +0 -91
  564. package/dist/audit/cli/dispatch/tokenUsageObservation.d.ts.map +0 -1
  565. package/dist/audit/cli/dispatch/tokenUsageObservation.js +0 -218
  566. package/dist/audit/cli/dispatch/tokenUsageObservation.js.map +0 -1
  567. package/dist/audit/cli/dispatch/types.d.ts +0 -144
  568. package/dist/audit/cli/dispatch/types.d.ts.map +0 -1
  569. package/dist/audit/cli/dispatch/types.js +0 -15
  570. package/dist/audit/cli/dispatch/types.js.map +0 -1
  571. package/dist/audit/cli/dispatchAttempted.d.ts +0 -26
  572. package/dist/audit/cli/dispatchAttempted.d.ts.map +0 -1
  573. package/dist/audit/cli/dispatchAttempted.js +0 -71
  574. package/dist/audit/cli/dispatchAttempted.js.map +0 -1
  575. package/dist/audit/cli/dispatchStatusCommand.d.ts +0 -2
  576. package/dist/audit/cli/dispatchStatusCommand.d.ts.map +0 -1
  577. package/dist/audit/cli/dispatchStatusCommand.js +0 -81
  578. package/dist/audit/cli/dispatchStatusCommand.js.map +0 -1
  579. package/dist/audit/cli/hybridDispatch.d.ts +0 -68
  580. package/dist/audit/cli/hybridDispatch.d.ts.map +0 -1
  581. package/dist/audit/cli/hybridDispatch.js +0 -85
  582. package/dist/audit/cli/hybridDispatch.js.map +0 -1
  583. package/dist/audit/cli/mergeAndIngestCommand.d.ts +0 -165
  584. package/dist/audit/cli/mergeAndIngestCommand.d.ts.map +0 -1
  585. package/dist/audit/cli/mergeAndIngestCommand.js +0 -945
  586. package/dist/audit/cli/mergeAndIngestCommand.js.map +0 -1
  587. package/dist/audit/cli/ownerTokens.d.ts +0 -21
  588. package/dist/audit/cli/ownerTokens.d.ts.map +0 -1
  589. package/dist/audit/cli/ownerTokens.js +0 -86
  590. package/dist/audit/cli/ownerTokens.js.map +0 -1
  591. package/dist/audit/cli/prepareDispatchCommand.d.ts +0 -34
  592. package/dist/audit/cli/prepareDispatchCommand.d.ts.map +0 -1
  593. package/dist/audit/cli/prepareDispatchCommand.js +0 -69
  594. package/dist/audit/cli/prepareDispatchCommand.js.map +0 -1
  595. package/dist/audit/cli/quotaCommand.d.ts +0 -2
  596. package/dist/audit/cli/quotaCommand.d.ts.map +0 -1
  597. package/dist/audit/cli/quotaCommand.js +0 -68
  598. package/dist/audit/cli/quotaCommand.js.map +0 -1
  599. package/dist/audit/cli/rollingAuditDispatch.d.ts +0 -206
  600. package/dist/audit/cli/rollingAuditDispatch.d.ts.map +0 -1
  601. package/dist/audit/cli/rollingAuditDispatch.js +0 -633
  602. package/dist/audit/cli/rollingAuditDispatch.js.map +0 -1
  603. package/dist/audit/cli/scoreTokensCommand.d.ts +0 -18
  604. package/dist/audit/cli/scoreTokensCommand.d.ts.map +0 -1
  605. package/dist/audit/cli/scoreTokensCommand.js +0 -129
  606. package/dist/audit/cli/scoreTokensCommand.js.map +0 -1
  607. package/dist/audit/cli/submitPacketCommand.d.ts +0 -2
  608. package/dist/audit/cli/submitPacketCommand.d.ts.map +0 -1
  609. package/dist/audit/cli/submitPacketCommand.js +0 -139
  610. package/dist/audit/cli/submitPacketCommand.js.map +0 -1
  611. package/dist/audit/cli/validateResultCommand.d.ts +0 -2
  612. package/dist/audit/cli/validateResultCommand.d.ts.map +0 -1
  613. package/dist/audit/cli/validateResultCommand.js +0 -105
  614. package/dist/audit/cli/validateResultCommand.js.map +0 -1
  615. package/dist/audit/cli/waveManifest.d.ts +0 -41
  616. package/dist/audit/cli/waveManifest.d.ts.map +0 -1
  617. package/dist/audit/cli/waveManifest.js +0 -42
  618. package/dist/audit/cli/waveManifest.js.map +0 -1
  619. package/dist/audit/cli/workPartitionRuntime.d.ts +0 -11
  620. package/dist/audit/cli/workPartitionRuntime.d.ts.map +0 -1
  621. package/dist/audit/cli/workPartitionRuntime.js +0 -42
  622. package/dist/audit/cli/workPartitionRuntime.js.map +0 -1
  623. package/dist/audit/cli/workerRunCommand.d.ts +0 -16
  624. package/dist/audit/cli/workerRunCommand.d.ts.map +0 -1
  625. package/dist/audit/cli/workerRunCommand.js +0 -153
  626. package/dist/audit/cli/workerRunCommand.js.map +0 -1
  627. package/dist/audit/contracts/schemaEnforcedEmit.d.ts +0 -75
  628. package/dist/audit/contracts/schemaEnforcedEmit.d.ts.map +0 -1
  629. package/dist/audit/contracts/schemaEnforcedEmit.js +0 -131
  630. package/dist/audit/contracts/schemaEnforcedEmit.js.map +0 -1
  631. package/dist/audit/orchestrator/reviewPacketGraphClustering.d.ts +0 -4
  632. package/dist/audit/orchestrator/reviewPacketGraphClustering.d.ts.map +0 -1
  633. package/dist/audit/orchestrator/reviewPacketGraphClustering.js +0 -473
  634. package/dist/audit/orchestrator/reviewPacketGraphClustering.js.map +0 -1
  635. package/dist/audit/orchestrator/rollingDispatch.d.ts +0 -64
  636. package/dist/audit/orchestrator/rollingDispatch.d.ts.map +0 -1
  637. package/dist/audit/orchestrator/rollingDispatch.js +0 -147
  638. package/dist/audit/orchestrator/rollingDispatch.js.map +0 -1
  639. package/dist/audit/orchestrator/unionFind.d.ts +0 -8
  640. package/dist/audit/orchestrator/unionFind.d.ts.map +0 -1
  641. package/dist/audit/orchestrator/unionFind.js +0 -43
  642. package/dist/audit/orchestrator/unionFind.js.map +0 -1
  643. package/dist/audit/prompts/renderWorkerPrompt.d.ts +0 -3
  644. package/dist/audit/prompts/renderWorkerPrompt.d.ts.map +0 -1
  645. package/dist/audit/prompts/renderWorkerPrompt.js +0 -87
  646. package/dist/audit/prompts/renderWorkerPrompt.js.map +0 -1
  647. package/dist/audit/providers/constants.d.ts +0 -2
  648. package/dist/audit/providers/constants.d.ts.map +0 -1
  649. package/dist/audit/providers/constants.js +0 -2
  650. package/dist/audit/providers/constants.js.map +0 -1
  651. package/dist/audit/providers/index.d.ts +0 -19
  652. package/dist/audit/providers/index.d.ts.map +0 -1
  653. package/dist/audit/providers/index.js +0 -23
  654. package/dist/audit/providers/index.js.map +0 -1
  655. package/dist/audit/quota/discoveredLimits.d.ts +0 -39
  656. package/dist/audit/quota/discoveredLimits.d.ts.map +0 -1
  657. package/dist/audit/quota/discoveredLimits.js +0 -96
  658. package/dist/audit/quota/discoveredLimits.js.map +0 -1
  659. package/dist/audit/quota/hostLimits.d.ts +0 -7
  660. package/dist/audit/quota/hostLimits.d.ts.map +0 -1
  661. package/dist/audit/quota/hostLimits.js +0 -6
  662. package/dist/audit/quota/hostLimits.js.map +0 -1
  663. package/dist/audit/quota/index.d.ts +0 -12
  664. package/dist/audit/quota/index.d.ts.map +0 -1
  665. package/dist/audit/quota/index.js +0 -19
  666. package/dist/audit/quota/index.js.map +0 -1
  667. package/dist/audit/reporting/scoreTokens.d.ts +0 -112
  668. package/dist/audit/reporting/scoreTokens.d.ts.map +0 -1
  669. package/dist/audit/reporting/scoreTokens.js +0 -188
  670. package/dist/audit/reporting/scoreTokens.js.map +0 -1
  671. package/dist/audit/supervisor/sessionConfig.d.ts +0 -19
  672. package/dist/audit/supervisor/sessionConfig.d.ts.map +0 -1
  673. package/dist/audit/supervisor/sessionConfig.js +0 -98
  674. package/dist/audit/supervisor/sessionConfig.js.map +0 -1
  675. package/dist/audit/types/activeDispatch.d.ts +0 -83
  676. package/dist/audit/types/activeDispatch.d.ts.map +0 -1
  677. package/dist/audit/types/activeDispatch.js +0 -3
  678. package/dist/audit/types/activeDispatch.js.map +0 -1
  679. package/dist/audit/types/workerSession.d.ts +0 -28
  680. package/dist/audit/types/workerSession.d.ts.map +0 -1
  681. package/dist/audit/types/workerSession.js +0 -5
  682. package/dist/audit/types/workerSession.js.map +0 -1
  683. package/dist/audit/validation/sessionConfig.d.ts +0 -7
  684. package/dist/audit/validation/sessionConfig.d.ts.map +0 -1
  685. package/dist/audit/validation/sessionConfig.js +0 -84
  686. package/dist/audit/validation/sessionConfig.js.map +0 -1
  687. package/dist/remediate/dispatch/amendmentClaim.d.ts +0 -48
  688. package/dist/remediate/dispatch/amendmentClaim.d.ts.map +0 -1
  689. package/dist/remediate/dispatch/amendmentClaim.js +0 -67
  690. package/dist/remediate/dispatch/amendmentClaim.js.map +0 -1
  691. package/dist/remediate/dispatch/ownershipRegistry.d.ts +0 -266
  692. package/dist/remediate/dispatch/ownershipRegistry.d.ts.map +0 -1
  693. package/dist/remediate/dispatch/ownershipRegistry.js +0 -515
  694. package/dist/remediate/dispatch/ownershipRegistry.js.map +0 -1
  695. package/dist/remediate/phases/workerTasks.d.ts +0 -21
  696. package/dist/remediate/phases/workerTasks.d.ts.map +0 -1
  697. package/dist/remediate/phases/workerTasks.js +0 -31
  698. package/dist/remediate/phases/workerTasks.js.map +0 -1
  699. package/dist/remediate/providers/constants.d.ts +0 -2
  700. package/dist/remediate/providers/constants.d.ts.map +0 -1
  701. package/dist/remediate/providers/constants.js +0 -2
  702. package/dist/remediate/providers/constants.js.map +0 -1
  703. package/dist/remediate/providers/index.d.ts +0 -19
  704. package/dist/remediate/providers/index.d.ts.map +0 -1
  705. package/dist/remediate/providers/index.js +0 -23
  706. package/dist/remediate/providers/index.js.map +0 -1
  707. package/dist/remediate/quota/hostLimits.d.ts +0 -7
  708. package/dist/remediate/quota/hostLimits.d.ts.map +0 -1
  709. package/dist/remediate/quota/hostLimits.js +0 -6
  710. package/dist/remediate/quota/hostLimits.js.map +0 -1
  711. package/dist/remediate/quota/index.d.ts +0 -8
  712. package/dist/remediate/quota/index.d.ts.map +0 -1
  713. package/dist/remediate/quota/index.js +0 -12
  714. package/dist/remediate/quota/index.js.map +0 -1
  715. package/dist/remediate/steps/dispatch/acceptNode.d.ts +0 -328
  716. package/dist/remediate/steps/dispatch/acceptNode.d.ts.map +0 -1
  717. package/dist/remediate/steps/dispatch/acceptNode.js +0 -722
  718. package/dist/remediate/steps/dispatch/acceptNode.js.map +0 -1
  719. package/dist/remediate/steps/dispatch/acceptReconcile.d.ts +0 -66
  720. package/dist/remediate/steps/dispatch/acceptReconcile.d.ts.map +0 -1
  721. package/dist/remediate/steps/dispatch/acceptReconcile.js +0 -154
  722. package/dist/remediate/steps/dispatch/acceptReconcile.js.map +0 -1
  723. package/dist/remediate/steps/dispatch/nodeArtifacts.d.ts +0 -41
  724. package/dist/remediate/steps/dispatch/nodeArtifacts.d.ts.map +0 -1
  725. package/dist/remediate/steps/dispatch/nodeArtifacts.js +0 -81
  726. package/dist/remediate/steps/dispatch/nodeArtifacts.js.map +0 -1
  727. package/dist/remediate/steps/dispatch/waveScheduling.d.ts +0 -123
  728. package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +0 -1
  729. package/dist/remediate/steps/dispatch/waveScheduling.js +0 -213
  730. package/dist/remediate/steps/dispatch/waveScheduling.js.map +0 -1
  731. package/dist/remediate/steps/dispatch/worktreeLifecycle.d.ts +0 -239
  732. package/dist/remediate/steps/dispatch/worktreeLifecycle.d.ts.map +0 -1
  733. package/dist/remediate/steps/dispatch/worktreeLifecycle.js +0 -875
  734. package/dist/remediate/steps/dispatch/worktreeLifecycle.js.map +0 -1
  735. package/dist/remediate/steps/providerNodeDispatch.d.ts +0 -57
  736. package/dist/remediate/steps/providerNodeDispatch.d.ts.map +0 -1
  737. package/dist/remediate/steps/providerNodeDispatch.js +0 -97
  738. package/dist/remediate/steps/providerNodeDispatch.js.map +0 -1
  739. package/dist/remediate/steps/rollingSession.d.ts +0 -283
  740. package/dist/remediate/steps/rollingSession.d.ts.map +0 -1
  741. package/dist/remediate/steps/rollingSession.js +0 -718
  742. package/dist/remediate/steps/rollingSession.js.map +0 -1
  743. package/dist/remediate/types/workerSession.d.ts +0 -35
  744. package/dist/remediate/types/workerSession.d.ts.map +0 -1
  745. package/dist/remediate/types/workerSession.js +0 -5
  746. package/dist/remediate/types/workerSession.js.map +0 -1
  747. package/dist/shared/config/resolveSessionConfig.d.ts +0 -75
  748. package/dist/shared/config/resolveSessionConfig.d.ts.map +0 -1
  749. package/dist/shared/config/resolveSessionConfig.js +0 -126
  750. package/dist/shared/config/resolveSessionConfig.js.map +0 -1
  751. package/dist/shared/data/model-statics.generated.json +0 -18939
  752. package/dist/shared/decompose/workPartition.d.ts +0 -66
  753. package/dist/shared/decompose/workPartition.d.ts.map +0 -1
  754. package/dist/shared/decompose/workPartition.js +0 -523
  755. package/dist/shared/decompose/workPartition.js.map +0 -1
  756. package/dist/shared/dispatch/admissionLeaseReconcile.d.ts +0 -20
  757. package/dist/shared/dispatch/admissionLeaseReconcile.d.ts.map +0 -1
  758. package/dist/shared/dispatch/admissionLeaseReconcile.js +0 -36
  759. package/dist/shared/dispatch/admissionLeaseReconcile.js.map +0 -1
  760. package/dist/shared/dispatch/admissionLoop.d.ts +0 -875
  761. package/dist/shared/dispatch/admissionLoop.d.ts.map +0 -1
  762. package/dist/shared/dispatch/admissionLoop.js +0 -692
  763. package/dist/shared/dispatch/admissionLoop.js.map +0 -1
  764. package/dist/shared/dispatch/coordinator.d.ts +0 -189
  765. package/dist/shared/dispatch/coordinator.d.ts.map +0 -1
  766. package/dist/shared/dispatch/coordinator.js +0 -258
  767. package/dist/shared/dispatch/coordinator.js.map +0 -1
  768. package/dist/shared/dispatch/costRank.d.ts +0 -25
  769. package/dist/shared/dispatch/costRank.d.ts.map +0 -1
  770. package/dist/shared/dispatch/costRank.js +0 -34
  771. package/dist/shared/dispatch/costRank.js.map +0 -1
  772. package/dist/shared/dispatch/dispatchDecisionLog.d.ts +0 -142
  773. package/dist/shared/dispatch/dispatchDecisionLog.d.ts.map +0 -1
  774. package/dist/shared/dispatch/dispatchDecisionLog.js +0 -65
  775. package/dist/shared/dispatch/dispatchDecisionLog.js.map +0 -1
  776. package/dist/shared/dispatch/dispatchQuotaContract.d.ts +0 -1052
  777. package/dist/shared/dispatch/dispatchQuotaContract.d.ts.map +0 -1
  778. package/dist/shared/dispatch/dispatchQuotaContract.js +0 -75
  779. package/dist/shared/dispatch/dispatchQuotaContract.js.map +0 -1
  780. package/dist/shared/dispatch/hostDispatchWall.d.ts +0 -107
  781. package/dist/shared/dispatch/hostDispatchWall.d.ts.map +0 -1
  782. package/dist/shared/dispatch/hostDispatchWall.js +0 -90
  783. package/dist/shared/dispatch/hostDispatchWall.js.map +0 -1
  784. package/dist/shared/dispatch/hybridDispatch.d.ts +0 -94
  785. package/dist/shared/dispatch/hybridDispatch.d.ts.map +0 -1
  786. package/dist/shared/dispatch/hybridDispatch.js +0 -60
  787. package/dist/shared/dispatch/hybridDispatch.js.map +0 -1
  788. package/dist/shared/dispatch/ownershipScheduler.d.ts +0 -101
  789. package/dist/shared/dispatch/ownershipScheduler.d.ts.map +0 -1
  790. package/dist/shared/dispatch/ownershipScheduler.js +0 -151
  791. package/dist/shared/dispatch/ownershipScheduler.js.map +0 -1
  792. package/dist/shared/dispatch/pathIdentity.d.ts.map +0 -1
  793. package/dist/shared/dispatch/pathIdentity.js.map +0 -1
  794. package/dist/shared/dispatch/providerDispatchPrep.d.ts +0 -65
  795. package/dist/shared/dispatch/providerDispatchPrep.d.ts.map +0 -1
  796. package/dist/shared/dispatch/providerDispatchPrep.js +0 -66
  797. package/dist/shared/dispatch/providerDispatchPrep.js.map +0 -1
  798. package/dist/shared/dispatch/providerLaunchFinalize.d.ts +0 -54
  799. package/dist/shared/dispatch/providerLaunchFinalize.d.ts.map +0 -1
  800. package/dist/shared/dispatch/providerLaunchFinalize.js +0 -275
  801. package/dist/shared/dispatch/providerLaunchFinalize.js.map +0 -1
  802. package/dist/shared/dispatch/rollingDispatch.d.ts +0 -598
  803. package/dist/shared/dispatch/rollingDispatch.d.ts.map +0 -1
  804. package/dist/shared/dispatch/rollingDispatch.js +0 -1488
  805. package/dist/shared/dispatch/rollingDispatch.js.map +0 -1
  806. package/dist/shared/dispatch/settledPools.d.ts +0 -55
  807. package/dist/shared/dispatch/settledPools.d.ts.map +0 -1
  808. package/dist/shared/dispatch/settledPools.js +0 -74
  809. package/dist/shared/dispatch/settledPools.js.map +0 -1
  810. package/dist/shared/dispatch/tierRank.d.ts +0 -53
  811. package/dist/shared/dispatch/tierRank.d.ts.map +0 -1
  812. package/dist/shared/dispatch/tierRank.js +0 -69
  813. package/dist/shared/dispatch/tierRank.js.map +0 -1
  814. package/dist/shared/dispatch/unifiedRolling.d.ts +0 -219
  815. package/dist/shared/dispatch/unifiedRolling.d.ts.map +0 -1
  816. package/dist/shared/dispatch/unifiedRolling.js +0 -214
  817. package/dist/shared/dispatch/unifiedRolling.js.map +0 -1
  818. package/dist/shared/friction/blindDispatchFriction.d.ts +0 -26
  819. package/dist/shared/friction/blindDispatchFriction.d.ts.map +0 -1
  820. package/dist/shared/friction/blindDispatchFriction.js +0 -41
  821. package/dist/shared/friction/blindDispatchFriction.js.map +0 -1
  822. package/dist/shared/io/tokenUsageLedger.d.ts +0 -58
  823. package/dist/shared/io/tokenUsageLedger.d.ts.map +0 -1
  824. package/dist/shared/io/tokenUsageLedger.js +0 -53
  825. package/dist/shared/io/tokenUsageLedger.js.map +0 -1
  826. package/dist/shared/providers/agyProvider.d.ts +0 -23
  827. package/dist/shared/providers/agyProvider.d.ts.map +0 -1
  828. package/dist/shared/providers/agyProvider.js +0 -63
  829. package/dist/shared/providers/agyProvider.js.map +0 -1
  830. package/dist/shared/providers/auditorSources.d.ts +0 -152
  831. package/dist/shared/providers/auditorSources.d.ts.map +0 -1
  832. package/dist/shared/providers/auditorSources.js +0 -391
  833. package/dist/shared/providers/auditorSources.js.map +0 -1
  834. package/dist/shared/providers/claudeCodeProvider.d.ts +0 -56
  835. package/dist/shared/providers/claudeCodeProvider.d.ts.map +0 -1
  836. package/dist/shared/providers/claudeCodeProvider.js +0 -67
  837. package/dist/shared/providers/claudeCodeProvider.js.map +0 -1
  838. package/dist/shared/providers/claudeWorkerProvider.d.ts +0 -71
  839. package/dist/shared/providers/claudeWorkerProvider.d.ts.map +0 -1
  840. package/dist/shared/providers/claudeWorkerProvider.js +0 -142
  841. package/dist/shared/providers/claudeWorkerProvider.js.map +0 -1
  842. package/dist/shared/providers/codexProvider.d.ts +0 -37
  843. package/dist/shared/providers/codexProvider.d.ts.map +0 -1
  844. package/dist/shared/providers/codexProvider.js +0 -85
  845. package/dist/shared/providers/codexProvider.js.map +0 -1
  846. package/dist/shared/providers/constants.d.ts +0 -4
  847. package/dist/shared/providers/constants.d.ts.map +0 -1
  848. package/dist/shared/providers/constants.js +0 -5
  849. package/dist/shared/providers/constants.js.map +0 -1
  850. package/dist/shared/providers/dispatchExclusion.d.ts +0 -44
  851. package/dist/shared/providers/dispatchExclusion.d.ts.map +0 -1
  852. package/dist/shared/providers/dispatchExclusion.js +0 -63
  853. package/dist/shared/providers/dispatchExclusion.js.map +0 -1
  854. package/dist/shared/providers/identity.d.ts +0 -48
  855. package/dist/shared/providers/identity.d.ts.map +0 -1
  856. package/dist/shared/providers/identity.js +0 -51
  857. package/dist/shared/providers/identity.js.map +0 -1
  858. package/dist/shared/providers/inProcessWorkers.d.ts +0 -42
  859. package/dist/shared/providers/inProcessWorkers.d.ts.map +0 -1
  860. package/dist/shared/providers/inProcessWorkers.js +0 -64
  861. package/dist/shared/providers/inProcessWorkers.js.map +0 -1
  862. package/dist/shared/providers/openAiCompatibleProvider.d.ts +0 -132
  863. package/dist/shared/providers/openAiCompatibleProvider.d.ts.map +0 -1
  864. package/dist/shared/providers/openAiCompatibleProvider.js +0 -875
  865. package/dist/shared/providers/openAiCompatibleProvider.js.map +0 -1
  866. package/dist/shared/providers/opencodeLaunch.d.ts +0 -30
  867. package/dist/shared/providers/opencodeLaunch.d.ts.map +0 -1
  868. package/dist/shared/providers/opencodeLaunch.js +0 -72
  869. package/dist/shared/providers/opencodeLaunch.js.map +0 -1
  870. package/dist/shared/providers/opencodeProvider.d.ts +0 -27
  871. package/dist/shared/providers/opencodeProvider.d.ts.map +0 -1
  872. package/dist/shared/providers/opencodeProvider.js +0 -63
  873. package/dist/shared/providers/opencodeProvider.js.map +0 -1
  874. package/dist/shared/providers/orchestratorBindings.d.ts +0 -75
  875. package/dist/shared/providers/orchestratorBindings.d.ts.map +0 -1
  876. package/dist/shared/providers/orchestratorBindings.js +0 -66
  877. package/dist/shared/providers/orchestratorBindings.js.map +0 -1
  878. package/dist/shared/providers/providerDiagnostics.d.ts +0 -11
  879. package/dist/shared/providers/providerDiagnostics.d.ts.map +0 -1
  880. package/dist/shared/providers/providerDiagnostics.js +0 -28
  881. package/dist/shared/providers/providerDiagnostics.js.map +0 -1
  882. package/dist/shared/providers/providerFactory.d.ts +0 -173
  883. package/dist/shared/providers/providerFactory.d.ts.map +0 -1
  884. package/dist/shared/providers/providerFactory.js +0 -374
  885. package/dist/shared/providers/providerFactory.js.map +0 -1
  886. package/dist/shared/providers/providerKeyedFactory.d.ts +0 -14
  887. package/dist/shared/providers/providerKeyedFactory.d.ts.map +0 -1
  888. package/dist/shared/providers/providerKeyedFactory.js +0 -16
  889. package/dist/shared/providers/providerKeyedFactory.js.map +0 -1
  890. package/dist/shared/providers/providerPathGuard.d.ts +0 -101
  891. package/dist/shared/providers/providerPathGuard.d.ts.map +0 -1
  892. package/dist/shared/providers/providerPathGuard.js +0 -177
  893. package/dist/shared/providers/providerPathGuard.js.map +0 -1
  894. package/dist/shared/providers/reviewSnapshot.d.ts +0 -55
  895. package/dist/shared/providers/reviewSnapshot.d.ts.map +0 -1
  896. package/dist/shared/providers/reviewSnapshot.js +0 -112
  897. package/dist/shared/providers/reviewSnapshot.js.map +0 -1
  898. package/dist/shared/providers/spawnLoggedCommand.d.ts +0 -10
  899. package/dist/shared/providers/spawnLoggedCommand.d.ts.map +0 -1
  900. package/dist/shared/providers/spawnLoggedCommand.js +0 -345
  901. package/dist/shared/providers/spawnLoggedCommand.js.map +0 -1
  902. package/dist/shared/providers/subprocessTemplateProvider.d.ts +0 -19
  903. package/dist/shared/providers/subprocessTemplateProvider.d.ts.map +0 -1
  904. package/dist/shared/providers/subprocessTemplateProvider.js +0 -91
  905. package/dist/shared/providers/subprocessTemplateProvider.js.map +0 -1
  906. package/dist/shared/providers/types.d.ts +0 -144
  907. package/dist/shared/providers/types.d.ts.map +0 -1
  908. package/dist/shared/providers/types.js +0 -2
  909. package/dist/shared/providers/types.js.map +0 -1
  910. package/dist/shared/providers/workerCommandProvider.d.ts +0 -10
  911. package/dist/shared/providers/workerCommandProvider.d.ts.map +0 -1
  912. package/dist/shared/providers/workerCommandProvider.js +0 -20
  913. package/dist/shared/providers/workerCommandProvider.js.map +0 -1
  914. package/dist/shared/providers/workerTaskLaunch.d.ts +0 -32
  915. package/dist/shared/providers/workerTaskLaunch.d.ts.map +0 -1
  916. package/dist/shared/providers/workerTaskLaunch.js +0 -27
  917. package/dist/shared/providers/workerTaskLaunch.js.map +0 -1
  918. package/dist/shared/quota/accountId.d.ts +0 -107
  919. package/dist/shared/quota/accountId.d.ts.map +0 -1
  920. package/dist/shared/quota/accountId.js +0 -151
  921. package/dist/shared/quota/accountId.js.map +0 -1
  922. package/dist/shared/quota/antigravityQuotaSource.d.ts +0 -44
  923. package/dist/shared/quota/antigravityQuotaSource.d.ts.map +0 -1
  924. package/dist/shared/quota/antigravityQuotaSource.js +0 -103
  925. package/dist/shared/quota/antigravityQuotaSource.js.map +0 -1
  926. package/dist/shared/quota/apiPool.d.ts +0 -322
  927. package/dist/shared/quota/apiPool.d.ts.map +0 -1
  928. package/dist/shared/quota/apiPool.js +0 -751
  929. package/dist/shared/quota/apiPool.js.map +0 -1
  930. package/dist/shared/quota/capacity.d.ts +0 -667
  931. package/dist/shared/quota/capacity.d.ts.map +0 -1
  932. package/dist/shared/quota/capacity.js +0 -507
  933. package/dist/shared/quota/capacity.js.map +0 -1
  934. package/dist/shared/quota/claimLease.d.ts +0 -32
  935. package/dist/shared/quota/claimLease.d.ts.map +0 -1
  936. package/dist/shared/quota/claimLease.js +0 -73
  937. package/dist/shared/quota/claimLease.js.map +0 -1
  938. package/dist/shared/quota/claimRegistry.d.ts +0 -118
  939. package/dist/shared/quota/claimRegistry.d.ts.map +0 -1
  940. package/dist/shared/quota/claimRegistry.js +0 -246
  941. package/dist/shared/quota/claimRegistry.js.map +0 -1
  942. package/dist/shared/quota/claudeCodeJsonLines.d.ts +0 -15
  943. package/dist/shared/quota/claudeCodeJsonLines.d.ts.map +0 -1
  944. package/dist/shared/quota/claudeCodeJsonLines.js +0 -34
  945. package/dist/shared/quota/claudeCodeJsonLines.js.map +0 -1
  946. package/dist/shared/quota/claudeOAuthQuotaSource.d.ts +0 -97
  947. package/dist/shared/quota/claudeOAuthQuotaSource.d.ts.map +0 -1
  948. package/dist/shared/quota/claudeOAuthQuotaSource.js +0 -385
  949. package/dist/shared/quota/claudeOAuthQuotaSource.js.map +0 -1
  950. package/dist/shared/quota/codexHostConfig.d.ts +0 -17
  951. package/dist/shared/quota/codexHostConfig.d.ts.map +0 -1
  952. package/dist/shared/quota/codexHostConfig.js +0 -43
  953. package/dist/shared/quota/codexHostConfig.js.map +0 -1
  954. package/dist/shared/quota/codexQuotaSource.d.ts +0 -52
  955. package/dist/shared/quota/codexQuotaSource.d.ts.map +0 -1
  956. package/dist/shared/quota/codexQuotaSource.js +0 -106
  957. package/dist/shared/quota/codexQuotaSource.js.map +0 -1
  958. package/dist/shared/quota/compositeQuotaSource.d.ts +0 -83
  959. package/dist/shared/quota/compositeQuotaSource.d.ts.map +0 -1
  960. package/dist/shared/quota/compositeQuotaSource.js +0 -152
  961. package/dist/shared/quota/compositeQuotaSource.js.map +0 -1
  962. package/dist/shared/quota/copilotQuotaSource.d.ts +0 -57
  963. package/dist/shared/quota/copilotQuotaSource.d.ts.map +0 -1
  964. package/dist/shared/quota/copilotQuotaSource.js +0 -143
  965. package/dist/shared/quota/copilotQuotaSource.js.map +0 -1
  966. package/dist/shared/quota/coverage.d.ts +0 -45
  967. package/dist/shared/quota/coverage.d.ts.map +0 -1
  968. package/dist/shared/quota/coverage.js +0 -77
  969. package/dist/shared/quota/coverage.js.map +0 -1
  970. package/dist/shared/quota/dispatchDriverPrompt.d.ts +0 -15
  971. package/dist/shared/quota/dispatchDriverPrompt.d.ts.map +0 -1
  972. package/dist/shared/quota/dispatchDriverPrompt.js +0 -40
  973. package/dist/shared/quota/dispatchDriverPrompt.js.map +0 -1
  974. package/dist/shared/quota/errorParsers/claudeCodeErrorParser.d.ts +0 -7
  975. package/dist/shared/quota/errorParsers/claudeCodeErrorParser.d.ts.map +0 -1
  976. package/dist/shared/quota/errorParsers/claudeCodeErrorParser.js +0 -33
  977. package/dist/shared/quota/errorParsers/claudeCodeErrorParser.js.map +0 -1
  978. package/dist/shared/quota/errorParsers/genericErrorParser.d.ts +0 -10
  979. package/dist/shared/quota/errorParsers/genericErrorParser.d.ts.map +0 -1
  980. package/dist/shared/quota/errorParsers/genericErrorParser.js +0 -8
  981. package/dist/shared/quota/errorParsers/genericErrorParser.js.map +0 -1
  982. package/dist/shared/quota/errorParsers/index.d.ts +0 -6
  983. package/dist/shared/quota/errorParsers/index.d.ts.map +0 -1
  984. package/dist/shared/quota/errorParsers/index.js +0 -16
  985. package/dist/shared/quota/errorParsers/index.js.map +0 -1
  986. package/dist/shared/quota/errorParsing.d.ts +0 -97
  987. package/dist/shared/quota/errorParsing.d.ts.map +0 -1
  988. package/dist/shared/quota/errorParsing.js +0 -333
  989. package/dist/shared/quota/errorParsing.js.map +0 -1
  990. package/dist/shared/quota/fileLock.d.ts.map +0 -1
  991. package/dist/shared/quota/fileLock.js.map +0 -1
  992. package/dist/shared/quota/hostLimits.d.ts +0 -31
  993. package/dist/shared/quota/hostLimits.d.ts.map +0 -1
  994. package/dist/shared/quota/hostLimits.js +0 -74
  995. package/dist/shared/quota/hostLimits.js.map +0 -1
  996. package/dist/shared/quota/hostPool.d.ts +0 -115
  997. package/dist/shared/quota/hostPool.d.ts.map +0 -1
  998. package/dist/shared/quota/hostPool.js +0 -104
  999. package/dist/shared/quota/hostPool.js.map +0 -1
  1000. package/dist/shared/quota/hostSessionQuotaSource.d.ts +0 -150
  1001. package/dist/shared/quota/hostSessionQuotaSource.d.ts.map +0 -1
  1002. package/dist/shared/quota/hostSessionQuotaSource.js +0 -250
  1003. package/dist/shared/quota/hostSessionQuotaSource.js.map +0 -1
  1004. package/dist/shared/quota/httpQuotaSource.d.ts +0 -122
  1005. package/dist/shared/quota/httpQuotaSource.d.ts.map +0 -1
  1006. package/dist/shared/quota/httpQuotaSource.js +0 -155
  1007. package/dist/shared/quota/httpQuotaSource.js.map +0 -1
  1008. package/dist/shared/quota/learnedQuotaSource.d.ts +0 -20
  1009. package/dist/shared/quota/learnedQuotaSource.d.ts.map +0 -1
  1010. package/dist/shared/quota/learnedQuotaSource.js +0 -46
  1011. package/dist/shared/quota/learnedQuotaSource.js.map +0 -1
  1012. package/dist/shared/quota/limits.d.ts +0 -55
  1013. package/dist/shared/quota/limits.d.ts.map +0 -1
  1014. package/dist/shared/quota/limits.js +0 -164
  1015. package/dist/shared/quota/limits.js.map +0 -1
  1016. package/dist/shared/quota/modelStatics.d.ts +0 -32
  1017. package/dist/shared/quota/modelStatics.d.ts.map +0 -1
  1018. package/dist/shared/quota/modelStatics.js +0 -117
  1019. package/dist/shared/quota/modelStatics.js.map +0 -1
  1020. package/dist/shared/quota/openCodeQuotaSource.d.ts +0 -18
  1021. package/dist/shared/quota/openCodeQuotaSource.d.ts.map +0 -1
  1022. package/dist/shared/quota/openCodeQuotaSource.js +0 -84
  1023. package/dist/shared/quota/openCodeQuotaSource.js.map +0 -1
  1024. package/dist/shared/quota/packetCost.d.ts +0 -27
  1025. package/dist/shared/quota/packetCost.d.ts.map +0 -1
  1026. package/dist/shared/quota/packetCost.js +0 -45
  1027. package/dist/shared/quota/packetCost.js.map +0 -1
  1028. package/dist/shared/quota/quotaCoverageNudge.d.ts +0 -26
  1029. package/dist/shared/quota/quotaCoverageNudge.d.ts.map +0 -1
  1030. package/dist/shared/quota/quotaCoverageNudge.js +0 -82
  1031. package/dist/shared/quota/quotaCoverageNudge.js.map +0 -1
  1032. package/dist/shared/quota/quotaSource.d.ts +0 -224
  1033. package/dist/shared/quota/quotaSource.d.ts.map +0 -1
  1034. package/dist/shared/quota/quotaSource.js +0 -125
  1035. package/dist/shared/quota/quotaSource.js.map +0 -1
  1036. package/dist/shared/quota/recordStore.d.ts +0 -25
  1037. package/dist/shared/quota/recordStore.d.ts.map +0 -1
  1038. package/dist/shared/quota/recordStore.js +0 -65
  1039. package/dist/shared/quota/recordStore.js.map +0 -1
  1040. package/dist/shared/quota/reservationLedger.d.ts +0 -183
  1041. package/dist/shared/quota/reservationLedger.d.ts.map +0 -1
  1042. package/dist/shared/quota/reservationLedger.js +0 -319
  1043. package/dist/shared/quota/reservationLedger.js.map +0 -1
  1044. package/dist/shared/quota/scheduler.d.ts +0 -262
  1045. package/dist/shared/quota/scheduler.d.ts.map +0 -1
  1046. package/dist/shared/quota/scheduler.js +0 -628
  1047. package/dist/shared/quota/scheduler.js.map +0 -1
  1048. package/dist/shared/quota/slidingWindow.d.ts +0 -5
  1049. package/dist/shared/quota/slidingWindow.d.ts.map +0 -1
  1050. package/dist/shared/quota/slidingWindow.js +0 -29
  1051. package/dist/shared/quota/slidingWindow.js.map +0 -1
  1052. package/dist/shared/quota/state.d.ts +0 -204
  1053. package/dist/shared/quota/state.d.ts.map +0 -1
  1054. package/dist/shared/quota/state.js +0 -480
  1055. package/dist/shared/quota/state.js.map +0 -1
  1056. package/dist/shared/quota/tokenBudgetView.d.ts +0 -17
  1057. package/dist/shared/quota/tokenBudgetView.d.ts.map +0 -1
  1058. package/dist/shared/quota/tokenBudgetView.js +0 -77
  1059. package/dist/shared/quota/tokenBudgetView.js.map +0 -1
  1060. package/dist/shared/quota/types.d.ts +0 -235
  1061. package/dist/shared/quota/types.d.ts.map +0 -1
  1062. package/dist/shared/quota/types.js +0 -58
  1063. package/dist/shared/quota/types.js.map +0 -1
  1064. package/dist/shared/quota/windowConstraints.d.ts +0 -56
  1065. package/dist/shared/quota/windowConstraints.d.ts.map +0 -1
  1066. package/dist/shared/quota/windowConstraints.js +0 -71
  1067. package/dist/shared/quota/windowConstraints.js.map +0 -1
  1068. package/dist/shared/repair/brokeredDispatch.d.ts +0 -151
  1069. package/dist/shared/repair/brokeredDispatch.d.ts.map +0 -1
  1070. package/dist/shared/repair/brokeredDispatch.js +0 -182
  1071. package/dist/shared/repair/brokeredDispatch.js.map +0 -1
  1072. package/dist/shared/repair/emitValidateRepair.d.ts +0 -124
  1073. package/dist/shared/repair/emitValidateRepair.d.ts.map +0 -1
  1074. package/dist/shared/repair/emitValidateRepair.js +0 -180
  1075. package/dist/shared/repair/emitValidateRepair.js.map +0 -1
  1076. package/dist/shared/repair/index.d.ts +0 -10
  1077. package/dist/shared/repair/index.d.ts.map +0 -1
  1078. package/dist/shared/repair/index.js +0 -3
  1079. package/dist/shared/repair/index.js.map +0 -1
  1080. package/dist/shared/rolling/pausedState.d.ts +0 -201
  1081. package/dist/shared/rolling/pausedState.d.ts.map +0 -1
  1082. package/dist/shared/rolling/pausedState.js +0 -197
  1083. package/dist/shared/rolling/pausedState.js.map +0 -1
  1084. package/dist/shared/types/attributionContract.d.ts +0 -198
  1085. package/dist/shared/types/attributionContract.d.ts.map +0 -1
  1086. package/dist/shared/types/attributionContract.js +0 -332
  1087. package/dist/shared/types/attributionContract.js.map +0 -1
  1088. package/dist/shared/types/auditorDescriptor.d.ts +0 -119
  1089. package/dist/shared/types/auditorDescriptor.d.ts.map +0 -1
  1090. package/dist/shared/types/auditorDescriptor.js +0 -29
  1091. package/dist/shared/types/auditorDescriptor.js.map +0 -1
  1092. package/dist/shared/types/rollingDispatch.d.ts +0 -222
  1093. package/dist/shared/types/rollingDispatch.d.ts.map +0 -1
  1094. package/dist/shared/types/rollingDispatch.js +0 -19
  1095. package/dist/shared/types/rollingDispatch.js.map +0 -1
  1096. package/dist/shared/types/sessionConfig.d.ts +0 -778
  1097. package/dist/shared/types/sessionConfig.d.ts.map +0 -1
  1098. package/dist/shared/types/sessionConfig.js +0 -393
  1099. package/dist/shared/types/sessionConfig.js.map +0 -1
  1100. package/dist/shared/validation/sessionConfig.d.ts +0 -59
  1101. package/dist/shared/validation/sessionConfig.d.ts.map +0 -1
  1102. package/dist/shared/validation/sessionConfig.js +0 -631
  1103. package/dist/shared/validation/sessionConfig.js.map +0 -1
  1104. /package/dist/shared/{quota → io}/fileLock.d.ts +0 -0
  1105. /package/dist/shared/{quota → io}/fileLock.js +0 -0
  1106. /package/dist/shared/{dispatch → io}/pathIdentity.d.ts +0 -0
  1107. /package/dist/shared/{dispatch → io}/pathIdentity.js +0 -0
@@ -1,692 +0,0 @@
1
- // Host-path admission loop — the tool-side "grant the admitted set" primitive of
2
- // the dispatch admission-control model (spec/dispatch-quota.md).
3
- //
4
- // The in-process rolling engine (rollingDispatch.ts) admits ONE packet at a time
5
- // continuously; this is its host-subagent-path analog: at a dispatch step the tool
6
- // admits a BATCH — as many packets as budget (and any declared in-flight cap) allow
7
- // right now — reserving each against the shared ReservationLedger, and hands the
8
- // host EXACTLY that granted set. The host dispatches the set, reports at
9
- // result-ingest (merge-and-ingest), and the next `next-step` re-admits the
10
- // remainder. The granted set's size is the instantaneous admission width — there is
11
- // no computed concurrency number (spec: "concurrency is not a computed quantity").
12
- //
13
- // COST-FIRST ROUTING is a first-class property: each packet is routed to the
14
- // CHEAPEST pool CAPABLE of it (cost-ascending among capable pools) that still has
15
- // budget + in-flight-cap headroom, so lower-cost providers fill before pricier ones
16
- // and overflow spills to the next-cheapest-capable pool. The capability gate and
17
- // cost rank are inputs, so refining the complexity/risk gate is a one-predicate
18
- // change, never a re-architecture.
19
- import { z } from "zod";
20
- import { DISPATCH_LEASE_TTL_MS } from "../quota/reservationLedger.js";
21
- import { estimatePacketCost } from "../quota/packetCost.js";
22
- import { windowConstraintsFor } from "../quota/windowConstraints.js";
23
- import { deriveColdStartAdmissionBatch } from "../quota/scheduler.js";
24
- import { tierRank } from "./tierRank.js";
25
- import { deriveCostRank } from "./costRank.js";
26
- /**
27
- * Build the admission pool set from the serializable per-pool capacity summaries —
28
- * the SINGLE source of truth both orchestrators use (audit summarizes its dispatch
29
- * capacity; remediate passes `schedule.capacity_pools`), so the two cannot drift on
30
- * how a pool maps to an {@link AdmissionPool}. Every field is derived here once:
31
- * budget (optimistic `+Infinity` when no live ceiling), the hard in-flight cap
32
- * (`declaredCap` — host subagent budget OR endpoint `max_concurrent`), cost rank,
33
- * capability tier ordinal, the throughput rank (pool-class-aware concurrency;
34
- * spec/dispatch-quota.md), and the context-window fit ceiling.
35
- */
36
- export function admissionPoolsFromSummaries(summaries) {
37
- return summaries.map((pool) => ({
38
- poolId: pool.pool_id,
39
- resourceKey: pool.pool_id,
40
- budget: pool.remaining_token_budget ?? Number.POSITIVE_INFINITY,
41
- accountKey: pool.account_key,
42
- windowBudgets: (pool.window_budgets ?? []).map((w) => ({
43
- scope: w.scope,
44
- label: w.label,
45
- budget: w.budget,
46
- unit: w.unit,
47
- ...(w.tokens_per_pct != null ? { tokensPerPct: w.tokens_per_pct } : {}),
48
- reset_at: w.reset_at,
49
- })),
50
- declaredCap: pool.host_concurrency_limit?.active_subagents ?? pool.concurrency_cap ?? null,
51
- costRank: deriveCostRank({
52
- model: pool.model,
53
- tier: pool.rank,
54
- declaredCostPerMtok: pool.declared_cost_per_mtok,
55
- }),
56
- capabilityRank: tierRank(pool.rank),
57
- capabilityScore: pool.capability_rank ?? null,
58
- // ONE fit predicate on both dispatch paths (unified-routing step B): a source
59
- // pool's own effective window (`context_cap_tokens`, non-null since step A)
60
- // outranks the wave's resolved limits — previously the host-admission path gated
61
- // every pool against the HOST's window, so a small-context source pool admitted
62
- // packets it could never serve (413 instead of skip). Host pools carry no
63
- // `context_cap_tokens` and fall through to their real resolved window.
64
- capacityTokens: pool.context_cap_tokens ?? pool.resolved_limits.context_tokens,
65
- calibrating: pool.calibrating === true,
66
- }));
67
- }
68
- /**
69
- * One constraint's evaluation, serialized for the persisted explain artifact —
70
- * the wire form of the ledger's {@link ConstraintOutcome} (legibility invariant,
71
- * spec/dispatch-quota.md Resolved decision 3).
72
- *
73
- * `headroom_before: null` means UNBOUNDED, not unknown — a cold-start pool with
74
- * no real ceiling computes `headroomBefore = +Infinity`, which `JSON.stringify`
75
- * (the artifact's actual emit path) collapses to `null`; `.number()` alone
76
- * rejects that on read-back even though it accepts `Infinity` in memory, so
77
- * `null` is the honest encoding of what the artifact actually contains on disk.
78
- */
79
- export const ConstraintOutcomeRecordSchema = z
80
- .object({
81
- resource_key: z.string(),
82
- headroom_before: z.number().nullable(),
83
- outstanding_before: z.number(),
84
- cost: z.number(),
85
- /** Whether this constraint alone had room. Admission requires ALL true. */
86
- cleared: z.boolean(),
87
- })
88
- .strict();
89
- /** Serialize ledger outcomes for the artifact (non-finite headroom → null). */
90
- export function toConstraintOutcomeRecords(outcomes) {
91
- return outcomes.map((o) => ({
92
- resource_key: o.resourceKey,
93
- headroom_before: Number.isFinite(o.headroomBefore) ? o.headroomBefore : null,
94
- outstanding_before: o.outstandingBefore,
95
- cost: o.cost,
96
- cleared: o.cleared,
97
- }));
98
- }
99
- /**
100
- * One NON-decisive pool consultation during a packet's admission walk — a pool
101
- * that was tried and refused before the decision landed elsewhere (the decisive
102
- * pool's data lives on the explain record itself, never duplicated here). The
103
- * refusal vocabulary is shared with {@link AdmissionExplain.reason} so one
104
- * parser covers both.
105
- */
106
- export const AdmissionAttemptSchema = z
107
- .object({
108
- pool_id: z.string(),
109
- reason: z.enum(["budget_exhausted", "cap_reached", "window_uncalibrated"]),
110
- /** Ledger outcomes when the attempt reached the ledger; [] otherwise. */
111
- constraints: z.array(ConstraintOutcomeRecordSchema),
112
- /** cap_reached only: the in-flight count and cap that refused. */
113
- in_flight_before: z.number().optional(),
114
- cap: z.number().optional(),
115
- /** window_uncalibrated only: labels of the windows that could not price. */
116
- unpriced_windows: z.array(z.string()).optional(),
117
- })
118
- .strict();
119
- export const AdmissionGrantSchema = z
120
- .object({
121
- packet_id: z.string(),
122
- pool_id: z.string(),
123
- resource_keys: z.array(z.string()),
124
- lease_id: z.string(),
125
- cost: z.number(),
126
- })
127
- .strict();
128
- /**
129
- * Why a packet was admitted or blocked — the per-admission explain record.
130
- * Carries the FULL constraint-outcome array the decision was taken against
131
- * (every key consulted, its headroom before, the packet's cost against it,
132
- * which key refused) plus the non-decisive walk trail — never a one-of-N
133
- * scalar that looks authoritative while being partial
134
- * ([[write-only-data-looks-authoritative]]).
135
- */
136
- export const AdmissionExplainSchema = z
137
- .object({
138
- packet_id: z.string(),
139
- /** null when NO pool was capable, or on a plan-only (`planned`) grant. */
140
- pool_id: z.string().nullable(),
141
- admitted: z.boolean(),
142
- reason: z.enum([
143
- "admitted",
144
- // Plan-only display grant (`grantLeases: false`): the in-process rolling
145
- // engine leases per-packet at dispatch time and records its decisions in
146
- // the engine decision log — no lease exists for this record, by design.
147
- "planned",
148
- "no_capable_pool",
149
- "budget_exhausted",
150
- "cap_reached",
151
- "packet_oversized",
152
- // A window that APPLIES to the packet has no learned tokens-per-percent slope,
153
- // so it cannot price the draw. Distinct from budget_exhausted: nothing ran
154
- // out, the pool is still calibrating — telling the operator the budget is gone
155
- // would be a false report of a wall that does not exist.
156
- "window_uncalibrated",
157
- ]),
158
- /**
159
- * The DECISIVE attempt's full constraint-outcome array: on a grant, the
160
- * successful admit's; on a ledger refusal, the refusing decision's. Empty
161
- * when the ledger was never reached (no_capable_pool / cap_reached /
162
- * window_uncalibrated / planned / packet_oversized).
163
- */
164
- constraints: z.array(ConstraintOutcomeRecordSchema),
165
- /**
166
- * The tightest (or refusing) constraint of the decisive attempt — the
167
- * binding window a report should name, as its full outcome row. Null when
168
- * the ledger was never reached.
169
- */
170
- binding: ConstraintOutcomeRecordSchema.nullable(),
171
- /** Pools consulted and refused BEFORE the decision, in walk order. */
172
- attempts: z.array(AdmissionAttemptSchema),
173
- /** cap_reached refusal only: the in-flight count and cap that refused. */
174
- in_flight_before: z.number().optional(),
175
- cap: z.number().optional(),
176
- /** window_uncalibrated refusal only: labels of the unpriceable windows. */
177
- unpriced_windows: z.array(z.string()).optional(),
178
- cost: z.number(),
179
- })
180
- .strict();
181
- /**
182
- * The admission artifact both orchestrators embed in their dispatch-quota contract,
183
- * REPLACING the removed `max_concurrent_agents` scalar. `granted_packet_ids` is the
184
- * set the host dispatches this step (its size is the emergent admission width);
185
- * `declared_cap` is the verbatim per-environment hard in-flight cap (null when
186
- * none); `leases` are reconciled (freed) at result-ingest; `explains` reconstruct
187
- * why the fan-out was the width it was.
188
- */
189
- export const DispatchAdmissionSchema = z
190
- .object({
191
- granted_packet_ids: z.array(z.string()),
192
- declared_cap: z.number().int().min(1).nullable(),
193
- leases: z.array(AdmissionGrantSchema),
194
- explains: z.array(AdmissionExplainSchema),
195
- })
196
- .strict();
197
- /** Default capability gate: the pool's window must fit the packet's reservation. */
198
- function defaultCapable(pool, packet) {
199
- if (pool.capacityTokens === Number.POSITIVE_INFINITY)
200
- return true;
201
- if (typeof pool.capacityTokens !== "number" ||
202
- !Number.isFinite(pool.capacityTokens) ||
203
- pool.capacityTokens <= 0) {
204
- return false;
205
- }
206
- return pool.capacityTokens >= packet.cost;
207
- }
208
- /**
209
- * {@link buildCapabilityFloorCapable} with the per-(pool, packet) de-duplication its
210
- * reporters all need — the predicate is re-evaluated as the loop rescans, so a raw
211
- * `onFailOpen` fires repeatedly for one routing decision.
212
- *
213
- * Single-sourced because the dedup was audit's alone: remediate passed no reporter at
214
- * all, so on that draw an unranked pool admitting `deep` work was completely SILENT —
215
- * and silence is exactly what let the unwired `marshal.ts` schedule go unnoticed. Both
216
- * draws now report through one core ([[dissolve-auditor-remediator-distinction]]); a
217
- * fail-open is a routing fact, not an audit-only concern.
218
- */
219
- export function buildObservedCapabilityFloorCapable(pools, onFailOpen) {
220
- const seen = new Set();
221
- return buildCapabilityFloorCapable(pools, (info) => {
222
- // Structured key: pool and packet ids are opaque strings, so a printable separator
223
- // could occur inside one and collide two distinct pairs into a single key —
224
- // silently suppressing a real fail-open report. JSON of the pair cannot collide.
225
- const key = JSON.stringify([info.poolId, info.packetId]);
226
- if (seen.has(key))
227
- return;
228
- seen.add(key);
229
- onFailOpen(info);
230
- });
231
- }
232
- export function buildCapabilityFloorCapable(pools, onFailOpen, isAvailable) {
233
- // Tercile-band the scored pools once per batch (deterministic: score asc, poolId tiebreak).
234
- const scored = pools
235
- .filter((p) => typeof p.capabilityScore === "number" && Number.isFinite(p.capabilityScore))
236
- .sort((a, b) => a.capabilityScore - b.capabilityScore ||
237
- a.poolId.localeCompare(b.poolId));
238
- const scoreBand = new Map();
239
- scored.forEach((p, i) => {
240
- scoreBand.set(p.poolId, Math.floor((3 * i) / scored.length));
241
- });
242
- const NEUTRAL_ORDINAL = tierRank(undefined); // the fallback tier — carries no information
243
- const bandOf = (pool) => {
244
- const fromScore = scoreBand.get(pool.poolId);
245
- if (fromScore !== undefined)
246
- return fromScore;
247
- // No score: a non-neutral ordinal is a real declared/roster rank → coarse band.
248
- // (A genuinely-DECLARED `standard` rank is indistinguishable from the fallback
249
- // here — both are the neutral ordinal — so declared-standard pools are treated
250
- // as unknown/fail-open. Deliberate: representing "declared vs defaulted" would
251
- // need rank provenance on the summary; fail-open is the safe direction.)
252
- if (pool.capabilityRank !== NEUTRAL_ORDINAL)
253
- return 2 - Math.min(pool.capabilityRank, 2);
254
- return null; // unknown — fail open
255
- };
256
- // The batch's BEST available band — the floor is RELATIVE all the way down
257
- // (C-review F3): `deep` means "the most capable band available", not "band 0 or
258
- // nothing". Without this, an all-small ordinal roster gives every deep packet an
259
- // empty candidate set → a `no_capable_pool` wall that step E rightly calls
260
- // structural/permanent — a livelock the floor itself manufactured. The scored
261
- // path already behaves this way (n=1 scored pool = band 0 by construction).
262
- //
263
- // "Available" is LIVE, not a build-time snapshot (zero-spill fix, live incident
264
- // 2026-07-22): when the caller supplies `isAvailable`, the best band is
265
- // re-derived per evaluation over pools still available. A static snapshot kept
266
- // holding the floor at a 429-exhausted pool's band, so every surviving
267
- // lower-band sibling failed `capable` and ~140 packets stranded as
268
- // `no_fitting_pool` without one sibling attempt. Without the callback (host
269
- // admission path — pools are re-banded per batch) behavior is unchanged. If
270
- // every banded pool is unavailable the floor goes inert (fail-open) — the
271
- // availability filters exclude those pools regardless, and a floor with no
272
- // live reference point has no signal to give.
273
- const bandedPools = pools
274
- .map((p) => ({ poolId: p.poolId, band: bandOf(p) }))
275
- .filter((e) => e.band !== null);
276
- const anyBanded = bandedPools.length > 0;
277
- const bestAvailableBand = () => {
278
- const available = bandedPools.filter((e) => isAvailable?.(e.poolId) !== false);
279
- if (available.length === 0)
280
- return anyBanded ? Number.POSITIVE_INFINITY : 0;
281
- return Math.min(...available.map((e) => e.band));
282
- };
283
- const FLOOR_MAX_BAND = { deep: 0, standard: 1, small: 2 };
284
- return (pool, packet) => {
285
- if (!defaultCapable(pool, packet))
286
- return false;
287
- const tier = packet.requiredTier;
288
- if (!tier || tier === "small")
289
- return true;
290
- const band = bandOf(pool);
291
- if (band === null) {
292
- // Unknown capability: fail-open, never a block. Record it ONLY when the batch
293
- // has at least one banded pool (C-review F2) — with zero capability data the
294
- // floor is globally inert and there is no routing choice to flag; recording
295
- // would spam a warning per packet on every ordinary single-host wave.
296
- if (anyBanded) {
297
- onFailOpen?.({ poolId: pool.poolId, packetId: packet.id, requiredTier: tier });
298
- }
299
- return true;
300
- }
301
- return band <= Math.max(FLOOR_MAX_BAND[tier], bestAvailableBand());
302
- };
303
- }
304
- /**
305
- * The in-process engine's draw over the ONE capability-floor implementation
306
- * ({@link buildCapabilityFloorCapable}) — adapts the engine's `CapacityPool` shape
307
- * (F4) via the same signals the admission summaries carry (`rank` → tier ordinal,
308
- * `declaredCapabilityRank` → raw score), so the engine and the host path band
309
- * pools identically and cannot drift. Size-fit stays the engine's own
310
- * `doesNotFitContext` gate, so the stub's `capacityTokens` is +Infinity (inert
311
- * here). Fail-open all the way down: an unknown pool id, like unknown capability,
312
- * never blocks.
313
- */
314
- export function buildCapacityPoolCapabilityFloor(pools, onFailOpen, isAvailable) {
315
- // Capability-gate stubs only — these never reach `admit`, so the metering fields
316
- // are inert placeholders rather than a second (drifting) derivation of them.
317
- const stubs = pools.map((p) => ({
318
- poolId: p.id,
319
- resourceKey: p.id,
320
- budget: Number.POSITIVE_INFINITY,
321
- accountKey: p.id,
322
- windowBudgets: [],
323
- declaredCap: null,
324
- costRank: 0,
325
- capabilityRank: tierRank(p.rank),
326
- capabilityScore: p.declaredCapabilityRank ?? null,
327
- capacityTokens: Number.POSITIVE_INFINITY,
328
- }));
329
- const byId = new Map(stubs.map((s) => [s.poolId, s]));
330
- const floor = buildCapabilityFloorCapable(stubs, onFailOpen, isAvailable);
331
- return (poolId, packet) => {
332
- const stub = byId.get(poolId);
333
- if (!stub)
334
- return true; // pool outside the banded set — no signal, fail open
335
- return floor(stub, {
336
- id: packet.id,
337
- cost: 0,
338
- complexity: 0,
339
- ...(packet.requiredTier ? { requiredTier: packet.requiredTier } : {}),
340
- });
341
- };
342
- }
343
- /**
344
- * Finer capability tiebreak on the raw registry score (LOWER = more capable), consulted
345
- * only after the coarse tier ordinal has tied. A present score sorts before an absent
346
- * one; both absent ⇒ 0 (fall through to the next tiebreak). Never a primary axis — it
347
- * only refines cost-equal, same-tier pools (e.g. proxy-sourced models on one tier).
348
- */
349
- function capabilityScoreCmp(a, b) {
350
- const av = typeof a.capabilityScore === "number" && Number.isFinite(a.capabilityScore) ? a.capabilityScore : null;
351
- const bv = typeof b.capabilityScore === "number" && Number.isFinite(b.capabilityScore) ? b.capabilityScore : null;
352
- if (av !== null && bv !== null)
353
- return av - bv; // lower = more capable, sorts first
354
- if (av !== null)
355
- return -1; // present before absent
356
- if (bv !== null)
357
- return 1;
358
- return 0;
359
- }
360
- /** Cost-first order: cheapest first, ties toward the more capable pool (tier, then raw score). */
361
- function costFirstCmp(a, b) {
362
- return a.costRank - b.costRank || b.capabilityRank - a.capabilityRank || capabilityScoreCmp(a, b);
363
- }
364
- /** Deterministic tiebreak so equal-key orderings are stable across processes. */
365
- function poolIdCmp(a, b) {
366
- return a.poolId < b.poolId ? -1 : a.poolId > b.poolId ? 1 : 0;
367
- }
368
- /**
369
- * Admit as many packets as budget + declared caps allow this pass, routing each to
370
- * the cheapest capable pool with headroom. Every admission RESERVES the packet's
371
- * cost against the shared ledger under its lock, so co-located dispatch loops on one
372
- * account cannot collectively over-admit. Returns the granted set (the host
373
- * dispatches exactly these), the explain trail, and the blocked remainder.
374
- *
375
- * A pool's declared in-flight cap is enforced by COUNT of its outstanding ledger
376
- * leases (cross-process) plus this batch's grants — the only place an explicit
377
- * agent-count exists (a verbatim environment limit), never a computed concurrency.
378
- */
379
- export async function admitBatch(input) {
380
- const capable = input.capable ?? defaultCapable;
381
- const granted = [];
382
- const explains = [];
383
- const blocked = [];
384
- // Seed per-pool in-flight COUNT from the ledger (other consumers' live leases),
385
- // so a declared cap accounts for cross-process in-flight, then add this batch's.
386
- //
387
- // ⚠ Count DISTINCT lease ids, not lease rows. A multi-constraint admission writes
388
- // one row PER WINDOW under the same lease id, so counting rows would divide a
389
- // pool's declared cap by its window count (a 2-window account pool with a declared
390
- // cap of 4 would admit 2). The cap is a COUNT OF IN-FLIGHT REQUESTS and must be
391
- // passed verbatim regardless of how many allowances each request meters against.
392
- const countByPool = new Map();
393
- try {
394
- const snapshot = await input.ledger.snapshot();
395
- const seenByPool = new Map();
396
- for (const leases of Object.values(snapshot)) {
397
- for (const lease of leases) {
398
- let seen = seenByPool.get(lease.poolId);
399
- if (!seen) {
400
- seen = new Set();
401
- seenByPool.set(lease.poolId, seen);
402
- }
403
- seen.add(lease.leaseId);
404
- }
405
- }
406
- for (const [poolId, seen] of seenByPool)
407
- countByPool.set(poolId, seen.size);
408
- }
409
- catch {
410
- // Degrade-safe: an unreadable ledger just means cap counting starts at 0.
411
- }
412
- for (const packet of input.packets) {
413
- // Capability is a hard floor; relay-owned ordering/failover happens behind each
414
- // broker pool, while independently declared pools remain cheapest-capable-first.
415
- const candidates = input.pools
416
- .filter((pool) => capable(pool, packet))
417
- .sort((a, b) => costFirstCmp(a, b) || poolIdCmp(a, b));
418
- if (candidates.length === 0) {
419
- explains.push({
420
- packet_id: packet.id,
421
- pool_id: null,
422
- admitted: false,
423
- reason: "no_capable_pool",
424
- constraints: [],
425
- binding: null,
426
- attempts: [],
427
- cost: packet.cost,
428
- });
429
- blocked.push(packet.id);
430
- continue;
431
- }
432
- let placed = false;
433
- let lastReason = "budget_exhausted";
434
- let lastPool = candidates[0];
435
- // The refused-consultation trail (legibility): every pool the walk tried and
436
- // passed over, with why — the decisive pool's data lands on the explain
437
- // record itself, never duplicated here.
438
- const attempts = [];
439
- // The decisive ledger decision on a total refusal (the LAST pool's), so the
440
- // explain carries the full constraint-outcome array it was decided on.
441
- let lastDecision = null;
442
- for (const pool of candidates) {
443
- // Effective in-flight cap = the declared hard cap, TIGHTENED at cold start to a
444
- // TOKEN-AWARE calibration batch (never a flat magic count). `pool.budget` is
445
- // `remaining_token_budget ?? +Infinity` (apiPool.ts): when it is still a real
446
- // finite number (a SIBLING window is the uncalibrated one), size the batch to
447
- // what conservatively fits THIS packet's own cost estimate; when it is
448
- // genuinely +Infinity (no window has any real budget yet — e.g. a percent-only
449
- // quota source pre-slope), fall back to the small slope-learning probe. Without
450
- // this the host grant would fan out the ENTIRE frontier — at arbitrary per-packet
451
- // size — before the tokens-per-percent slope can be observed: the scheduler's
452
- // `max_concurrent` cold-start clamp does NOT reach the grant, which is what the
453
- // host actually obeys. Only affects `grantLeases:true` (host path); the in-process
454
- // driver returns before admitBatch.
455
- const coldStartBatch = pool.calibrating
456
- ? deriveColdStartAdmissionBatch({ availableBudget: pool.budget, perPacketTokenEstimate: packet.cost })
457
- : null;
458
- const effectiveCap = coldStartBatch != null ? Math.min(pool.declaredCap ?? coldStartBatch, coldStartBatch) : pool.declaredCap;
459
- if (effectiveCap != null && (countByPool.get(pool.poolId) ?? 0) >= effectiveCap) {
460
- attempts.push({
461
- pool_id: pool.poolId,
462
- reason: "cap_reached",
463
- constraints: [],
464
- in_flight_before: countByPool.get(pool.poolId) ?? 0,
465
- cap: effectiveCap,
466
- });
467
- lastReason = "cap_reached";
468
- lastPool = pool;
469
- lastDecision = null;
470
- continue;
471
- }
472
- // Reserve against EVERY window this pool must fit inside — the account-scoped
473
- // ones shared with sibling models on the same credential, plus any scoped to
474
- // this model alone. This is where N models on one account stop each admitting
475
- // against their own copy of one allowance — PROVIDED the pools carry a shared
476
- // , which is decided at the producer () and
477
- // merely consumed here. A pool whose source cannot be attributed to a credential
478
- // falls back to metering alone.
479
- const { constraints, unpriced } = windowConstraintsFor(pool.poolId, pool.accountKey, pool.windowBudgets, packet.cost, pool.budget);
480
- if (unpriced.length > 0) {
481
- // A window that cannot price this draw (percent window, no learned slope) must
482
- // NOT be dropped from the set — admitting on the remaining constraints would
483
- // meter the packet against fewer allowances than actually apply to it, which is
484
- // the fail-open direction. Reported as its own reason: nothing is exhausted.
485
- //
486
- // ⚠ NOT reachable from the in-repo producer: deriveTokenBudget drops an
487
- // unpriceable window BEFORE it enters window_budgets and sets
488
- // instead, so every emitted percent window carries a positive slope. This
489
- // guards a summary arriving over the WIRE, where is
490
- // schema-optional. Keep it fail-CLOSED: if it ever became producer-reachable
491
- // for a calibrating pool it would livelock (blocked ⇒ no dispatch ⇒ no delta
492
- // sample ⇒ no slope ⇒ blocked), so that producer change must come with a
493
- // calibration escape, not a relaxation here.
494
- attempts.push({
495
- pool_id: pool.poolId,
496
- reason: "window_uncalibrated",
497
- constraints: [],
498
- unpriced_windows: unpriced.map((w) => w.label),
499
- });
500
- lastReason = "window_uncalibrated";
501
- lastPool = pool;
502
- lastDecision = null;
503
- continue;
504
- }
505
- const decision = await input.ledger.admit({
506
- constraints,
507
- poolId: pool.poolId,
508
- ...(input.leaseTtlMs != null ? { leaseTtlMs: input.leaseTtlMs } : {}),
509
- });
510
- // The full per-constraint evaluation (every key consulted, its headroom,
511
- // this draw's cost against it, which cleared) — carried onto the explain
512
- // record whether the decision admits or refuses. Non-finite headroom is
513
- // genuinely unbounded and normalizes to `null` (the schema must match the
514
- // literal bytes JSON.stringify puts on disk).
515
- const outcomeRecords = toConstraintOutcomeRecords(decision.constraints);
516
- const bindingRecord = decision.binding
517
- ? toConstraintOutcomeRecords([decision.binding])[0]
518
- : null;
519
- if (decision.admitted && decision.leaseId) {
520
- granted.push({
521
- packet_id: packet.id,
522
- pool_id: pool.poolId,
523
- resource_keys: [...new Set(decision.constraints.map((o) => o.resourceKey))],
524
- lease_id: decision.leaseId,
525
- cost: packet.cost,
526
- });
527
- countByPool.set(pool.poolId, (countByPool.get(pool.poolId) ?? 0) + 1);
528
- explains.push({
529
- packet_id: packet.id,
530
- pool_id: pool.poolId,
531
- admitted: true,
532
- reason: "admitted",
533
- constraints: outcomeRecords,
534
- binding: bindingRecord,
535
- attempts,
536
- cost: packet.cost,
537
- });
538
- placed = true;
539
- break;
540
- }
541
- attempts.push({
542
- pool_id: pool.poolId,
543
- reason: "budget_exhausted",
544
- constraints: outcomeRecords,
545
- });
546
- lastReason = "budget_exhausted";
547
- lastPool = pool;
548
- lastDecision = { constraints: outcomeRecords, binding: bindingRecord };
549
- }
550
- if (!placed) {
551
- // The decisive (last) pool's refused consultation is carried on the record
552
- // itself — pop it off the trail so the two never duplicate, and lift its
553
- // reason-specific extras (cap counts / unpriceable labels) onto the record.
554
- const decisive = attempts.length > 0 && attempts[attempts.length - 1].pool_id === lastPool.poolId
555
- ? attempts.pop()
556
- : null;
557
- explains.push({
558
- packet_id: packet.id,
559
- pool_id: lastPool.poolId,
560
- admitted: false,
561
- reason: lastReason,
562
- constraints: lastDecision?.constraints ?? [],
563
- binding: lastDecision?.binding ?? null,
564
- attempts,
565
- ...(decisive?.in_flight_before != null ? { in_flight_before: decisive.in_flight_before } : {}),
566
- ...(decisive?.cap != null ? { cap: decisive.cap } : {}),
567
- ...(decisive?.unpriced_windows ? { unpriced_windows: decisive.unpriced_windows } : {}),
568
- cost: packet.cost,
569
- });
570
- blocked.push(packet.id);
571
- }
572
- }
573
- return { granted, explains, blocked };
574
- }
575
- /**
576
- * The plan-only display grant's explain record: no lease exists BY DESIGN — the
577
- * in-process rolling engine admits + leases per-packet at dispatch time, and its
578
- * decisions land in the engine decision log. This record exists so a non-empty
579
- * decision round can never present an empty explains array (the legibility
580
- * invariant's "a decision path that writes no explain is itself a defect").
581
- */
582
- function plannedExplain(candidate) {
583
- return {
584
- packet_id: candidate.id,
585
- pool_id: null,
586
- admitted: true,
587
- reason: "planned",
588
- constraints: [],
589
- binding: null,
590
- attempts: [],
591
- cost: candidate.cost,
592
- };
593
- }
594
- /**
595
- * Build the `DispatchAdmission` contract block both orchestrators embed in their
596
- * dispatch-quota — the single-sourced host-path admission derivation (no per-tool
597
- * copy that could drift). Computes each packet's envelope reservation
598
- * (`estimatePacketCost` with the declared output cap), derives the surfaced declared
599
- * cap (the most-constraining pool's in-flight cap), and either GRANTS via
600
- * {@link admitBatch} (host-subagent path, `grantLeases: true` — leases persist for
601
- * reconcile at ingest) or returns a plan-only block listing every candidate
602
- * (`grantLeases: false` — the in-process rolling engine leases per-packet itself,
603
- * so a host grant here would double-count).
604
- */
605
- export async function computeDispatchAdmission(input) {
606
- const candidates = input.packets.map((p) => ({
607
- id: p.id,
608
- cost: estimatePacketCost({ inputEstimate: p.inputTokens, declaredOutputCap: input.outputCap }).cost,
609
- complexity: p.complexity,
610
- ...(p.requiredTier ? { requiredTier: p.requiredTier } : {}),
611
- }));
612
- const declaredCap = input.pools.reduce((min, p) => (p.declaredCap == null ? min : min == null ? p.declaredCap : Math.min(min, p.declaredCap)), null);
613
- if (!input.grantLeases) {
614
- // Plan-only path (in-process engine — it admits + leases per packet itself).
615
- // No leases, but the capability FLOOR still applies (F4): the contract must not
616
- // display a grant the engine's floor will refuse to dispatch. Floor ONLY — size
617
- // fit stays the engine's own `doesNotFitContext` gate (declared per-pool caps),
618
- // so a size refusal is never mislabeled `no_capable_pool` here. Residual (named,
619
- // display-only): the engine can still size-refuse a displayed grant onto a
620
- // capped pool; the packet remains dispatchable to uncapped pools.
621
- // An EMPTY pool set means no capacity summary reached admission, not "nothing
622
- // is capable" — grant all, as before the floor existed. Every grant still
623
- // writes its `planned` explain: an empty explains array on a non-empty
624
- // decision round is itself a defect (the live 144-granted-empty incident).
625
- if (input.pools.length === 0) {
626
- return {
627
- granted_packet_ids: candidates.map((c) => c.id),
628
- declared_cap: declaredCap,
629
- leases: [],
630
- explains: candidates.map((c) => plannedExplain(c)),
631
- };
632
- }
633
- // Same-pool conjunction of the two per-packet engine axes: capability floor
634
- // (banded over size-neutralized stubs, mirroring
635
- // `buildCapacityPoolCapabilityFloor`) ∧ envelope fit (`defaultCapable`). Built
636
- // here from the pools — never `input.capable`, whose composed predicate can't
637
- // separate the axes. The RELATIVE floor never refuses every pool (fail-open +
638
- // the best band is always eligible), so a total refusal is always a size fact:
639
- // labeled `packet_oversized`, never `no_capable_pool` (which would misread a
640
- // sizing problem as a capability one — adversarial-review F1).
641
- const sizeNeutralPools = input.pools.map((p) => ({
642
- ...p,
643
- capacityTokens: Number.POSITIVE_INFINITY,
644
- }));
645
- const floorOnly = buildCapabilityFloorCapable(sizeNeutralPools);
646
- const grantedIds = [];
647
- const explains = [];
648
- for (const candidate of candidates) {
649
- const granted = input.pools.some((pool, i) => floorOnly(sizeNeutralPools[i], candidate) && defaultCapable(pool, candidate));
650
- if (granted) {
651
- grantedIds.push(candidate.id);
652
- explains.push(plannedExplain(candidate));
653
- }
654
- else {
655
- const eligibleUnknownCapacity = input.pools.some((pool, i) => floorOnly(sizeNeutralPools[i], candidate) &&
656
- (pool.capacityTokens == null ||
657
- (!Number.isFinite(pool.capacityTokens) &&
658
- pool.capacityTokens !== Number.POSITIVE_INFINITY) ||
659
- pool.capacityTokens <= 0));
660
- explains.push({
661
- packet_id: candidate.id,
662
- pool_id: null,
663
- admitted: false,
664
- reason: eligibleUnknownCapacity ? "no_capable_pool" : "packet_oversized",
665
- constraints: [],
666
- binding: null,
667
- attempts: [],
668
- cost: candidate.cost,
669
- });
670
- }
671
- }
672
- return { granted_packet_ids: grantedIds, declared_cap: declaredCap, leases: [], explains };
673
- }
674
- const admit = await admitBatch({
675
- packets: candidates,
676
- pools: input.pools,
677
- ledger: input.ledger,
678
- // Host-wave grants live for the WAVE (minutes of subagent work before
679
- // ingest reconciles them), not the ledger's seconds-scale default — an
680
- // expired lease frees both budget and the declared-cap count to a
681
- // concurrent co-located admitter mid-wave (the host-path lease-TTL fix).
682
- leaseTtlMs: DISPATCH_LEASE_TTL_MS,
683
- ...(input.capable ? { capable: input.capable } : {}),
684
- });
685
- return {
686
- granted_packet_ids: admit.granted.map((g) => g.packet_id),
687
- declared_cap: declaredCap,
688
- leases: admit.granted,
689
- explains: admit.explains,
690
- };
691
- }
692
- //# sourceMappingURL=admissionLoop.js.map