audit-tools 0.34.41 → 0.35.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 (328) hide show
  1. package/dist/audit/cli/args.d.ts +6 -0
  2. package/dist/audit/cli/args.d.ts.map +1 -1
  3. package/dist/audit/cli/args.js +21 -4
  4. package/dist/audit/cli/args.js.map +1 -1
  5. package/dist/audit/cli/auditStep.d.ts +6 -15
  6. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  7. package/dist/audit/cli/auditStep.js +1 -1
  8. package/dist/audit/cli/auditStep.js.map +1 -1
  9. package/dist/audit/cli/dispatch/hostFanoutGate.d.ts +21 -61
  10. package/dist/audit/cli/dispatch/hostFanoutGate.d.ts.map +1 -1
  11. package/dist/audit/cli/dispatch/hostFanoutGate.js +18 -167
  12. package/dist/audit/cli/dispatch/hostFanoutGate.js.map +1 -1
  13. package/dist/audit/cli/dispatch/packetFilter.d.ts +2 -2
  14. package/dist/audit/cli/dispatch/packetFilter.d.ts.map +1 -1
  15. package/dist/audit/cli/dispatch/packetFilter.js +3 -1
  16. package/dist/audit/cli/dispatch/packetFilter.js.map +1 -1
  17. package/dist/audit/cli/dispatch/quotaPool.d.ts +2 -14
  18. package/dist/audit/cli/dispatch/quotaPool.d.ts.map +1 -1
  19. package/dist/audit/cli/dispatch/quotaPool.js +16 -6
  20. package/dist/audit/cli/dispatch/quotaPool.js.map +1 -1
  21. package/dist/audit/cli/dispatch/tierRouting.d.ts +2 -2
  22. package/dist/audit/cli/dispatch/tokenUsageObservation.d.ts.map +1 -1
  23. package/dist/audit/cli/dispatch/tokenUsageObservation.js +10 -2
  24. package/dist/audit/cli/dispatch/tokenUsageObservation.js.map +1 -1
  25. package/dist/audit/cli/dispatch.d.ts +14 -3
  26. package/dist/audit/cli/dispatch.d.ts.map +1 -1
  27. package/dist/audit/cli/dispatch.js +87 -65
  28. package/dist/audit/cli/dispatch.js.map +1 -1
  29. package/dist/audit/cli/forceSynthesisCommand.d.ts.map +1 -1
  30. package/dist/audit/cli/forceSynthesisCommand.js +9 -1
  31. package/dist/audit/cli/forceSynthesisCommand.js.map +1 -1
  32. package/dist/audit/cli/hybridDispatch.d.ts +4 -9
  33. package/dist/audit/cli/hybridDispatch.d.ts.map +1 -1
  34. package/dist/audit/cli/hybridDispatch.js +1 -1
  35. package/dist/audit/cli/hybridDispatch.js.map +1 -1
  36. package/dist/audit/cli/lineIndex.d.ts +2 -0
  37. package/dist/audit/cli/lineIndex.d.ts.map +1 -1
  38. package/dist/audit/cli/lineIndex.js +4 -0
  39. package/dist/audit/cli/lineIndex.js.map +1 -1
  40. package/dist/audit/cli/nextStepCommand.d.ts +0 -26
  41. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  42. package/dist/audit/cli/nextStepCommand.js +14 -358
  43. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  44. package/dist/audit/cli/nextStepHelpers.d.ts +5 -16
  45. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  46. package/dist/audit/cli/nextStepHelpers.js +27 -157
  47. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  48. package/dist/audit/cli/quotaCommand.d.ts.map +1 -1
  49. package/dist/audit/cli/quotaCommand.js +1 -5
  50. package/dist/audit/cli/quotaCommand.js.map +1 -1
  51. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  52. package/dist/audit/cli/reviewRun.js +58 -23
  53. package/dist/audit/cli/reviewRun.js.map +1 -1
  54. package/dist/audit/cli/rollingAuditDispatch.d.ts +1 -1
  55. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  56. package/dist/audit/cli/semanticReviewStep.js +35 -54
  57. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  58. package/dist/audit/cli/steps.d.ts +4 -4
  59. package/dist/audit/cli/steps.d.ts.map +1 -1
  60. package/dist/audit/cli/steps.js +0 -1
  61. package/dist/audit/cli/steps.js.map +1 -1
  62. package/dist/audit/cli/workPartitionRuntime.d.ts +11 -0
  63. package/dist/audit/cli/workPartitionRuntime.d.ts.map +1 -0
  64. package/dist/audit/cli/workPartitionRuntime.js +39 -0
  65. package/dist/audit/cli/workPartitionRuntime.js.map +1 -0
  66. package/dist/audit/contracts/wrapperResponse.d.ts +6 -6
  67. package/dist/audit/io/artifacts.d.ts +1 -3
  68. package/dist/audit/io/artifacts.d.ts.map +1 -1
  69. package/dist/audit/io/artifacts.js +0 -3
  70. package/dist/audit/io/artifacts.js.map +1 -1
  71. package/dist/audit/orchestrator/advance.d.ts.map +1 -1
  72. package/dist/audit/orchestrator/advance.js +0 -35
  73. package/dist/audit/orchestrator/advance.js.map +1 -1
  74. package/dist/audit/orchestrator/advanceTypes.d.ts +4 -63
  75. package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
  76. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  77. package/dist/audit/orchestrator/executorRunners.js +9 -12
  78. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  79. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  80. package/dist/audit/orchestrator/executors.js +0 -5
  81. package/dist/audit/orchestrator/executors.js.map +1 -1
  82. package/dist/audit/orchestrator/hostInputPause.d.ts +1 -1
  83. package/dist/audit/orchestrator/hostInputPause.js +1 -1
  84. package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
  85. package/dist/audit/orchestrator/ingestionExecutors.js +4 -1
  86. package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
  87. package/dist/audit/orchestrator/intakeExecutors.d.ts +1 -65
  88. package/dist/audit/orchestrator/intakeExecutors.d.ts.map +1 -1
  89. package/dist/audit/orchestrator/intakeExecutors.js +3 -425
  90. package/dist/audit/orchestrator/intakeExecutors.js.map +1 -1
  91. package/dist/audit/orchestrator/nextStep.d.ts +0 -13
  92. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  93. package/dist/audit/orchestrator/nextStep.js +0 -7
  94. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  95. package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
  96. package/dist/audit/orchestrator/planningExecutors.js +4 -1
  97. package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
  98. package/dist/audit/orchestrator/rollingDispatch.d.ts +1 -1
  99. package/dist/audit/orchestrator/rollingDispatch.d.ts.map +1 -1
  100. package/dist/audit/orchestrator/rollingDispatch.js +5 -4
  101. package/dist/audit/orchestrator/rollingDispatch.js.map +1 -1
  102. package/dist/audit/orchestrator/state.d.ts +0 -39
  103. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  104. package/dist/audit/orchestrator/state.js +3 -29
  105. package/dist/audit/orchestrator/state.js.map +1 -1
  106. package/dist/audit/orchestrator/synthesisExecutors.d.ts +8 -2
  107. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  108. package/dist/audit/orchestrator/synthesisExecutors.js +7 -5
  109. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  110. package/dist/audit/reporting/findingIdentity.d.ts +2 -2
  111. package/dist/audit/reporting/findingIdentity.js +2 -2
  112. package/dist/audit/reporting/synthesis.d.ts +7 -1
  113. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  114. package/dist/audit/reporting/synthesis.js +27 -7
  115. package/dist/audit/reporting/synthesis.js.map +1 -1
  116. package/dist/audit/reporting/workBlocks.d.ts +14 -3
  117. package/dist/audit/reporting/workBlocks.d.ts.map +1 -1
  118. package/dist/audit/reporting/workBlocks.js +163 -73
  119. package/dist/audit/reporting/workBlocks.js.map +1 -1
  120. package/dist/audit/types/activeDispatch.d.ts +8 -7
  121. package/dist/audit/types/activeDispatch.d.ts.map +1 -1
  122. package/dist/audit/types/auditState.d.ts +6 -6
  123. package/dist/audit/types/externalAnalyzer.d.ts +6 -6
  124. package/dist/audit/validation/auditResults.d.ts.map +1 -1
  125. package/dist/audit/validation/auditResults.js +6 -1
  126. package/dist/audit/validation/auditResults.js.map +1 -1
  127. package/dist/remediate/contractPipeline/phaseCut.d.ts +8 -0
  128. package/dist/remediate/contractPipeline/phaseCut.d.ts.map +1 -1
  129. package/dist/remediate/contractPipeline/phaseCut.js +63 -0
  130. package/dist/remediate/contractPipeline/phaseCut.js.map +1 -1
  131. package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts.map +1 -1
  132. package/dist/remediate/contractPipeline/phaseCutArtifact.js +5 -3
  133. package/dist/remediate/contractPipeline/phaseCutArtifact.js.map +1 -1
  134. package/dist/remediate/phases/plan.d.ts.map +1 -1
  135. package/dist/remediate/phases/plan.js +35 -12
  136. package/dist/remediate/phases/plan.js.map +1 -1
  137. package/dist/remediate/steps/contractPipeline.d.ts +6 -2
  138. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  139. package/dist/remediate/steps/contractPipeline.js +90 -6
  140. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  141. package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
  142. package/dist/remediate/steps/contractPipelinePrompts.js +4 -2
  143. package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
  144. package/dist/remediate/steps/dispatch/marshal.d.ts +6 -0
  145. package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -1
  146. package/dist/remediate/steps/dispatch/marshal.js +16 -17
  147. package/dist/remediate/steps/dispatch/marshal.js.map +1 -1
  148. package/dist/remediate/steps/dispatch/waveScheduling.d.ts +7 -15
  149. package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +1 -1
  150. package/dist/remediate/steps/dispatch/waveScheduling.js +26 -19
  151. package/dist/remediate/steps/dispatch/waveScheduling.js.map +1 -1
  152. package/dist/remediate/steps/nextStep.d.ts +5 -7
  153. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  154. package/dist/remediate/steps/nextStep.js +100 -82
  155. package/dist/remediate/steps/nextStep.js.map +1 -1
  156. package/dist/remediate/steps/rollingSession.d.ts +2 -1
  157. package/dist/remediate/steps/rollingSession.d.ts.map +1 -1
  158. package/dist/remediate/steps/rollingSession.js +14 -8
  159. package/dist/remediate/steps/rollingSession.js.map +1 -1
  160. package/dist/remediate/steps/sessionConfigLoad.d.ts +3 -2
  161. package/dist/remediate/steps/sessionConfigLoad.d.ts.map +1 -1
  162. package/dist/remediate/steps/sessionConfigLoad.js +4 -10
  163. package/dist/remediate/steps/sessionConfigLoad.js.map +1 -1
  164. package/dist/remediate/validation/contractPipeline.d.ts +1 -1
  165. package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
  166. package/dist/remediate/validation/contractPipeline.js +7 -1
  167. package/dist/remediate/validation/contractPipeline.js.map +1 -1
  168. package/dist/remediate/validation/contractPipelineGates.d.ts +8 -0
  169. package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
  170. package/dist/remediate/validation/contractPipelineGates.js +89 -0
  171. package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
  172. package/dist/shared/config/resolveSessionConfig.d.ts.map +1 -1
  173. package/dist/shared/config/resolveSessionConfig.js +6 -5
  174. package/dist/shared/config/resolveSessionConfig.js.map +1 -1
  175. package/dist/shared/decompose/workPartition.d.ts +66 -0
  176. package/dist/shared/decompose/workPartition.d.ts.map +1 -0
  177. package/dist/shared/decompose/workPartition.js +523 -0
  178. package/dist/shared/decompose/workPartition.js.map +1 -0
  179. package/dist/shared/dispatch/admissionLoop.d.ts +5 -44
  180. package/dist/shared/dispatch/admissionLoop.d.ts.map +1 -1
  181. package/dist/shared/dispatch/admissionLoop.js +20 -82
  182. package/dist/shared/dispatch/admissionLoop.js.map +1 -1
  183. package/dist/shared/dispatch/coordinator.d.ts +5 -5
  184. package/dist/shared/dispatch/coordinator.d.ts.map +1 -1
  185. package/dist/shared/dispatch/coordinator.js +12 -11
  186. package/dist/shared/dispatch/coordinator.js.map +1 -1
  187. package/dist/shared/dispatch/costRank.d.ts +5 -155
  188. package/dist/shared/dispatch/costRank.d.ts.map +1 -1
  189. package/dist/shared/dispatch/costRank.js +2 -179
  190. package/dist/shared/dispatch/costRank.js.map +1 -1
  191. package/dist/shared/dispatch/dispatchQuotaContract.d.ts +37 -38
  192. package/dist/shared/dispatch/dispatchQuotaContract.d.ts.map +1 -1
  193. package/dist/shared/dispatch/dispatchQuotaContract.js +0 -1
  194. package/dist/shared/dispatch/dispatchQuotaContract.js.map +1 -1
  195. package/dist/shared/dispatch/hybridDispatch.d.ts +6 -2
  196. package/dist/shared/dispatch/hybridDispatch.d.ts.map +1 -1
  197. package/dist/shared/dispatch/hybridDispatch.js +1 -1
  198. package/dist/shared/dispatch/hybridDispatch.js.map +1 -1
  199. package/dist/shared/dispatch/rollingDispatch.d.ts +4 -4
  200. package/dist/shared/dispatch/rollingDispatch.d.ts.map +1 -1
  201. package/dist/shared/dispatch/rollingDispatch.js +13 -11
  202. package/dist/shared/dispatch/rollingDispatch.js.map +1 -1
  203. package/dist/shared/dispatch/unifiedRolling.d.ts +2 -2
  204. package/dist/shared/dispatch/unifiedRolling.d.ts.map +1 -1
  205. package/dist/shared/dispatch/unifiedRolling.js +1 -1
  206. package/dist/shared/dispatch/unifiedRolling.js.map +1 -1
  207. package/dist/shared/engine/obligationEngine.d.ts +2 -2
  208. package/dist/shared/friction/stepBoundaryCapture.d.ts +5 -59
  209. package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
  210. package/dist/shared/friction/stepBoundaryCapture.js +11 -107
  211. package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
  212. package/dist/shared/index.d.ts +13 -16
  213. package/dist/shared/index.d.ts.map +1 -1
  214. package/dist/shared/index.js +9 -13
  215. package/dist/shared/index.js.map +1 -1
  216. package/dist/shared/io/stateDir.d.ts +2 -2
  217. package/dist/shared/io/stateDir.js +2 -2
  218. package/dist/shared/providers/auditorSources.d.ts +10 -84
  219. package/dist/shared/providers/auditorSources.d.ts.map +1 -1
  220. package/dist/shared/providers/auditorSources.js +42 -261
  221. package/dist/shared/providers/auditorSources.js.map +1 -1
  222. package/dist/shared/providers/dispatchExclusion.d.ts +22 -0
  223. package/dist/shared/providers/dispatchExclusion.d.ts.map +1 -0
  224. package/dist/shared/providers/dispatchExclusion.js +23 -0
  225. package/dist/shared/providers/dispatchExclusion.js.map +1 -0
  226. package/dist/shared/providers/identity.d.ts +2 -66
  227. package/dist/shared/providers/identity.d.ts.map +1 -1
  228. package/dist/shared/providers/identity.js +2 -72
  229. package/dist/shared/providers/identity.js.map +1 -1
  230. package/dist/shared/providers/providerFactory.d.ts +0 -3
  231. package/dist/shared/providers/providerFactory.d.ts.map +1 -1
  232. package/dist/shared/providers/providerFactory.js +5 -32
  233. package/dist/shared/providers/providerFactory.js.map +1 -1
  234. package/dist/shared/providers/providerPathGuard.d.ts +3 -3
  235. package/dist/shared/providers/providerPathGuard.js +7 -7
  236. package/dist/shared/providers/providerPathGuard.js.map +1 -1
  237. package/dist/shared/quota/apiPool.d.ts +19 -22
  238. package/dist/shared/quota/apiPool.d.ts.map +1 -1
  239. package/dist/shared/quota/apiPool.js +66 -47
  240. package/dist/shared/quota/apiPool.js.map +1 -1
  241. package/dist/shared/quota/capacity.d.ts +29 -24
  242. package/dist/shared/quota/capacity.d.ts.map +1 -1
  243. package/dist/shared/quota/capacity.js +30 -4
  244. package/dist/shared/quota/capacity.js.map +1 -1
  245. package/dist/shared/quota/codexHostConfig.d.ts +6 -13
  246. package/dist/shared/quota/codexHostConfig.d.ts.map +1 -1
  247. package/dist/shared/quota/codexHostConfig.js +8 -14
  248. package/dist/shared/quota/codexHostConfig.js.map +1 -1
  249. package/dist/shared/quota/fileLock.d.ts +7 -0
  250. package/dist/shared/quota/fileLock.d.ts.map +1 -1
  251. package/dist/shared/quota/fileLock.js +32 -4
  252. package/dist/shared/quota/fileLock.js.map +1 -1
  253. package/dist/shared/quota/hostLimits.d.ts +1 -1
  254. package/dist/shared/quota/hostLimits.d.ts.map +1 -1
  255. package/dist/shared/quota/hostLimits.js +8 -11
  256. package/dist/shared/quota/hostLimits.js.map +1 -1
  257. package/dist/shared/quota/hostPool.d.ts +1 -1
  258. package/dist/shared/quota/hostPool.js +2 -2
  259. package/dist/shared/quota/hostPool.js.map +1 -1
  260. package/dist/shared/quota/limits.d.ts.map +1 -1
  261. package/dist/shared/quota/limits.js +30 -26
  262. package/dist/shared/quota/limits.js.map +1 -1
  263. package/dist/shared/quota/scheduler.d.ts +2 -3
  264. package/dist/shared/quota/scheduler.d.ts.map +1 -1
  265. package/dist/shared/quota/scheduler.js +1 -1
  266. package/dist/shared/quota/scheduler.js.map +1 -1
  267. package/dist/shared/quota/types.d.ts +10 -10
  268. package/dist/shared/quota/types.d.ts.map +1 -1
  269. package/dist/shared/quota/types.js +4 -7
  270. package/dist/shared/quota/types.js.map +1 -1
  271. package/dist/shared/repair/brokeredDispatch.d.ts.map +1 -1
  272. package/dist/shared/repair/brokeredDispatch.js +3 -0
  273. package/dist/shared/repair/brokeredDispatch.js.map +1 -1
  274. package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -1
  275. package/dist/shared/reporting/auditDeliverable.js +1 -0
  276. package/dist/shared/reporting/auditDeliverable.js.map +1 -1
  277. package/dist/shared/rolling/pausedState.d.ts +7 -7
  278. package/dist/shared/rolling/pausedState.js +3 -3
  279. package/dist/shared/tokens.d.ts +2 -5
  280. package/dist/shared/tokens.d.ts.map +1 -1
  281. package/dist/shared/tokens.js +15 -15
  282. package/dist/shared/tokens.js.map +1 -1
  283. package/dist/shared/types/auditorDescriptor.d.ts +3 -2
  284. package/dist/shared/types/auditorDescriptor.d.ts.map +1 -1
  285. package/dist/shared/types/auditorDescriptor.js +3 -2
  286. package/dist/shared/types/auditorDescriptor.js.map +1 -1
  287. package/dist/shared/types/finding.d.ts +80 -0
  288. package/dist/shared/types/finding.d.ts.map +1 -1
  289. package/dist/shared/types/finding.js +17 -0
  290. package/dist/shared/types/finding.js.map +1 -1
  291. package/dist/shared/types/sessionConfig.d.ts +5 -5
  292. package/dist/shared/types/sessionConfig.js +1 -1
  293. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  294. package/dist/shared/validation/findingsReport.js +3 -0
  295. package/dist/shared/validation/findingsReport.js.map +1 -1
  296. package/docs/audit-pkg/development.md +3 -2
  297. package/docs/audit-pkg/operator-guide.md +13 -106
  298. package/docs/audit-pkg/product.md +8 -7
  299. package/docs/audit-pkg/release.md +38 -29
  300. package/opencode.json +2 -2
  301. package/package.json +7 -4
  302. package/skills/audit-code/SKILL.md +2 -1
  303. package/skills/audit-code/audit-code.prompt.md +4 -3
  304. package/skills/remediate-code/remediate-code.prompt.md +2 -1
  305. package/dist/audit/cli/providerConfirmationStep.d.ts +0 -106
  306. package/dist/audit/cli/providerConfirmationStep.d.ts.map +0 -1
  307. package/dist/audit/cli/providerConfirmationStep.js +0 -396
  308. package/dist/audit/cli/providerConfirmationStep.js.map +0 -1
  309. package/dist/audit/orchestrator/providerConfirmation.d.ts +0 -25
  310. package/dist/audit/orchestrator/providerConfirmation.d.ts.map +0 -1
  311. package/dist/audit/orchestrator/providerConfirmation.js +0 -60
  312. package/dist/audit/orchestrator/providerConfirmation.js.map +0 -1
  313. package/dist/shared/providers/providerConfirmation.d.ts +0 -141
  314. package/dist/shared/providers/providerConfirmation.d.ts.map +0 -1
  315. package/dist/shared/providers/providerConfirmation.js +0 -420
  316. package/dist/shared/providers/providerConfirmation.js.map +0 -1
  317. package/dist/shared/providers/proxyCatalog.d.ts +0 -158
  318. package/dist/shared/providers/proxyCatalog.d.ts.map +0 -1
  319. package/dist/shared/providers/proxyCatalog.js +0 -658
  320. package/dist/shared/providers/proxyCatalog.js.map +0 -1
  321. package/dist/shared/providers/sharedProviderConfirmation.d.ts +0 -802
  322. package/dist/shared/providers/sharedProviderConfirmation.d.ts.map +0 -1
  323. package/dist/shared/providers/sharedProviderConfirmation.js +0 -1865
  324. package/dist/shared/providers/sharedProviderConfirmation.js.map +0 -1
  325. package/dist/shared/types/providerConfirmation.d.ts +0 -334
  326. package/dist/shared/types/providerConfirmation.d.ts.map +0 -1
  327. package/dist/shared/types/providerConfirmation.js +0 -35
  328. package/dist/shared/types/providerConfirmation.js.map +0 -1
@@ -3,7 +3,7 @@ import { existsSync, statSync } from "node:fs";
3
3
  import { mkdir, readFile, rename } from "node:fs/promises";
4
4
  import { dirname, join, resolve } from "node:path";
5
5
  import { StateStore } from "../state/store.js";
6
- import { discardOnSchemaVersionMismatch, readConfirmedDispatchPolicy, readConfirmedCapabilityRanks, resolveDispatchExclusion, readOptionalJsonFile, readValidatedRepoSessionIntent, stagedAndUntracked, writeJsonFile, writeTextFile, buildAuditDeliverablePair, formatValidationIssues, isRecord, withFsRetry, RunLogger, DISPATCH_PROMPT_HANDOFF_NOTE, renderHostScratchNote, hostScratchDir, renderQuotaCoverageNudge, renderTokenBudgetView, coerceJsonObjectArg, driveRolling, resolveLedgerBudgets, setQuotaStateDir, detectHostDispatchWall, admissionBlockedOnBudget, classifyEmptyGrantCause, reconcileAdmissionLeasesFromQuotaFile, buildQuotaPausedTerminal, interpretFreeFormIntent, advance, decideFrictionTriage, buildFrictionTriageBlock, planHybridDispatch, readSettledPools, addSettledPool, isPoolSettlingOutcome, isInProcessWorkerProvider, sourceByPoolId, classifyProvider, selectDispatchDriver, renderDispatchDriverInstruction, HostSessionQuotaSource, quotaPoolKey, captureStepBoundaryFriction, captureZeroCapacityFriction, captureCostDriftFriction, captureCreditExhaustionFriction, captureQuotaUnclassifiedFriction, captureModelUnavailableFriction, capturePacketTooLargeFriction, createDispatchDecisionLog, LENSES, SEVERITIES, resolveHostProviderName, resolveHostDispatchProviderName, resolveHostDispatchCapability as sharedResolveHostDispatchCapability, resolveAutonomousMode, resolveRollingEngineFlag, DEFAULT_CONTEXT_TOKENS } from "audit-tools/shared";
6
+ import { discardOnSchemaVersionMismatch, buildSelfSpawnExclusion, readOptionalJsonFile, readValidatedRepoSessionIntent, stagedAndUntracked, writeJsonFile, writeTextFile, buildAuditDeliverablePair, formatValidationIssues, isRecord, withFsRetry, RunLogger, DISPATCH_PROMPT_HANDOFF_NOTE, renderHostScratchNote, hostScratchDir, renderQuotaCoverageNudge, renderTokenBudgetView, coerceJsonObjectArg, driveRolling, resolveLedgerBudgets, setQuotaStateDir, detectHostDispatchWall, admissionBlockedOnBudget, classifyEmptyGrantCause, reconcileAdmissionLeasesFromQuotaFile, buildQuotaPausedTerminal, interpretFreeFormIntent, advance, decideFrictionTriage, buildFrictionTriageBlock, planHybridDispatch, readSettledPools, addSettledPool, isPoolSettlingOutcome, isInProcessWorkerProvider, sourceByPoolId, classifyProvider, selectDispatchDriver, renderDispatchDriverInstruction, HostSessionQuotaSource, quotaPoolKey, captureStepBoundaryFriction, captureZeroCapacityFriction, captureCostDriftFriction, captureCreditExhaustionFriction, captureQuotaUnclassifiedFriction, captureModelUnavailableFriction, capturePacketTooLargeFriction, createDispatchDecisionLog, LENSES, SEVERITIES, resolveHostProviderName, resolveHostDispatchProviderName, resolveHostDispatchCapability as sharedResolveHostDispatchCapability, resolveAutonomousMode, resolveRollingEngineFlag } from "audit-tools/shared";
7
7
  import { readRemediationAccessMemory, computeBlockContinuityScores } from "../state/accessMemory.js";
8
8
  import { applyPlanPipeline, buildCoverageLedger } from "../phases/plan.js";
9
9
  import { groundExtractedFindings } from "../phases/grounding.js";
@@ -71,19 +71,15 @@ export function resolveRollingEngineEnabled(options) {
71
71
  env: options.env,
72
72
  });
73
73
  }
74
- /** Conservative context-window floor, applied ONLY at true first contact (nothing persisted). */
75
- const HOST_CONTEXT_TOKENS_FLOOR = DEFAULT_CONTEXT_TOKENS;
76
74
  function finiteOrUndefined(value) {
77
75
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
78
76
  }
79
77
  /**
80
78
  * Pure per-field host-capability resolver (C1). Each field resolves as
81
- * `explicit ?? persisted ?? floor` — a per-field merge, never a whole-object
82
- * clobber that would drop fields the current call omitted. The 32k context
83
- * floor applies ONLY at true first contact (no persisted handshake at all);
84
- * once a handshake exists, an omitted field reuses the persisted value rather
85
- * than re-flooring. Corrupt / non-finite persisted numbers degrade to undefined
86
- * without throwing.
79
+ * `explicit ?? persisted` — a per-field merge, never a whole-object
80
+ * clobber that would drop fields the current call omitted. Corrupt / non-finite
81
+ * persisted numbers degrade to undefined without throwing; missing capability
82
+ * stays missing and is handled by the dispatch/plan refusal seam.
87
83
  *
88
84
  * Returns:
89
85
  * - `resolved` — the merged capabilities to drive downstream dispatch sizing;
@@ -93,11 +89,9 @@ function finiteOrUndefined(value) {
93
89
  export function resolveHostCapabilities(explicit, persisted) {
94
90
  const exp = explicit ?? {};
95
91
  const per = persisted && typeof persisted === "object" ? persisted : undefined;
96
- const firstContact = per === undefined;
97
92
  const pick = (e, p) => e ?? p ?? undefined;
98
93
  const context_tokens = finiteOrUndefined(exp.context_tokens) ??
99
- finiteOrUndefined(per?.context_tokens) ??
100
- (firstContact ? HOST_CONTEXT_TOKENS_FLOOR : undefined);
94
+ finiteOrUndefined(per?.context_tokens);
101
95
  const resolved = {
102
96
  can_dispatch_subagents: pick(exp.can_dispatch_subagents, per?.can_dispatch_subagents),
103
97
  max_concurrent: finiteOrUndefined(exp.max_concurrent) ?? finiteOrUndefined(per?.max_concurrent),
@@ -106,8 +100,7 @@ export function resolveHostCapabilities(explicit, persisted) {
106
100
  model_id: pick(exp.model_id, per?.model_id),
107
101
  models: exp.models ?? per?.models,
108
102
  };
109
- // Persist ONLY the explicitly-supplied fields (the delta) — never the floor,
110
- // never an omitted field.
103
+ // Persist ONLY the explicitly-supplied fields (the delta), never an omitted field.
111
104
  const toPersist = {};
112
105
  if (exp.can_dispatch_subagents !== undefined)
113
106
  toPersist.can_dispatch_subagents = exp.can_dispatch_subagents;
@@ -592,7 +585,7 @@ export async function driveRollingDispatch(levels, options) {
592
585
  };
593
586
  }
594
587
  /**
595
- * Whether a confirmed pool is one the orchestrator launches IN-PROCESS this cycle
588
+ * Whether an eligible pool is one the orchestrator launches IN-PROCESS this cycle
596
589
  * (vs. the conversation host's subagent pool) — the shared
597
590
  * `isInProcessWorkerProvider` predicate (H3), same remediate policy.
598
591
  */
@@ -698,7 +691,7 @@ export async function driveRollingImplementDispatch(options) {
698
691
  }, "remediate-code");
699
692
  },
700
693
  });
701
- // Confirmed pools: quota-derived concurrency, never the raw host flag (INV-QD-11).
694
+ // Eligible pools: quota-derived concurrency, never the raw host flag (INV-QD-11).
702
695
  // A partition-scoped caller supplies its coordinator's already-built set instead.
703
696
  const builtPools = options.poolsOverride
704
697
  ? null
@@ -709,13 +702,10 @@ export async function driveRollingImplementDispatch(options) {
709
702
  hostOutputTokens: options.waveOptions?.hostOutputTokens,
710
703
  hostModels: options.waveOptions?.hostModels,
711
704
  hostModelId: options.waveOptions?.hostModelId,
712
- capabilityRanks: await readConfirmedCapabilityRanks(options.root),
705
+ capabilityRanks: null,
713
706
  hostSession,
714
- // The operator's Gate-0 exclusions, applied as a set-difference over freshly
715
- // gathered reach. Read here because this layer owns `root`; self-spawn-blocked is
716
- // recomputed against THIS process's env rather than inherited from the auditor
717
- // that wrote the confirmation.
718
- excludedBackends: resolveDispatchExclusion(await readConfirmedDispatchPolicy(options.root)),
707
+ // Mechanical self-spawn exclusion, recomputed from this process's environment.
708
+ excludedBackends: buildSelfSpawnExclusion(),
719
709
  });
720
710
  const confirmedPools = options.poolsOverride ?? builtPools.pools;
721
711
  // The operator's own policy left this dispatch with no capacity at all. Loud, not
@@ -1245,6 +1235,9 @@ async function buildImplementDispatchStep(ctx) {
1245
1235
  hostOutputTokens: resolvedHostOutputTokens,
1246
1236
  hostModels: resolvedHostModels,
1247
1237
  hostModelId: resolvedHostModelId,
1238
+ // An attended host is the dispatch authority. Headless/in-process paths
1239
+ // leave this false and retain the shared admission engine.
1240
+ hostOwnedDispatch: canDispatchImpl,
1248
1241
  };
1249
1242
  // H2+H4 collapse: ONE fan-out over the eligible pool set. `buildConfirmedPools`
1250
1243
  // folds the configured primary in-process backend in as a source pool
@@ -1270,27 +1263,33 @@ async function buildImplementDispatchStep(ctx) {
1270
1263
  const hybridHostSession = new HostSessionQuotaSource({
1271
1264
  providerModelKey: hybridHostSessionModelKey,
1272
1265
  });
1273
- const { pools: confirmedPools, zeroedByExclusion } = await buildConfirmedPools({
1266
+ const { pools: confirmedPools, zeroedByExclusion, sourcePoolIds } = await buildConfirmedPools({
1274
1267
  sessionConfig: sessionConfigImpl ?? null,
1275
1268
  hostMaxConcurrent: resolvedHostMaxConcurrent,
1276
1269
  hostContextTokens: resolvedHostContextTokens,
1277
1270
  hostOutputTokens: resolvedHostOutputTokens,
1278
1271
  hostModels: resolvedHostModels,
1279
1272
  hostModelId: resolvedHostModelId,
1280
- capabilityRanks: await readConfirmedCapabilityRanks(root),
1273
+ capabilityRanks: null,
1281
1274
  hostSession: hybridHostSession,
1282
1275
  // Attendance IS pool-set membership: headless ⇒ no host pool in the set.
1283
1276
  hostCanDispatch: canDispatchImpl,
1284
- // The operator's Gate-0 exclusions, applied as a set-difference over freshly
1285
- // gathered reach; self-spawn-blocked recomputed against THIS process's env.
1286
- excludedBackends: resolveDispatchExclusion(await readConfirmedDispatchPolicy(root)),
1277
+ // Mechanical self-spawn exclusion uses the same resolved driver identity as quota.
1278
+ excludedBackends: buildSelfSpawnExclusion({
1279
+ activeHostProvider: canDispatchImpl ? hybridProviderName : null,
1280
+ }),
1287
1281
  });
1288
1282
  // Loud, not silent: on the headless branch below there is no host pool to fall
1289
1283
  // back to, so a policy-zeroed set means this dispatch does nothing at all.
1290
1284
  if (zeroedByExclusion) {
1291
1285
  await captureZeroCapacityFriction(artifactsDir, runId, zeroedByExclusion, "remediate-code");
1292
1286
  }
1293
- const backendPools = confirmedPools.filter(isInProcessPool);
1287
+ // Engine-drivable backends are SOURCE pools only, by declared class — never
1288
+ // re-derived from the provider name. The neutral worker-command host identity
1289
+ // name-collides with the in-process worker class, so a name-only test would
1290
+ // hand the HOST's own pool to the engine as a spawnable worker.
1291
+ const isEngineDrivableId = (poolId, providerName) => sourcePoolIds.has(poolId) && isInProcessPool({ providerName });
1292
+ const backendPools = confirmedPools.filter((p) => isEngineDrivableId(p.id, p.providerName));
1294
1293
  if (!canDispatchImpl) {
1295
1294
  // Headless: no host pool in the eligible set — when any dispatchable
1296
1295
  // backend pool is confirmed, the engine drives the FULL rolling implement
@@ -1381,7 +1380,7 @@ async function buildImplementDispatchStep(ctx) {
1381
1380
  settled.add(id);
1382
1381
  await addSettledPool(settledPath, id);
1383
1382
  },
1384
- isInProcess: isInProcessPool,
1383
+ isInProcess: (a) => isEngineDrivableId(a.poolId, a.providerName),
1385
1384
  });
1386
1385
  // Drive the in-process partition through the ROLLING ENGINE (H2 plan D2 —
1387
1386
  // `executeInProcessPartition`'s direct Promise.all executor is deleted; one
@@ -1516,7 +1515,9 @@ async function buildImplementDispatchStep(ctx) {
1516
1515
  // nodes stay PENDING and re-dispatch on resume. The in-process partition (above)
1517
1516
  // already ran on its own cooldown-safe pool, so its work still lands.
1518
1517
  if (rolling.wall) {
1519
- await reconcileAdmissionLeasesFromQuotaFile(rolling.quotaPath);
1518
+ if (rolling.quotaPath) {
1519
+ await reconcileAdmissionLeasesFromQuotaFile(rolling.quotaPath);
1520
+ }
1520
1521
  const paused = await store.loadState();
1521
1522
  if (paused) {
1522
1523
  paused.partial_completion_terminal = buildQuotaPausedTerminal(rolling.wall.strandedBlockIds, rolling.wall.detected.earliestResetAt, rolling.wall.detected.emptyGrantCause);
@@ -1536,7 +1537,9 @@ async function buildImplementDispatchStep(ctx) {
1536
1537
  if (rolling.session.frontier.length === 0) {
1537
1538
  const structuralRefusal = detectStructuralRefusalPause(await readOptionalJsonFile(rolling.quotaPath));
1538
1539
  if (structuralRefusal.pause) {
1539
- await reconcileAdmissionLeasesFromQuotaFile(rolling.quotaPath);
1540
+ if (rolling.quotaPath) {
1541
+ await reconcileAdmissionLeasesFromQuotaFile(rolling.quotaPath);
1542
+ }
1540
1543
  const paused = await store.loadState();
1541
1544
  if (paused) {
1542
1545
  paused.partial_completion_terminal = buildQuotaPausedTerminal(structuralRefusal.refusedIds, null, "no_capable_pool");
@@ -1565,6 +1568,16 @@ async function buildImplementDispatchStep(ctx) {
1565
1568
  const rollNext = loaderCommand("next-step");
1566
1569
  const acceptCmd = loaderCommand(`accept-node --id <BLOCK_ID> --run-id ${runId}`);
1567
1570
  const reverifyCmd = loaderCommand(`reverify-node --id <BLOCK_ID> --run-id ${runId}`);
1571
+ const hostOwnedRolling = rolling.quotaPath === null;
1572
+ const dispatchAuthorityNote = hostOwnedRolling
1573
+ ? `The attended host and llm-relay own provider selection, failover, quota, and
1574
+ concurrency. Dispatch the COMPLETE eligible set of ${rolling.session.frontier.length}
1575
+ node(s) below; audit-tools imposes no admission subset, cold-start wall, or concurrency
1576
+ cap. When they are all accepted, merge and re-invoke next-step.`
1577
+ : `The tool admitted this set against the live budget (and any declared in-flight cap):
1578
+ dispatch EXACTLY the ${rolling.session.frontier.length} node(s) below and no more.
1579
+ Their count is the whole grant — there is no separate concurrency cap. When they are
1580
+ all accepted, merge and re-invoke next-step; the tool re-grants the pending remainder.`;
1568
1581
  const nodeLines = rolling.initial
1569
1582
  .map((n) => `- \`${n.block_id}\` — prompt: \`${n.prompt_path}\` — worktree (subagent cwd): \`${n.worktree_root}\``)
1570
1583
  .join("\n");
@@ -1581,19 +1594,16 @@ Each granted node runs in its OWN git worktree (hard isolation between nodes). T
1581
1594
  TOOL owns commit -> verify -> merge + write-scope; you only spawn a subagent per
1582
1595
  node and call \`accept-node\` as each finishes.
1583
1596
 
1584
- The tool ADMITTED this set against the live budget (and any declared in-flight cap):
1585
- dispatch EXACTLY the ${rolling.session.frontier.length} node(s) below and no more.
1586
- Their count is the whole grant — there is no separate concurrency cap. When they are
1587
- all accepted, merge and re-invoke next-step; the tool re-grants the pending remainder.
1597
+ ${dispatchAuthorityNote}
1588
1598
 
1589
- ${renderDispatchDriverInstruction(driverSelection, `the ${rolling.session.frontier.length} granted node(s)`)}
1599
+ ${renderDispatchDriverInstruction(driverSelection, `the ${rolling.session.frontier.length} ${hostOwnedRolling ? "eligible" : "granted"} node(s)`)}
1590
1600
 
1591
1601
  Spawn ONE subagent for EACH granted node below. Give the subagent that node's
1592
1602
  \`prompt\`, and set its working directory to the node's **worktree** path. The
1593
1603
  subagent edits source files INSIDE that worktree and writes ONLY its result file.
1594
1604
  Do NOT let any subagent edit the main repository tree.
1595
1605
 
1596
- Granted nodes (worktrees already created):
1606
+ ${hostOwnedRolling ? "Eligible" : "Granted"} nodes (worktrees already created):
1597
1607
  ${nodeLines}
1598
1608
 
1599
1609
  As EACH subagent finishes, run (substituting the finished node's block id):
@@ -1642,7 +1652,10 @@ ${renderHostScratchNote(hostScratchDir(artifactsDir, runId))}
1642
1652
  `,
1643
1653
  allowedCommands: [acceptCmd, reverifyCmd, rollMerge, rollNext],
1644
1654
  stopCondition: "Stop after every node has reached a terminal accept (accept-node returns done), results merged, and next-step has been run.",
1645
- artifactPaths: { dispatch_plan: rolling.planPath, dispatch_quota: rolling.quotaPath },
1655
+ artifactPaths: {
1656
+ dispatch_plan: rolling.planPath,
1657
+ ...(rolling.quotaPath ? { dispatch_quota: rolling.quotaPath } : {}),
1658
+ },
1646
1659
  }) };
1647
1660
  }
1648
1661
  }
@@ -1716,40 +1729,43 @@ Then run:
1716
1729
  // of `implementing`) emits the resumable `quota_paused` step this same advance; the
1717
1730
  // ungranted nodes stay PENDING and re-dispatch on resume (never abandoned to partial
1718
1731
  // coverage — the remediate divergence from audit's read-only bound-and-give-up).
1719
- const implQuota = await readOptionalJsonFile(implQuotaPath);
1720
- // D1 parity: the binding budget window (from the host pool's capacity summary) so an
1721
- // empty_grant wall derives a reset time instead of the bare `earliestResetAt: null` —
1722
- // but ONLY on a genuine BUDGET block, not a `cap_reached` ledger-contention wall
1723
- // (frees in seconds; the window reset may be days out).
1724
- const implBudgetBound = admissionBlockedOnBudget(implQuota?.admission?.explains ?? []);
1725
- const implBindingWindow = implBudgetBound
1726
- ? implQuota?.capacity_pools?.find((p) => p.is_conversation_host)?.binding_window ??
1727
- implQuota?.capacity_pools?.[0]?.binding_window ??
1728
- null
1729
- : null;
1730
- const implWall = detectHostDispatchWall({
1731
- grantedCount: implQuota?.admission?.granted_packet_ids?.length ?? 0,
1732
- cooldownUntil: implQuota?.cooldown_until ?? null,
1733
- bindingWindow: implBindingWindow,
1734
- // Step E parity: classify the zero-grant cause so the quota_paused terminal's
1735
- // reset semantics stay honest (a no_capable_pool wall has no reset to wait for).
1736
- explains: implQuota?.admission?.explains ?? [],
1737
- now: Date.now(),
1738
- });
1739
- if (implWall.atWall) {
1740
- // Release the leases the grant just reserved — pausing skips the merge that would
1741
- // reconcile them, so without this they leak until TTL and mis-size the resume grant.
1742
- await reconcileAdmissionLeasesFromQuotaFile(implQuotaPath);
1743
- const strandedIds = dispatchPlan.items
1744
- .map((item) => item.block_id)
1745
- .filter((id) => typeof id === "string");
1746
- const paused = await store.loadState();
1747
- if (paused) {
1748
- paused.partial_completion_terminal = buildQuotaPausedTerminal(strandedIds, implWall.earliestResetAt, implWall.emptyGrantCause);
1749
- await store.saveState(paused);
1732
+ if (!waveOptsImpl.hostOwnedDispatch) {
1733
+ const implQuota = await readOptionalJsonFile(implQuotaPath);
1734
+ // D1 parity: the binding budget window (from the host pool's capacity summary) so an
1735
+ // empty_grant wall derives a reset time instead of the bare `earliestResetAt: null` —
1736
+ // but ONLY on a genuine BUDGET block, not a `cap_reached` ledger-contention wall
1737
+ // (frees in seconds; the window reset may be days out).
1738
+ const implBudgetBound = admissionBlockedOnBudget(implQuota?.admission?.explains ?? []);
1739
+ const implBindingWindow = implBudgetBound
1740
+ ? implQuota?.capacity_pools?.find((p) => p.is_conversation_host)?.binding_window ??
1741
+ implQuota?.capacity_pools?.[0]?.binding_window ??
1742
+ null
1743
+ : null;
1744
+ const implWall = detectHostDispatchWall({
1745
+ grantedCount: implQuota?.admission?.granted_packet_ids?.length ?? 0,
1746
+ cooldownUntil: implQuota?.cooldown_until ?? null,
1747
+ bindingWindow: implBindingWindow,
1748
+ // Step E parity: classify the zero-grant cause so the quota_paused terminal's
1749
+ // reset semantics stay honest (a no_capable_pool wall has no reset to wait for).
1750
+ explains: implQuota?.admission?.explains ?? [],
1751
+ now: Date.now(),
1752
+ });
1753
+ if (implWall.atWall) {
1754
+ // Release the leases the grant just reserved — pausing skips the merge that would
1755
+ // reconcile them, so without this they leak until TTL and mis-size the resume grant.
1756
+ await reconcileAdmissionLeasesFromQuotaFile(implQuotaPath);
1757
+ const strandedIds = dispatchPlan.items
1758
+ .map((item) => item.block_id)
1759
+ .filter((id) => typeof id === "string");
1760
+ const paused = await store.loadState();
1761
+ if (paused) {
1762
+ paused.partial_completion_terminal = buildQuotaPausedTerminal(strandedIds, implWall.earliestResetAt, implWall.emptyGrantCause);
1763
+ await store.saveState(paused);
1764
+ }
1765
+ return { kind: "transition", state: paused };
1750
1766
  }
1751
- return { kind: "transition", state: paused };
1752
1767
  }
1768
+ const hostOwnedLegacy = waveOptsImpl.hostOwnedDispatch === true;
1753
1769
  return { kind: "emit", step: await writeCurrentStep({
1754
1770
  stepKind: "dispatch_implement",
1755
1771
  status: "ready",
@@ -1759,29 +1775,28 @@ Then run:
1759
1775
  prompt: `
1760
1776
  # Dispatch Implementation Work (rolling)
1761
1777
 
1762
- Read the dispatch plan and quota JSONs:
1778
+ Read the dispatch plan${hostOwnedLegacy ? "" : " and quota JSONs"}:
1763
1779
 
1764
1780
  \`${planPath}\`
1765
- \`${implQuotaPath}\`
1781
+ ${hostOwnedLegacy ? "" : `\`${implQuotaPath}\``}
1766
1782
 
1767
1783
  Every item in \`items\` is a node whose dependencies are all VERIFIED-COMPLETE
1768
- (INV-RS-01). The tool admitted a budget-bounded subset: dispatch EXACTLY the block
1769
- ids in the quota file's \`admission.granted_packet_ids\` and no others — that granted
1770
- set is the whole grant (there is no separate concurrency cap). Each item's
1784
+ (INV-RS-01). ${hostOwnedLegacy
1785
+ ? "The attended host and llm-relay own provider selection, failover, quota, and concurrency. Dispatch every item in this complete eligible plan; audit-tools imposes no admission subset, cold-start wall, or concurrency cap."
1786
+ : "The tool admitted a budget-bounded subset: dispatch EXACTLY the block ids in the quota file's `admission.granted_packet_ids` and no others — that granted set is the whole grant (there is no separate concurrency cap)."} Each item's
1771
1787
  \`model_hint.tier\` suggests which model to use (small/standard/deep). If your
1772
1788
  provider has rate limits, pace launches accordingly.
1773
1789
 
1774
- For each GRANTED item in \`items\` (its \`block_id\` in \`admission.granted_packet_ids\`),
1790
+ For each ${hostOwnedLegacy ? "eligible" : "GRANTED"} item in \`items\`${hostOwnedLegacy ? "" : " (its `block_id` in `admission.granted_packet_ids`)"},
1775
1791
  dispatch one subagent with that item's \`prompt_path\`. Each subagent may edit source
1776
1792
  files needed for that bounded block and must write only its assigned \`result_path\`.
1777
- After the granted set is merged and you run next-step, the tool re-grants the pending
1778
- remainder.
1793
+ ${hostOwnedLegacy ? "After the complete plan is merged, run next-step." : "After the granted set is merged and you run next-step, the tool re-grants the pending remainder."}
1779
1794
 
1780
1795
  ${SHARED_REBUILD_BETWEEN_LEVELS_NOTE}
1781
1796
 
1782
- ${renderQuotaCoverageNudge(implQuotaPath, artifactsDir)}
1797
+ ${renderQuotaCoverageNudge(hostOwnedLegacy ? null : implQuotaPath, artifactsDir)}
1783
1798
 
1784
- ${renderTokenBudgetView(implQuotaPath)}
1799
+ ${renderTokenBudgetView(hostOwnedLegacy ? null : implQuotaPath)}
1785
1800
 
1786
1801
  ${DISPATCH_PROMPT_HANDOFF_NOTE}
1787
1802
 
@@ -1797,7 +1812,10 @@ Then run:
1797
1812
  `,
1798
1813
  allowedCommands: [mergeCommand, nextCommand],
1799
1814
  stopCondition: "Stop after all implementation results have been merged and next-step has been run.",
1800
- artifactPaths: { dispatch_plan: planPath, dispatch_quota: implQuotaPath },
1815
+ artifactPaths: {
1816
+ dispatch_plan: planPath,
1817
+ ...(hostOwnedLegacy ? {} : { dispatch_quota: implQuotaPath }),
1818
+ },
1801
1819
  }) };
1802
1820
  }
1803
1821
  /**
@@ -4057,7 +4075,7 @@ async function decideNextStepLoop(options, runLogger) {
4057
4075
  // When the fold ran only inside the implement-dispatch step builder, a
4058
4076
  // next-step call carrying the flags that landed on any other obligation (a
4059
4077
  // triage re-drive — the 2026-07-22 dogfood wall) silently dropped them and
4060
- // dispatch capability stayed at the conservative floor.
4078
+ // dispatch capability stayed unknown and produced a resumable refusal.
4061
4079
  if (state) {
4062
4080
  const { toPersist } = resolveHostCapabilities({
4063
4081
  can_dispatch_subagents: options.hostCanDispatchSubagents,