@coool/opencode-adaptive 1.0.0 → 1.2.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 (381) hide show
  1. package/README.md +8 -7
  2. package/dist/adapters/codex-capacity/index.d.ts +0 -1
  3. package/dist/adapters/codex-capacity/index.js.map +1 -1
  4. package/dist/adapters/codex-capacity/parse.d.ts +2 -2
  5. package/dist/adapters/codex-capacity/parse.js +19 -3
  6. package/dist/adapters/codex-capacity/parse.js.map +1 -1
  7. package/dist/adapters/codex-capacity/reading.d.ts +0 -1
  8. package/dist/adapters/codex-capacity/reading.js.map +1 -1
  9. package/dist/adapters/codex-capacity/sensor.d.ts +0 -1
  10. package/dist/adapters/codex-capacity/sensor.js.map +1 -1
  11. package/dist/adapters/codex-capacity/types.d.ts +0 -4
  12. package/dist/adapters/codex-capacity/types.js +14 -0
  13. package/dist/adapters/codex-capacity/types.js.map +1 -1
  14. package/dist/adapters/opencode/escalation-tool.d.ts +0 -1
  15. package/dist/adapters/opencode/escalation-tool.js +5 -3
  16. package/dist/adapters/opencode/escalation-tool.js.map +1 -1
  17. package/dist/adapters/opencode/events.d.ts +0 -1
  18. package/dist/adapters/opencode/events.js.map +1 -1
  19. package/dist/adapters/opencode/hooks.d.ts +0 -1
  20. package/dist/adapters/opencode/hooks.js +24 -7
  21. package/dist/adapters/opencode/hooks.js.map +1 -1
  22. package/dist/adapters/opencode/index.d.ts +0 -1
  23. package/dist/adapters/opencode/index.js.map +1 -1
  24. package/dist/adapters/opencode/inventory.d.ts +0 -1
  25. package/dist/adapters/opencode/inventory.js.map +1 -1
  26. package/dist/adapters/opencode/report.d.ts +0 -1
  27. package/dist/adapters/opencode/report.js.map +1 -1
  28. package/dist/adapters/opencode/session-ops.d.ts +0 -1
  29. package/dist/adapters/opencode/session-ops.js.map +1 -1
  30. package/dist/adapters/opencode/storage.d.ts +0 -1
  31. package/dist/adapters/opencode/storage.js.map +1 -1
  32. package/dist/adapters/opencode/tier-tool.d.ts +0 -1
  33. package/dist/adapters/opencode/tier-tool.js.map +1 -1
  34. package/dist/adapters/opencode/types.d.ts +0 -1
  35. package/dist/adapters/opencode/types.js.map +1 -1
  36. package/dist/core/compatibility/gate.d.ts +0 -3
  37. package/dist/core/compatibility/gate.js +0 -4
  38. package/dist/core/compatibility/gate.js.map +1 -1
  39. package/dist/core/compatibility/index.d.ts +0 -1
  40. package/dist/core/compatibility/index.js.map +1 -1
  41. package/dist/core/compatibility/types.d.ts +0 -1
  42. package/dist/core/compatibility/types.js.map +1 -1
  43. package/dist/core/scheduler/admit.d.ts +0 -1
  44. package/dist/core/scheduler/admit.js +22 -21
  45. package/dist/core/scheduler/admit.js.map +1 -1
  46. package/dist/core/scheduler/escalate.d.ts +0 -1
  47. package/dist/core/scheduler/escalate.js +6 -17
  48. package/dist/core/scheduler/escalate.js.map +1 -1
  49. package/dist/core/scheduler/index.d.ts +0 -1
  50. package/dist/core/scheduler/index.js.map +1 -1
  51. package/dist/core/scheduler/mode.d.ts +0 -1
  52. package/dist/core/scheduler/mode.js.map +1 -1
  53. package/dist/core/scheduler/types.d.ts +2 -9
  54. package/dist/core/scheduler/types.js +2 -1
  55. package/dist/core/scheduler/types.js.map +1 -1
  56. package/dist/core/tier-policy/index.d.ts +0 -1
  57. package/dist/core/tier-policy/index.js.map +1 -1
  58. package/dist/core/tier-policy/resolve.d.ts +0 -1
  59. package/dist/core/tier-policy/resolve.js.map +1 -1
  60. package/dist/core/tier-policy/tier-list.d.ts +0 -1
  61. package/dist/core/tier-policy/tier-list.js.map +1 -1
  62. package/dist/core/tier-policy/types.d.ts +2 -1
  63. package/dist/core/tier-policy/types.js +4 -0
  64. package/dist/core/tier-policy/types.js.map +1 -1
  65. package/dist/core/work-unit/index.d.ts +0 -1
  66. package/dist/core/work-unit/index.js.map +1 -1
  67. package/dist/core/work-unit/interruption.d.ts +0 -1
  68. package/dist/core/work-unit/interruption.js.map +1 -1
  69. package/dist/core/work-unit/tracker.d.ts +11 -4
  70. package/dist/core/work-unit/tracker.js +26 -6
  71. package/dist/core/work-unit/tracker.js.map +1 -1
  72. package/dist/core/work-unit/types.d.ts +6 -1
  73. package/dist/core/work-unit/types.js.map +1 -1
  74. package/dist/execution/continuation/execute.d.ts +0 -1
  75. package/dist/execution/continuation/execute.js.map +1 -1
  76. package/dist/execution/continuation/index.d.ts +0 -2
  77. package/dist/execution/continuation/index.js +0 -1
  78. package/dist/execution/continuation/index.js.map +1 -1
  79. package/dist/execution/continuation/plan.d.ts +0 -1
  80. package/dist/execution/continuation/plan.js +1 -3
  81. package/dist/execution/continuation/plan.js.map +1 -1
  82. package/dist/execution/continuation/prompts.d.ts +0 -1
  83. package/dist/execution/continuation/prompts.js.map +1 -1
  84. package/dist/execution/continuation/types.d.ts +0 -2
  85. package/dist/execution/continuation/types.js.map +1 -1
  86. package/dist/execution/escalation/index.d.ts +0 -1
  87. package/dist/execution/escalation/index.js.map +1 -1
  88. package/dist/execution/escalation/types.d.ts +0 -1
  89. package/dist/execution/escalation/types.js.map +1 -1
  90. package/dist/execution/index.d.ts +0 -1
  91. package/dist/execution/index.js.map +1 -1
  92. package/dist/execution/parking/index.d.ts +0 -1
  93. package/dist/execution/parking/index.js.map +1 -1
  94. package/dist/execution/parking/plan.d.ts +0 -1
  95. package/dist/execution/parking/plan.js.map +1 -1
  96. package/dist/execution/retry/decide.d.ts +0 -1
  97. package/dist/execution/retry/decide.js +1 -2
  98. package/dist/execution/retry/decide.js.map +1 -1
  99. package/dist/execution/retry/index.d.ts +0 -1
  100. package/dist/execution/retry/index.js.map +1 -1
  101. package/dist/execution/retry/types.d.ts +0 -2
  102. package/dist/execution/retry/types.js.map +1 -1
  103. package/dist/gui-experimental.cjs +1 -1
  104. package/dist/gui.d.ts +0 -1
  105. package/dist/gui.js +6 -3
  106. package/dist/gui.js.map +1 -1
  107. package/dist/health/capacity/index.d.ts +0 -1
  108. package/dist/health/capacity/index.js.map +1 -1
  109. package/dist/health/capacity/merge.d.ts +0 -1
  110. package/dist/health/capacity/merge.js.map +1 -1
  111. package/dist/health/capacity/registry.d.ts +0 -1
  112. package/dist/health/capacity/registry.js.map +1 -1
  113. package/dist/health/capacity/types.d.ts +0 -1
  114. package/dist/health/capacity/types.js.map +1 -1
  115. package/dist/health/circuit-breaker/breaker.d.ts +8 -1
  116. package/dist/health/circuit-breaker/breaker.js +18 -0
  117. package/dist/health/circuit-breaker/breaker.js.map +1 -1
  118. package/dist/health/circuit-breaker/index.d.ts +0 -1
  119. package/dist/health/circuit-breaker/index.js.map +1 -1
  120. package/dist/health/circuit-breaker/types.d.ts +0 -1
  121. package/dist/health/circuit-breaker/types.js.map +1 -1
  122. package/dist/health/classifier/classify.d.ts +0 -1
  123. package/dist/health/classifier/classify.js +13 -1
  124. package/dist/health/classifier/classify.js.map +1 -1
  125. package/dist/health/classifier/index.d.ts +0 -1
  126. package/dist/health/classifier/index.js.map +1 -1
  127. package/dist/health/classifier/types.d.ts +0 -1
  128. package/dist/health/classifier/types.js.map +1 -1
  129. package/dist/health/index.d.ts +0 -1
  130. package/dist/health/index.js.map +1 -1
  131. package/dist/health/resource-health/index.d.ts +0 -1
  132. package/dist/health/resource-health/index.js.map +1 -1
  133. package/dist/health/resource-health/key.d.ts +0 -1
  134. package/dist/health/resource-health/key.js.map +1 -1
  135. package/dist/health/resource-health/registry.d.ts +6 -1
  136. package/dist/health/resource-health/registry.js +19 -1
  137. package/dist/health/resource-health/registry.js.map +1 -1
  138. package/dist/health/resource-health/transitions.d.ts +2 -4
  139. package/dist/health/resource-health/transitions.js +10 -18
  140. package/dist/health/resource-health/transitions.js.map +1 -1
  141. package/dist/health/resource-health/types.d.ts +7 -1
  142. package/dist/health/resource-health/types.js +1 -0
  143. package/dist/health/resource-health/types.js.map +1 -1
  144. package/dist/index.d.ts +0 -6
  145. package/dist/index.js +44 -19
  146. package/dist/index.js.map +1 -1
  147. package/dist/plugin-id.d.ts +0 -1
  148. package/dist/plugin-id.js.map +1 -1
  149. package/dist/rpc/definition.d.ts +24 -1
  150. package/dist/rpc/definition.js +28 -2
  151. package/dist/rpc/definition.js.map +1 -1
  152. package/dist/rpc/handlers.d.ts +12 -24
  153. package/dist/rpc/handlers.js +22 -8
  154. package/dist/rpc/handlers.js.map +1 -1
  155. package/dist/rpc/status.d.ts +0 -1
  156. package/dist/rpc/status.js.map +1 -1
  157. package/dist/rpc.d.ts +0 -1
  158. package/dist/rpc.js.map +1 -1
  159. package/dist/state/capacity/index.d.ts +0 -1
  160. package/dist/state/capacity/index.js.map +1 -1
  161. package/dist/state/capacity/parse.d.ts +0 -1
  162. package/dist/state/capacity/parse.js +14 -2
  163. package/dist/state/capacity/parse.js.map +1 -1
  164. package/dist/state/capacity/store.d.ts +0 -1
  165. package/dist/state/capacity/store.js +16 -2
  166. package/dist/state/capacity/store.js.map +1 -1
  167. package/dist/state/capacity/types.d.ts +0 -1
  168. package/dist/state/capacity/types.js.map +1 -1
  169. package/dist/state/health/index.d.ts +0 -1
  170. package/dist/state/health/index.js.map +1 -1
  171. package/dist/state/health/parse.d.ts +0 -1
  172. package/dist/state/health/parse.js +20 -4
  173. package/dist/state/health/parse.js.map +1 -1
  174. package/dist/state/health/store.d.ts +0 -1
  175. package/dist/state/health/store.js +16 -2
  176. package/dist/state/health/store.js.map +1 -1
  177. package/dist/state/health/types.d.ts +0 -1
  178. package/dist/state/health/types.js.map +1 -1
  179. package/dist/state/parked-work/index.d.ts +0 -1
  180. package/dist/state/parked-work/index.js.map +1 -1
  181. package/dist/state/parked-work/parse.d.ts +0 -1
  182. package/dist/state/parked-work/parse.js.map +1 -1
  183. package/dist/state/parked-work/store.d.ts +0 -1
  184. package/dist/state/parked-work/store.js +20 -3
  185. package/dist/state/parked-work/store.js.map +1 -1
  186. package/dist/state/parked-work/types.d.ts +0 -1
  187. package/dist/state/parked-work/types.js.map +1 -1
  188. package/dist/state/receipts/bound.d.ts +0 -1
  189. package/dist/state/receipts/bound.js.map +1 -1
  190. package/dist/state/receipts/index.d.ts +0 -1
  191. package/dist/state/receipts/index.js.map +1 -1
  192. package/dist/state/receipts/parse.d.ts +0 -1
  193. package/dist/state/receipts/parse.js.map +1 -1
  194. package/dist/state/receipts/store.d.ts +0 -1
  195. package/dist/state/receipts/store.js +24 -4
  196. package/dist/state/receipts/store.js.map +1 -1
  197. package/dist/state/receipts/types.d.ts +0 -1
  198. package/dist/state/receipts/types.js.map +1 -1
  199. package/dist/state/session-modes/index.d.ts +0 -1
  200. package/dist/state/session-modes/index.js.map +1 -1
  201. package/dist/state/session-modes/parse.d.ts +0 -1
  202. package/dist/state/session-modes/parse.js.map +1 -1
  203. package/dist/state/session-modes/store.d.ts +0 -1
  204. package/dist/state/session-modes/store.js +15 -1
  205. package/dist/state/session-modes/store.js.map +1 -1
  206. package/dist/state/session-modes/types.d.ts +0 -1
  207. package/dist/state/session-modes/types.js.map +1 -1
  208. package/dist/state/settings/index.d.ts +0 -1
  209. package/dist/state/settings/index.js.map +1 -1
  210. package/dist/state/settings/parse.d.ts +0 -1
  211. package/dist/state/settings/parse.js.map +1 -1
  212. package/dist/state/settings/store.d.ts +0 -1
  213. package/dist/state/settings/store.js +9 -1
  214. package/dist/state/settings/store.js.map +1 -1
  215. package/dist/state/settings/types.d.ts +0 -1
  216. package/dist/state/settings/types.js.map +1 -1
  217. package/dist/state/tier-requests/index.d.ts +4 -0
  218. package/dist/state/tier-requests/index.js +4 -0
  219. package/dist/state/tier-requests/index.js.map +1 -0
  220. package/dist/state/tier-requests/parse.d.ts +3 -0
  221. package/dist/state/tier-requests/parse.js +53 -0
  222. package/dist/state/tier-requests/parse.js.map +1 -0
  223. package/dist/state/tier-requests/store.d.ts +27 -0
  224. package/dist/state/tier-requests/store.js +96 -0
  225. package/dist/state/tier-requests/store.js.map +1 -0
  226. package/dist/state/tier-requests/types.d.ts +30 -0
  227. package/dist/state/tier-requests/types.js +7 -0
  228. package/dist/state/tier-requests/types.js.map +1 -0
  229. package/dist/supervisor/index.d.ts +0 -1
  230. package/dist/supervisor/index.js.map +1 -1
  231. package/dist/supervisor/log.d.ts +0 -1
  232. package/dist/supervisor/log.js.map +1 -1
  233. package/dist/supervisor/supervisor.d.ts +23 -6
  234. package/dist/supervisor/supervisor.js +414 -111
  235. package/dist/supervisor/supervisor.js.map +1 -1
  236. package/dist/supervisor/types.d.ts +0 -1
  237. package/dist/supervisor/types.js.map +1 -1
  238. package/dist/supervisor/view.d.ts +0 -1
  239. package/dist/supervisor/view.js.map +1 -1
  240. package/dist/tui.d.ts +0 -1
  241. package/dist/tui.js +14 -10
  242. package/dist/tui.js.map +1 -1
  243. package/dist/ui/gui/api.d.ts +0 -1
  244. package/dist/ui/gui/api.js.map +1 -1
  245. package/dist/ui/gui/view.d.ts +0 -1
  246. package/dist/ui/gui/view.js.map +1 -1
  247. package/dist/ui/tui/controller.d.ts +0 -1
  248. package/dist/ui/tui/controller.js +70 -24
  249. package/dist/ui/tui/controller.js.map +1 -1
  250. package/dist/ui/tui/menu.d.ts +1 -2
  251. package/dist/ui/tui/menu.js +2 -2
  252. package/dist/ui/tui/menu.js.map +1 -1
  253. package/dist/ui/tui/options.d.ts +0 -1
  254. package/dist/ui/tui/options.js.map +1 -1
  255. package/dist/ui/tui/receipts.d.ts +0 -1
  256. package/dist/ui/tui/receipts.js +4 -1
  257. package/dist/ui/tui/receipts.js.map +1 -1
  258. package/dist/ui/tui/status.d.ts +1 -2
  259. package/dist/ui/tui/status.js +4 -2
  260. package/dist/ui/tui/status.js.map +1 -1
  261. package/dist/ui/tui/tiers.d.ts +0 -1
  262. package/dist/ui/tui/tiers.js.map +1 -1
  263. package/package.json +2 -2
  264. package/dist/adapters/codex-capacity/index.d.ts.map +0 -1
  265. package/dist/adapters/codex-capacity/parse.d.ts.map +0 -1
  266. package/dist/adapters/codex-capacity/reading.d.ts.map +0 -1
  267. package/dist/adapters/codex-capacity/sensor.d.ts.map +0 -1
  268. package/dist/adapters/codex-capacity/types.d.ts.map +0 -1
  269. package/dist/adapters/opencode/escalation-tool.d.ts.map +0 -1
  270. package/dist/adapters/opencode/events.d.ts.map +0 -1
  271. package/dist/adapters/opencode/hooks.d.ts.map +0 -1
  272. package/dist/adapters/opencode/index.d.ts.map +0 -1
  273. package/dist/adapters/opencode/inventory.d.ts.map +0 -1
  274. package/dist/adapters/opencode/report.d.ts.map +0 -1
  275. package/dist/adapters/opencode/session-ops.d.ts.map +0 -1
  276. package/dist/adapters/opencode/storage.d.ts.map +0 -1
  277. package/dist/adapters/opencode/tier-tool.d.ts.map +0 -1
  278. package/dist/adapters/opencode/types.d.ts.map +0 -1
  279. package/dist/core/compatibility/gate.d.ts.map +0 -1
  280. package/dist/core/compatibility/index.d.ts.map +0 -1
  281. package/dist/core/compatibility/types.d.ts.map +0 -1
  282. package/dist/core/scheduler/admit.d.ts.map +0 -1
  283. package/dist/core/scheduler/escalate.d.ts.map +0 -1
  284. package/dist/core/scheduler/index.d.ts.map +0 -1
  285. package/dist/core/scheduler/mode.d.ts.map +0 -1
  286. package/dist/core/scheduler/types.d.ts.map +0 -1
  287. package/dist/core/tier-policy/index.d.ts.map +0 -1
  288. package/dist/core/tier-policy/resolve.d.ts.map +0 -1
  289. package/dist/core/tier-policy/tier-list.d.ts.map +0 -1
  290. package/dist/core/tier-policy/types.d.ts.map +0 -1
  291. package/dist/core/work-unit/index.d.ts.map +0 -1
  292. package/dist/core/work-unit/interruption.d.ts.map +0 -1
  293. package/dist/core/work-unit/tracker.d.ts.map +0 -1
  294. package/dist/core/work-unit/types.d.ts.map +0 -1
  295. package/dist/execution/continuation/execute.d.ts.map +0 -1
  296. package/dist/execution/continuation/index.d.ts.map +0 -1
  297. package/dist/execution/continuation/ledger.d.ts +0 -20
  298. package/dist/execution/continuation/ledger.d.ts.map +0 -1
  299. package/dist/execution/continuation/ledger.js +0 -31
  300. package/dist/execution/continuation/ledger.js.map +0 -1
  301. package/dist/execution/continuation/plan.d.ts.map +0 -1
  302. package/dist/execution/continuation/prompts.d.ts.map +0 -1
  303. package/dist/execution/continuation/types.d.ts.map +0 -1
  304. package/dist/execution/escalation/index.d.ts.map +0 -1
  305. package/dist/execution/escalation/types.d.ts.map +0 -1
  306. package/dist/execution/index.d.ts.map +0 -1
  307. package/dist/execution/parking/index.d.ts.map +0 -1
  308. package/dist/execution/parking/plan.d.ts.map +0 -1
  309. package/dist/execution/recovery/gate.d.ts +0 -20
  310. package/dist/execution/recovery/gate.d.ts.map +0 -1
  311. package/dist/execution/recovery/gate.js +0 -23
  312. package/dist/execution/recovery/gate.js.map +0 -1
  313. package/dist/execution/recovery/index.d.ts +0 -3
  314. package/dist/execution/recovery/index.d.ts.map +0 -1
  315. package/dist/execution/recovery/index.js +0 -2
  316. package/dist/execution/recovery/index.js.map +0 -1
  317. package/dist/execution/retry/decide.d.ts.map +0 -1
  318. package/dist/execution/retry/index.d.ts.map +0 -1
  319. package/dist/execution/retry/types.d.ts.map +0 -1
  320. package/dist/gui.d.ts.map +0 -1
  321. package/dist/health/capacity/index.d.ts.map +0 -1
  322. package/dist/health/capacity/merge.d.ts.map +0 -1
  323. package/dist/health/capacity/registry.d.ts.map +0 -1
  324. package/dist/health/capacity/types.d.ts.map +0 -1
  325. package/dist/health/circuit-breaker/breaker.d.ts.map +0 -1
  326. package/dist/health/circuit-breaker/index.d.ts.map +0 -1
  327. package/dist/health/circuit-breaker/types.d.ts.map +0 -1
  328. package/dist/health/classifier/classify.d.ts.map +0 -1
  329. package/dist/health/classifier/index.d.ts.map +0 -1
  330. package/dist/health/classifier/types.d.ts.map +0 -1
  331. package/dist/health/index.d.ts.map +0 -1
  332. package/dist/health/resource-health/index.d.ts.map +0 -1
  333. package/dist/health/resource-health/key.d.ts.map +0 -1
  334. package/dist/health/resource-health/registry.d.ts.map +0 -1
  335. package/dist/health/resource-health/transitions.d.ts.map +0 -1
  336. package/dist/health/resource-health/types.d.ts.map +0 -1
  337. package/dist/index.d.ts.map +0 -1
  338. package/dist/plugin-id.d.ts.map +0 -1
  339. package/dist/rpc/definition.d.ts.map +0 -1
  340. package/dist/rpc/handlers.d.ts.map +0 -1
  341. package/dist/rpc/status.d.ts.map +0 -1
  342. package/dist/rpc.d.ts.map +0 -1
  343. package/dist/state/capacity/index.d.ts.map +0 -1
  344. package/dist/state/capacity/parse.d.ts.map +0 -1
  345. package/dist/state/capacity/store.d.ts.map +0 -1
  346. package/dist/state/capacity/types.d.ts.map +0 -1
  347. package/dist/state/health/index.d.ts.map +0 -1
  348. package/dist/state/health/parse.d.ts.map +0 -1
  349. package/dist/state/health/store.d.ts.map +0 -1
  350. package/dist/state/health/types.d.ts.map +0 -1
  351. package/dist/state/parked-work/index.d.ts.map +0 -1
  352. package/dist/state/parked-work/parse.d.ts.map +0 -1
  353. package/dist/state/parked-work/store.d.ts.map +0 -1
  354. package/dist/state/parked-work/types.d.ts.map +0 -1
  355. package/dist/state/receipts/bound.d.ts.map +0 -1
  356. package/dist/state/receipts/index.d.ts.map +0 -1
  357. package/dist/state/receipts/parse.d.ts.map +0 -1
  358. package/dist/state/receipts/store.d.ts.map +0 -1
  359. package/dist/state/receipts/types.d.ts.map +0 -1
  360. package/dist/state/session-modes/index.d.ts.map +0 -1
  361. package/dist/state/session-modes/parse.d.ts.map +0 -1
  362. package/dist/state/session-modes/store.d.ts.map +0 -1
  363. package/dist/state/session-modes/types.d.ts.map +0 -1
  364. package/dist/state/settings/index.d.ts.map +0 -1
  365. package/dist/state/settings/parse.d.ts.map +0 -1
  366. package/dist/state/settings/store.d.ts.map +0 -1
  367. package/dist/state/settings/types.d.ts.map +0 -1
  368. package/dist/supervisor/index.d.ts.map +0 -1
  369. package/dist/supervisor/log.d.ts.map +0 -1
  370. package/dist/supervisor/supervisor.d.ts.map +0 -1
  371. package/dist/supervisor/types.d.ts.map +0 -1
  372. package/dist/supervisor/view.d.ts.map +0 -1
  373. package/dist/tui.d.ts.map +0 -1
  374. package/dist/ui/gui/api.d.ts.map +0 -1
  375. package/dist/ui/gui/view.d.ts.map +0 -1
  376. package/dist/ui/tui/controller.d.ts.map +0 -1
  377. package/dist/ui/tui/menu.d.ts.map +0 -1
  378. package/dist/ui/tui/options.d.ts.map +0 -1
  379. package/dist/ui/tui/receipts.d.ts.map +0 -1
  380. package/dist/ui/tui/status.d.ts.map +0 -1
  381. package/dist/ui/tui/tiers.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"gate.js","sourceRoot":"","sources":["../../../src/core/compatibility/gate.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,SAAS,gBAAgB,CAAC,KAAyB;IACjD,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;AACpE,CAAC;AAED,SAAS,kBAAkB,CACzB,SAAwC,EACxC,QAA2B;IAE3B,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAA;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAyB,EAAE,MAAc;IAC1E,MAAM,OAAO,GAA4B,EAAE,CAAA;IAE3C,IAAI,SAAS,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;IACtC,CAAC;IACD,IAAI,SAAS,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;IACnC,CAAC;IACD,IAAI,SAAS,CAAC,OAAO,KAAK,SAAS,IAAI,SAAS,CAAC,gBAAgB,KAAK,IAAI,EAAE,CAAC;QAC3E,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;IACrC,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,S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AAC,KAAK,KAAK,SAAS;QAC1B,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QACvB,CAAC,kBAAkB,CAAC,SAAS,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAChE,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;IAC5C,CAAC;IACD,IACE,MAAM,CAAC,MAAM,KAAK,SAAS;QAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QACxB,CAAC,kBAAkB,CAAC,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAClE,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAA;IAC7C,CAAC;IAED,IAAI,gBAAgB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,CAAA;QAC7C,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;QAC1C,CAAC;aAAM,IAAI,YAAY,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;AACtD,CAAC","sourcesContent":["import type { CandidateModel, Demand, IncompatibilityReason, Verdict } from \"./types.js\"\n\n/** A finite, non-negative token count is assessable; anything else is unknown demand. */\nfunction assessableTokens(value: number | undefined): value is number {\n return value !== undefined && Number.isFinite(value) && value >= 0\n}\n\nfunction supportsModalities(\n supported: readonly string[] | undefined,\n demanded: readonly string[],\n): boolean {\n if (supported === undefined) {\n return false\n }\n return demanded.every((modality) => supported.includes(modality))\n}\n\n/**\n * Run every check and accumulate reasons in fixed order. A candidate is\n * compatible only when no reason applies; unknown candidate metadata never\n * satisfies a stated requirement.\n */\nexport function checkCompatibility(candidate: CandidateModel, demand: Demand): Verdict {\n const reasons: IncompatibilityReason[] = []\n\n if (candidate.providerEnabled !== true) {\n reasons.push(\"provider-unavailable\")\n }\n if (candidate.enabled !== true) {\n reasons.push(\"model-unavailable\")\n }\n if (candidate.variant !== undefined && candidate.variantAvailable !== true) {\n reasons.push(\"variant-unavailable\")\n }\n\n if (demand.tools === true && candidate.capabilities?.tools !== true) {\n reasons.push(\"tool-use-unsupported\")\n }\n if (\n demand.input !== undefined &&\n demand.input.length > 0 &&\n !supportsModalities(candidate.capabilities?.input, demand.input)\n ) {\n reasons.push(\"input-modality-unsupported\")\n }\n if (\n demand.output !== undefined &&\n demand.output.length > 0 &&\n !supportsModalities(candidate.capabilities?.output, demand.output)\n ) {\n reasons.push(\"output-modality-unsupported\")\n }\n\n if (assessableTokens(demand.contextTokens)) {\n const contextLimit = candidate.limit?.context\n if (!assessableTokens(contextLimit)) {\n reasons.push(\"context-capacity-unknown\")\n } else if (contextLimit < demand.contextTokens) {\n reasons.push(\"context-capacity-insufficient\")\n }\n }\n\n return { compatible: reasons.length === 0, reasons }\n}\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from "./types.js";
2
2
  export * from "./gate.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/compatibility/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/compatibility/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA","sourcesContent":["export * from \"./types.js\"\nexport * from \"./gate.js\"\n"]}
@@ -51,4 +51,3 @@ export interface Verdict {
51
51
  readonly compatible: boolean;
52
52
  readonly reasons: readonly IncompatibilityReason[];
53
53
  }
54
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/compatibility/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAmCH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,sBAAsB;IACtB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;IACtB,4BAA4B;IAC5B,6BAA6B;IAC7B,+BAA+B;IAC/B,0BAA0B;CACU,CAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/compatibility/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAmCH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,sBAAsB;IACtB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;IACtB,4BAA4B;IAC5B,6BAA6B;IAC7B,+BAA+B;IAC/B,0BAA0B;CACU,CAAA","sourcesContent":["/**\n * Compatibility gate (ADP-017): filters candidates on context capacity,\n * tool use, modalities, and model/variant/provider availability BEFORE\n * health/preference ranking. Pure — adapters map OpenCode `Model.Info` /\n * `Provider.Info` into `CandidateModel`, this module never touches\n * `@opencode/plugin` types.\n *\n * Conservative rule: metadata the gate needs but cannot see is treated as\n * NOT satisfying the requirement (e.g. unknown `enabled`, unknown tool\n * support, unknown context limit). Only demand-side quantities that are\n * themselves unknown are skipped — there is nothing to check against.\n */\n\n/** What the executing work needs from a resource. All demand fields are optional. */\nexport interface Demand {\n /** The unit needs tool use. `undefined`/`false` imposes no tool requirement. */\n readonly tools?: boolean | undefined\n /** Input modalities the unit carries (e.g. `\"text\"`, `\"image\"`). */\n readonly input?: readonly string[] | undefined\n /** Output modalities the unit must produce. */\n readonly output?: readonly string[] | undefined\n /** Known or estimated context need in tokens; `undefined` skips the capacity check. */\n readonly contextTokens?: number | undefined\n}\n\n/** Adapter-normalized view of one candidate resource. */\nexport interface CandidateModel {\n readonly providerID: string\n readonly modelID: string\n readonly variant?: string | undefined\n /** Model is enabled in the host inventory. Unknown ⇒ conservative reject. */\n readonly enabled?: boolean | undefined\n /** Provider is available in the host inventory. Unknown ⇒ conservative reject. */\n readonly providerEnabled?: boolean | undefined\n /** The requested variant exists for this model. Unknown ⇒ conservative reject. */\n readonly variantAvailable?: boolean | undefined\n readonly capabilities?:\n | {\n readonly tools?: boolean | undefined\n readonly input?: readonly string[] | undefined\n readonly output?: readonly string[] | undefined\n }\n | undefined\n readonly limit?: { readonly context?: number | undefined } | undefined\n}\n\n/**\n * Why a candidate failed the gate, in the fixed order the checks run:\n * availability → tools → input modalities → output modalities → context.\n */\nexport const INCOMPATIBILITY_REASONS = [\n \"provider-unavailable\",\n \"model-unavailable\",\n \"variant-unavailable\",\n \"tool-use-unsupported\",\n \"input-modality-unsupported\",\n \"output-modality-unsupported\",\n \"context-capacity-insufficient\",\n \"context-capacity-unknown\",\n] as const satisfies readonly string[]\n\nexport type IncompatibilityReason = (typeof INCOMPATIBILITY_REASONS)[number]\n\nexport interface Verdict {\n readonly compatible: boolean\n readonly reasons: readonly IncompatibilityReason[]\n}\n"]}
@@ -4,4 +4,3 @@ import type { AdmissionDecision, SchedulerInput } from "./types.js";
4
4
  * input always yields the same decision, and the function has no effects.
5
5
  */
6
6
  export declare function admit(input: SchedulerInput): AdmissionDecision;
7
- //# sourceMappingURL=admit.d.ts.map
@@ -2,11 +2,13 @@
2
2
  * Admission routing (ADP-013/016/022): pick the model for a fresh work unit,
3
3
  * or decide to defer (OpenCode's choice stands) or park (wait for recovery).
4
4
  *
5
- * Selection order, after the compatibility gate (ADP-017) filters candidates:
6
- * ready → probe → draining. Rationale: a half-open breaker candidate is one
7
- * single-flight admission away from verified recovery; a draining resource is
8
- * being retired, so depending on it is the last resort. Breaker single-flight
9
- * is enforced by the resource-health registry, not here.
5
+ * Selection, after the compatibility gate (ADP-017) filters candidates: the
6
+ * first candidate in user order that is ready or due for its half-open probe
7
+ * wins; draining only when none is. Rationale: a due probe at a preferred
8
+ * position is how that resource returns (ADP-018/019) — passing it over for a
9
+ * later ready sibling would keep it out forever; a draining resource is being
10
+ * retired, so depending on it is the last resort. Breaker single-flight is
11
+ * enforced by the resource-health registry, not here.
10
12
  */
11
13
  import { checkCompatibility } from "../compatibility/gate.js";
12
14
  import { sameModelRef } from "../work-unit/types.js";
@@ -74,10 +76,11 @@ function admitTier(input, tier) {
74
76
  // discrepancy; park rather than invent resources (ADP-005).
75
77
  return { kind: "park", reason: "no-candidates" };
76
78
  }
79
+ // Candidates passed over before the winner (or all of them, when none won).
77
80
  const seen = [];
78
81
  let gateSkipped = 0;
79
82
  const skipWhys = [];
80
- let readyRef;
83
+ let chosen;
81
84
  for (const ref of input.tierCandidates) {
82
85
  const entry = lookup(input.inventory, ref);
83
86
  if (entry === undefined) {
@@ -99,10 +102,11 @@ function admitTier(input, tier) {
99
102
  }
100
103
  const key = schedulerHealthKey(ref);
101
104
  const bucket = classify(input.health[key], input.capacity[key]);
102
- if (bucket.kind === "ready") {
103
- // First ready candidate wins; later candidates are irrelevant, so the
104
- // scan stops and the evidence stays an honest prefix of the user order.
105
- readyRef = ref;
105
+ if (bucket.kind === "ready" || bucket.kind === "probe") {
106
+ // The first ready or probe candidate wins; later candidates are
107
+ // irrelevant, so the scan stops and the evidence stays an honest prefix
108
+ // of the user order.
109
+ chosen = { ref, bucket };
106
110
  break;
107
111
  }
108
112
  seen.push({ ref, bucket });
@@ -111,18 +115,15 @@ function admitTier(input, tier) {
111
115
  }
112
116
  }
113
117
  const first = input.tierCandidates[0];
114
- const evidenceBefore = (until) => seen.slice(0, until).map((e) => {
115
- if (e.bucket.kind === "skip")
116
- return { ref: e.ref, why: e.bucket.why };
117
- return { ref: e.ref, why: e.bucket.kind === "draining" ? "draining" : "probe-in-flight" };
118
- });
119
- if (readyRef !== undefined) {
120
- return apply(readyRef, tier, first !== undefined && sameModelRef(readyRef, first) ? "preferred" : "fallback", evidenceBefore(seen.length), undefined);
118
+ const evidenceBefore = (until) => seen.slice(0, until).map((e) => ({
119
+ ref: e.ref,
120
+ why: e.bucket.kind === "skip" ? e.bucket.why : "draining",
121
+ }));
122
+ if (chosen?.bucket.kind === "probe") {
123
+ return apply(chosen.ref, tier, "probe", evidenceBefore(seen.length), chosen.bucket.probeId);
121
124
  }
122
- const probeIndex = seen.findIndex((e) => e.bucket.kind === "probe");
123
- const probeEntry = probeIndex >= 0 ? seen[probeIndex] : undefined;
124
- if (probeEntry?.bucket.kind === "probe") {
125
- return apply(probeEntry.ref, tier, "probe", evidenceBefore(probeIndex), probeEntry.bucket.probeId);
125
+ if (chosen !== undefined) {
126
+ return apply(chosen.ref, tier, first !== undefined && sameModelRef(chosen.ref, first) ? "preferred" : "fallback", evidenceBefore(seen.length), undefined);
126
127
  }
127
128
  const drainIndex = seen.findIndex((e) => e.bucket.kind === "draining");
128
129
  const drainEntry = drainIndex >= 0 ? seen[drainIndex] : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"admit.js","sourceRoot":"","sources":["../../../src/core/scheduler/admit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAG7D,OAAO,EAAE,YAAY,EAAiB,MAAM,uBAAuB,CAAA;AAWnE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASrE,SAAS,cAAc,CAAC,SAAyB;IAC/C,OAAO;QACL,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,EAAE,EAAE,SAAS,CAAC,OAAO;QACrB,OAAO,EAAE,SAAS,CAAC,OAAO;KAC3B,CAAA;AACH,CAAC;AAED,SAAS,MAAM,CAAC,SAAoC,EAAE,GAAa;IACjE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC,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AU,KAAK,CAAC,KAAqB;IACzC,MAAM,OAAO,GAAoB,KAAK,CAAC,OAAO,CAAA;IAC9C,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAA;IAC3E,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACvC,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;AACvC,CAAC","sourcesContent":["/**\n * Admission routing (ADP-013/016/022): pick the model for a fresh work unit,\n * or decide to defer (OpenCode's choice stands) or park (wait for recovery).\n *\n * Selection, after the compatibility gate (ADP-017) filters candidates: the\n * first candidate in user order that is ready or due for its half-open probe\n * wins; draining only when none is. Rationale: a due probe at a preferred\n * position is how that resource returns (ADP-018/019) — passing it over for a\n * later ready sibling would keep it out forever; a draining resource is being\n * retired, so depending on it is the last resort. Breaker single-flight is\n * enforced by the resource-health registry, not here.\n */\nimport { checkCompatibility } from \"../compatibility/gate.js\"\nimport type { CandidateModel } from \"../compatibility/types.js\"\nimport type { RoutingDecision, TierName } from \"../tier-policy/types.js\"\nimport { sameModelRef, type ModelRef } from \"../work-unit/types.js\"\nimport type { Assessment } from \"../../health/resource-health/types.js\"\nimport type { CapacitySignals } from \"../../health/capacity/types.js\"\nimport type {\n AdmissionDecision,\n ApplyDecision,\n ApplyReason,\n SchedulerInput,\n SkippedCandidate,\n SkipReason,\n} from \"./types.js\"\nimport { MAX_EVIDENCE_SKIPPED, schedulerHealthKey } from \"./types.js\"\n\n/** The health/capacity view of one candidate, resolved to an admission bucket. */\ntype Bucket =\n | { readonly kind: \"ready\" }\n | { readonly kind: \"probe\"; readonly probeId: string }\n | { readonly kind: \"draining\" }\n | { readonly kind: \"skip\"; readonly why: SkipReason }\n\nfunction refOfCandidate(candidate: CandidateModel): ModelRef {\n return {\n providerID: candidate.providerID,\n id: candidate.modelID,\n variant: candidate.variant,\n }\n}\n\nfunction lookup(inventory: readonly CandidateModel[], ref: ModelRef): CandidateModel | undefined {\n return inventory.find((candidate) => sameModelRef(refOfCandidate(candidate), ref))\n}\n\nfunction classify(\n assessment: Assessment | undefined,\n signals: CapacitySignals | undefined,\n): Bucket {\n if (signals?.exhausted === true) {\n return { kind: \"skip\", why: \"capacity-exhausted\" }\n }\n if (assessment === undefined) {\n return signals?.draining === true ? { kind: \"draining\" } : { kind: \"ready\" }\n }\n if (assessment.kind === \"probe\") {\n return { kind: \"probe\", probeId: assessment.ticket.id }\n }\n if (assessment.kind === \"available\") {\n return signals?.draining === true ? { kind: \"draining\" } : { kind: \"ready\" }\n }\n return assessment.reason === \"draining\"\n ? { kind: \"draining\" }\n : { kind: \"skip\", why: assessment.reason }\n}\n\nfunction apply(\n model: ModelRef,\n tier: TierName | undefined,\n reason: ApplyReason,\n skipped: readonly SkippedCandidate[],\n probeId: string | undefined,\n): ApplyDecision {\n return {\n kind: \"apply\",\n model,\n ...(tier === undefined ? {} : { tier }),\n reason,\n evidence: {\n skipped: skipped.slice(0, MAX_EVIDENCE_SKIPPED),\n ...(probeId === undefined ? {} : { probeId }),\n },\n }\n}\n\nfunction admitPin(input: SchedulerInput, pin: ModelRef): AdmissionDecision {\n const entry = lookup(input.inventory, pin)\n if (entry === undefined) {\n return { kind: \"defer\", reason: \"pin-unverifiable\" }\n }\n const verdict = checkCompatibility(entry, input.demand)\n if (!verdict.compatible) {\n return { kind: \"defer\", reason: \"pin-incompatible\", detail: verdict.reasons.join(\",\") }\n }\n const key = schedulerHealthKey(pin)\n const bucket = classify(input.health[key], input.capacity[key])\n if (bucket.kind === \"skip\") {\n return { kind: \"park\", reason: \"pin-blocked\", detail: bucket.why }\n }\n // Manual intent wins (GOAL): a pinned model is applied even while draining;\n // a probe admission is recorded for observability but never overrides intent.\n return apply(pin, undefined, \"pin\", [], bucket.kind === \"probe\" ? bucket.probeId : undefined)\n}\n\nfunction admitTier(input: SchedulerInput, tier: TierName): AdmissionDecision {\n if (input.tierCandidates.length === 0) {\n // The tier was reported configured but has an empty list — a configuration\n // discrepancy; park rather than invent resources (ADP-005).\n return { kind: \"park\", reason: \"no-candidates\" }\n }\n // Candidates passed over before the winner (or all of them, when none won).\n const seen: { ref: ModelRef; bucket: Extract<Bucket, { kind: \"draining\" | \"skip\" }> }[] = []\n let gateSkipped = 0\n const skipWhys: string[] = []\n let chosen: { ref: ModelRef; bucket: Extract<Bucket, { kind: \"ready\" | \"probe\" }> } | undefined\n for (const ref of input.tierCandidates) {\n const entry = lookup(input.inventory, ref)\n if (entry === undefined) {\n seen.push({ ref, bucket: { kind: \"skip\", why: \"not-in-inventory\" } })\n skipWhys.push(\"not-in-inventory\")\n gateSkipped += 1\n continue\n }\n const verdict = checkCompatibility(entry, input.demand)\n if (!verdict.compatible) {\n // The gate reports incompatible only when at least one reason exists; the\n // non-null assertion is the only way to express that invariant locally.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const why = verdict.reasons[0]!\n seen.push({ ref, bucket: { kind: \"skip\", why } })\n skipWhys.push(why)\n gateSkipped += 1\n continue\n }\n const key = schedulerHealthKey(ref)\n const bucket = classify(input.health[key], input.capacity[key])\n if (bucket.kind === \"ready\" || bucket.kind === \"probe\") {\n // The first ready or probe candidate wins; later candidates are\n // irrelevant, so the scan stops and the evidence stays an honest prefix\n // of the user order.\n chosen = { ref, bucket }\n break\n }\n seen.push({ ref, bucket })\n if (bucket.kind === \"skip\") {\n skipWhys.push(bucket.why)\n }\n }\n const first = input.tierCandidates[0]\n const evidenceBefore = (until: number): SkippedCandidate[] =>\n seen.slice(0, until).map((e): SkippedCandidate => ({\n ref: e.ref,\n why: e.bucket.kind === \"skip\" ? e.bucket.why : \"draining\",\n }))\n if (chosen?.bucket.kind === \"probe\") {\n return apply(chosen.ref, tier, \"probe\", evidenceBefore(seen.length), chosen.bucket.probeId)\n }\n if (chosen !== undefined) {\n return apply(\n chosen.ref,\n tier,\n first !== undefined && sameModelRef(chosen.ref, first) ? \"preferred\" : \"fallback\",\n evidenceBefore(seen.length),\n undefined,\n )\n }\n const drainIndex = seen.findIndex((e) => e.bucket.kind === \"draining\")\n const drainEntry = drainIndex >= 0 ? seen[drainIndex] : undefined\n if (drainEntry !== undefined) {\n return apply(drainEntry.ref, tier, \"draining\", evidenceBefore(drainIndex), undefined)\n }\n const summary = skipWhys.slice(0, 3).join(\",\")\n return {\n kind: \"park\",\n reason: gateSkipped === skipWhys.length ? \"no-compatible-resource\" : \"all-blocked\",\n detail: summary,\n }\n}\n\n/**\n * Decide the model for a fresh work unit. Total and deterministic: the same\n * input always yields the same decision, and the function has no effects.\n */\nexport function admit(input: SchedulerInput): AdmissionDecision {\n const routing: RoutingDecision = input.routing\n if (routing.kind === \"defer\") {\n return { kind: \"defer\", reason: \"routing-defer\", detail: routing.reason }\n }\n if (routing.kind === \"pin\") {\n return admitPin(input, routing.model)\n }\n return admitTier(input, routing.tier)\n}\n"]}
@@ -4,4 +4,3 @@ import type { DeferDecision, EscalateDecision, EscalationInput } from "./types.j
4
4
  * proceed. Total and deterministic.
5
5
  */
6
6
  export declare function planEscalation(input: EscalationInput): EscalateDecision | DeferDecision;
7
- //# sourceMappingURL=escalate.d.ts.map
@@ -2,11 +2,12 @@
2
2
  * Capability escalation planner (ADP-015).
3
3
  *
4
4
  * Escalation is justified only by non-empty structured evidence, follows the
5
- * ladder same model / current effort → same model / stronger effort → next
6
- * tier, and is bounded by a finite per-unit budget. Every output either moves
7
- * strictly up the ladder or refuses — the planner can never produce a loop,
8
- * because each accepted step strictly increases a well-founded measure
9
- * (variant index within the ladder, then tier index).
5
+ * ladder next tier, and is bounded by the caller's finite budget. The
6
+ * same-model stronger-variant rung is not implemented: it would need an
7
+ * ordered variant ladder the host does not expose, and strength is never
8
+ * guessed from variant names. Every output moves strictly up the ladder or
9
+ * refuses. Termination rests on the budget, which the caller must carry
10
+ * across every unit of one task (each escalation continues on a new unit).
10
11
  */
11
12
  import { nextTier } from "../tier-policy/types.js";
12
13
  import { MAX_ESCALATION_EVIDENCE } from "./types.js";
@@ -31,18 +32,6 @@ export function planEscalation(input) {
31
32
  if (input.budget.max <= 0 || input.budget.used >= input.budget.max) {
32
33
  return { kind: "defer", reason: "escalation-budget-exhausted" };
33
34
  }
34
- const { currentModel, variantLadder } = input;
35
- if (currentModel.variant !== undefined && variantLadder !== undefined) {
36
- const index = variantLadder.indexOf(currentModel.variant);
37
- if (index >= 0) {
38
- // For a well-formed (non-holey) ladder, undefined here means the current
39
- // variant is the strongest — the ladder is exhausted.
40
- const stronger = variantLadder[index + 1];
41
- if (stronger !== undefined) {
42
- return escalate(input, { ...currentModel, variant: stronger }, "variant", input.currentTier);
43
- }
44
- }
45
- }
46
35
  const next = nextTier(input.currentTier);
47
36
  if (next === undefined) {
48
37
  return { kind: "defer", reason: "escalation-ceiling" };
@@ -1 +1 @@
1
- {"version":3,"file":"escalate.js","sourceRoot":"","sources":["../../../src/core/scheduler/escalate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEpD,SAAS,QAAQ,CACf,KAAsB,EACtB,MAAgB,EAChB,IAA8B,EAC9B,IAA8B;IAE9B,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,uBAAuB,CAAC;QACxD,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC;KAC1D,CAAA;AACH,CAAC;AAED;;;GAGG;AACH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AQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;IACxC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAA;IACxD,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAA;IACzC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAA;IAC7D,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;AAC9C,CAAC","sourcesContent":["/**\n * Capability escalation planner (ADP-015).\n *\n * Escalation is justified only by non-empty structured evidence, follows the\n * ladder next tier, and is bounded by the caller's finite budget. The\n * same-model stronger-variant rung is not implemented: it would need an\n * ordered variant ladder the host does not expose, and strength is never\n * guessed from variant names. Every output moves strictly up the ladder or\n * refuses. Termination rests on the budget, which the caller must carry\n * across every unit of one task (each escalation continues on a new unit).\n */\nimport { nextTier } from \"../tier-policy/types.js\"\nimport type { ModelRef } from \"../work-unit/types.js\"\nimport type { DeferDecision, EscalateDecision, EscalationInput } from \"./types.js\"\nimport { MAX_ESCALATION_EVIDENCE } from \"./types.js\"\n\nfunction escalate(\n input: EscalationInput,\n target: ModelRef,\n step: EscalateDecision[\"step\"],\n tier: EscalateDecision[\"tier\"],\n): EscalateDecision {\n return {\n kind: \"escalate\",\n target,\n step,\n tier,\n evidence: input.evidence.slice(-MAX_ESCALATION_EVIDENCE),\n budgetRemaining: input.budget.max - input.budget.used - 1,\n }\n}\n\n/**\n * Plan the next escalation step, or defer with the reason escalation cannot\n * proceed. Total and deterministic.\n */\nexport function planEscalation(input: EscalationInput): EscalateDecision | DeferDecision {\n if (input.evidence.length === 0) {\n return { kind: \"defer\", reason: \"escalation-not-justified\" }\n }\n if (input.budget.max <= 0 || input.budget.used >= input.budget.max) {\n return { kind: \"defer\", reason: \"escalation-budget-exhausted\" }\n }\n const next = nextTier(input.currentTier)\n if (next === undefined) {\n return { kind: \"defer\", reason: \"escalation-ceiling\" }\n }\n const target = input.nextTierResources[0]\n if (target === undefined) {\n return { kind: \"defer\", reason: \"escalation-no-candidate\" }\n }\n return escalate(input, target, \"tier\", next)\n}\n"]}
@@ -2,4 +2,3 @@ export * from "./types.js";
2
2
  export * from "./admit.js";
3
3
  export * from "./escalate.js";
4
4
  export * from "./mode.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/scheduler/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/scheduler/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA","sourcesContent":["export * from \"./types.js\"\nexport * from \"./admit.js\"\nexport * from \"./escalate.js\"\nexport * from \"./mode.js\"\n"]}
@@ -6,4 +6,3 @@
6
6
  */
7
7
  import type { Decision, OperatingMode } from "./types.js";
8
8
  export declare function forMode(decision: Decision, mode: OperatingMode): Decision;
9
- //# sourceMappingURL=mode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mode.js","sourceRoot":"","sources":["../../../src/core/scheduler/mode.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,OAAO,CAAC,QAAkB,EAAE,IAAmB;IAC7D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;IAClD,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;AAClD,CAAC"}
1
+ {"version":3,"file":"mode.js","sourceRoot":"","sources":["../../../src/core/scheduler/mode.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,OAAO,CAAC,QAAkB,EAAE,IAAmB;IAC7D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;IAClD,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;AAClD,CAAC","sourcesContent":["/**\n * Operating-mode wrapper (GOAL operating modes). OBSERVE and CONTROL run the\n * identical core; OBSERVE wraps the result without applying it. OFF never\n * reaches the scheduler, but the total wrapper maps it to an explicit defer\n * so the union stays closed.\n */\nimport type { Decision, OperatingMode } from \"./types.js\"\n\nexport function forMode(decision: Decision, mode: OperatingMode): Decision {\n if (mode === \"observe\") {\n return { kind: \"observe-only\", would: decision }\n }\n if (mode === \"active\") {\n return decision\n }\n return { kind: \"defer\", reason: \"adaptive-off\" }\n}\n"]}
@@ -40,7 +40,7 @@ export type SchedulerDeferReason = (typeof SCHEDULER_DEFER_REASONS)[number];
40
40
  export declare const PARK_REASONS: readonly ["pin-blocked", "no-candidates", "no-compatible-resource", "all-blocked"];
41
41
  export type ParkReason = (typeof PARK_REASONS)[number];
42
42
  /** Why a tier candidate was not usable. Superset of gate and health reasons. */
43
- export declare const SKIP_REASONS: readonly ["not-in-inventory", "capacity-exhausted", "incompatible", "provider-unavailable", "model-unavailable", "variant-unavailable", "tool-use-unsupported", "input-modality-unsupported", "output-modality-unsupported", "context-capacity-insufficient", "context-capacity-unknown", "unavailable", "quota-exhausted", "rate-limited", "breaker-open", "probe-in-flight", "draining"];
43
+ export declare const SKIP_REASONS: readonly ["not-in-inventory", "capacity-exhausted", "provider-unavailable", "model-unavailable", "variant-unavailable", "tool-use-unsupported", "input-modality-unsupported", "output-modality-unsupported", "context-capacity-insufficient", "context-capacity-unknown", "unavailable", "quota-exhausted", "rate-limited", "breaker-open", "probe-in-flight", "draining"];
44
44
  export type SkipReason = (typeof SKIP_REASONS)[number];
45
45
  /** A tier candidate that could not take the work, with the bounded reason. */
46
46
  export interface SkippedCandidate {
@@ -91,12 +91,6 @@ export declare const MAX_ESCALATION_EVIDENCE = 4;
91
91
  export interface EscalationInput {
92
92
  readonly currentModel: ModelRef;
93
93
  readonly currentTier: TierName;
94
- /**
95
- * Ordered variant ids for the current model, weakest → strongest, when the
96
- * host inventory exposes an order. Without a ladder the variant step is
97
- * skipped — strength is never guessed from variant names (ADP-004).
98
- */
99
- readonly variantLadder?: readonly string[] | undefined;
100
94
  /** Configured resources of the next tier, user order, already gated. */
101
95
  readonly nextTierResources: readonly ModelRef[];
102
96
  /** Non-empty structured evidence justifies escalation. */
@@ -107,7 +101,7 @@ export interface EscalateDecision {
107
101
  readonly kind: "escalate";
108
102
  readonly target: ModelRef;
109
103
  readonly step: EscalationStep;
110
- /** Tier of the target: unchanged for the variant step, next tier otherwise. */
104
+ /** Tier of the escalated-to resource (the next tier). */
111
105
  readonly tier: TierName;
112
106
  readonly evidence: readonly EscalationEvidence[];
113
107
  readonly budgetRemaining: number;
@@ -140,4 +134,3 @@ export interface SchedulerInput {
140
134
  export declare const MAX_EVIDENCE_SKIPPED = 8;
141
135
  /** Canonical health/capacity map key for a candidate model reference. */
142
136
  export declare function schedulerHealthKey(ref: ModelRef): string;
143
- //# sourceMappingURL=types.d.ts.map
@@ -48,7 +48,6 @@ export const PARK_REASONS = [
48
48
  export const SKIP_REASONS = [
49
49
  "not-in-inventory",
50
50
  "capacity-exhausted",
51
- "incompatible",
52
51
  ...INCOMPATIBILITY_REASONS,
53
52
  ...BLOCKED_REASONS,
54
53
  ];
@@ -60,6 +59,8 @@ export const ESCALATION_EVIDENCE_KINDS = [
60
59
  "repeated-failure",
61
60
  "explicit-blocker",
62
61
  ];
62
+ // Persisted receipt vocabulary. The planner produces only "tier" today; the
63
+ // historical "variant" step stays parseable so old receipts are not dropped.
63
64
  export const ESCALATION_STEPS = ["variant", "tier"];
64
65
  /** Bound on evidence carried by an `escalate` decision (latest wins). */
65
66
  export const MAX_ESCALATION_EVIDENCE = 4;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/scheduler/types.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAEnE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAsC,CAAA;AAIhG,oEAAoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK;IACL,WAAW;IACX,UAAU;IACV,OAAO;IACP,UAAU;CAC0B,CAAA;AAItC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1B,6BAA6B;IAC7B,oBAAoB;IACpB,yBAAyB;IACzB,cAAc;CACsB,CAAA;AAItC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa;IACb,eAAe;IACf,wBAAwB;IACxB,aAAa;CACuB,CAAA;AAItC,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,kBAAkB;IAClB,oBAAoB;IACpB,cAAc;IACd,GAAG,uBAAuB;IAC1B,GAAG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B,GAAG;IACrC,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1B,6BAA6B;IAC7B,oBAAoB;IACpB,yBAAyB;IACzB,cAAc;CACsB,CAAA;AAItC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa;IACb,eAAe;IACf,wBAAwB;IACxB,aAAa;CACuB,CAAA;AAItC,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,kBAAkB;IAClB,oBAAoB;IACpB,GAAG,uBAAuB;IAC1B,GAAG,eAAe;CACkB,CAAA;AAuCtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,eAAe;IACf,oBAAoB;IACpB,sBAAsB;IACtB,kBAAkB;IAClB,kBAAkB;CACkB,CAAA;AAStC,4EAA4E;AAC5E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,CAAsC,CAAA;AAUxF,yEAAyE;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAmDxC,mEAAmE;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAErC,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAAC,GAAa;IAC9C,OAAO,aAAa,CAClB,GAAG,CAAC,OAAO,KAAK,SAAS;QACvB,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE;QACjD,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,CAC5E,CAAA;AACH,CAAC","sourcesContent":["/**\n * Scheduler types (ADP-013/015/016/022): the pure decision core's vocabulary.\n *\n * The core is a total function over its inputs — routing outcome, demand,\n * inventory, per-candidate health and capacity views — and never performs\n * effects. Effects (switching, receipts, parking) belong to the execution\n * layer. OBSERVE and CONTROL call the same core; mode handling is a pure\n * wrapper (`forMode`).\n */\nimport type { ModelRef } from \"../work-unit/types.js\"\nimport type { RoutingDecision, TierName } from \"../tier-policy/types.js\"\nimport type { CandidateModel, Demand } from \"../compatibility/types.js\"\nimport type { Assessment } from \"../../health/resource-health/types.js\"\nimport type { CapacitySignals } from \"../../health/capacity/types.js\"\nimport { INCOMPATIBILITY_REASONS } from \"../compatibility/types.js\"\nimport { BLOCKED_REASONS } from \"../../health/resource-health/types.js\"\nimport { resourceKeyID } from \"../../health/resource-health/key.js\"\n\n/** Operating modes (GOAL manual control). The plugin defaults to `observe`. */\nexport const OPERATING_MODES = [\"off\", \"observe\", \"active\"] as const satisfies readonly string[]\n\nexport type OperatingMode = (typeof OPERATING_MODES)[number]\n\n/** Why an `apply` decision chose its model (receipt provenance). */\nexport const APPLY_REASONS = [\n \"pin\",\n \"preferred\",\n \"fallback\",\n \"probe\",\n \"draining\",\n] as const satisfies readonly string[]\n\nexport type ApplyReason = (typeof APPLY_REASONS)[number]\n\n/**\n * Why the core did not apply anything.\n * - `routing-defer` — the tier ladder deferred; OpenCode's choice stands.\n * - `pin-unverifiable` — the pinned model is not in the host inventory, so\n * availability cannot be verified (inventory gate); deferring keeps the\n * user's own model choice, which for a pin is typically the pinned model.\n * - `pin-incompatible` — the pinned model cannot execute the work.\n * - `escalation-*` — escalation evidence was absent, the budget was spent,\n * the tier ladder is at its ceiling, or the next tier has no resources\n * (no cross-tier borrowing).\n * - `adaptive-off` — the plugin is off; only reachable through `forMode`.\n */\nexport const SCHEDULER_DEFER_REASONS = [\n \"routing-defer\",\n \"pin-unverifiable\",\n \"pin-incompatible\",\n \"escalation-not-justified\",\n \"escalation-budget-exhausted\",\n \"escalation-ceiling\",\n \"escalation-no-candidate\",\n \"adaptive-off\",\n] as const satisfies readonly string[]\n\nexport type SchedulerDeferReason = (typeof SCHEDULER_DEFER_REASONS)[number]\n\n/**\n * Why work parks instead of applying: the required tier has no usable\n * resource right now. Parking waits for recovery — it never borrows across\n * tiers (ADP-022).\n */\nexport const PARK_REASONS = [\n \"pin-blocked\",\n \"no-candidates\",\n \"no-compatible-resource\",\n \"all-blocked\",\n] as const satisfies readonly string[]\n\nexport type ParkReason = (typeof PARK_REASONS)[number]\n\n/** Why a tier candidate was not usable. Superset of gate and health reasons. */\nexport const SKIP_REASONS = [\n \"not-in-inventory\",\n \"capacity-exhausted\",\n ...INCOMPATIBILITY_REASONS,\n ...BLOCKED_REASONS,\n] as const satisfies readonly string[]\n\nexport type SkipReason = (typeof SKIP_REASONS)[number]\n\n/** A tier candidate that could not take the work, with the bounded reason. */\nexport interface SkippedCandidate {\n readonly ref: ModelRef\n readonly why: SkipReason\n}\n\n/** Bounded evidence attached to an `apply` decision. */\nexport interface ApplyEvidence {\n /** Candidates considered before the applied one, in order (bounded). */\n readonly skipped: readonly SkippedCandidate[]\n /** Breaker probe id when the applied unit is the half-open probe. */\n readonly probeId?: string | undefined\n}\n\nexport interface ApplyDecision {\n readonly kind: \"apply\"\n readonly model: ModelRef\n /** Required tier; `undefined` for pin routing (a pin is not a tier). */\n readonly tier?: TierName | undefined\n readonly reason: ApplyReason\n readonly evidence: ApplyEvidence\n}\n\nexport interface DeferDecision {\n readonly kind: \"defer\"\n readonly reason: SchedulerDeferReason\n readonly detail?: string | undefined\n}\n\nexport interface ParkDecision {\n readonly kind: \"park\"\n readonly reason: ParkReason\n readonly detail?: string | undefined\n}\n\n/** Structured capability evidence for escalation (ADP-015). Never prose mining. */\nexport const ESCALATION_EVIDENCE_KINDS = [\n \"agent-request\",\n \"reviewer-rejection\",\n \"verification-failure\",\n \"repeated-failure\",\n \"explicit-blocker\",\n] as const satisfies readonly string[]\n\nexport type EscalationEvidenceKind = (typeof ESCALATION_EVIDENCE_KINDS)[number]\n\nexport interface EscalationEvidence {\n readonly kind: EscalationEvidenceKind\n readonly detail?: string | undefined\n}\n\n// Persisted receipt vocabulary. The planner produces only \"tier\" today; the\n// historical \"variant\" step stays parseable so old receipts are not dropped.\nexport const ESCALATION_STEPS = [\"variant\", \"tier\"] as const satisfies readonly string[]\n\nexport type EscalationStep = (typeof ESCALATION_STEPS)[number]\n\n/** Finite per-unit escalation budget (ADP-015). `used >= max` ends escalation. */\nexport interface EscalationBudget {\n readonly used: number\n readonly max: number\n}\n\n/** Bound on evidence carried by an `escalate` decision (latest wins). */\nexport const MAX_ESCALATION_EVIDENCE = 4\n\nexport interface EscalationInput {\n readonly currentModel: ModelRef\n readonly currentTier: TierName\n /** Configured resources of the next tier, user order, already gated. */\n readonly nextTierResources: readonly ModelRef[]\n /** Non-empty structured evidence justifies escalation. */\n readonly evidence: readonly EscalationEvidence[]\n readonly budget: EscalationBudget\n}\n\nexport interface EscalateDecision {\n readonly kind: \"escalate\"\n readonly target: ModelRef\n readonly step: EscalationStep\n /** Tier of the escalated-to resource (the next tier). */\n readonly tier: TierName\n readonly evidence: readonly EscalationEvidence[]\n readonly budgetRemaining: number\n}\n\n/** OBSERVE mode's wrapper: the identical decision, recorded but not applied. */\nexport interface ObserveOnlyDecision {\n readonly kind: \"observe-only\"\n readonly would: Decision\n}\n\nexport type Decision =\n ApplyDecision | DeferDecision | ParkDecision | EscalateDecision | ObserveOnlyDecision\n\n/** What admission can return — escalation never originates from admission. */\nexport type AdmissionDecision = ApplyDecision | DeferDecision | ParkDecision\n\n/**\n * Everything admission looks at. `health` and `capacity` are keyed by\n * `schedulerHealthKey(ref)`; an absent health entry means \"no observed\n * failure\" (the registry's default), an absent capacity entry means \"no\n * estimate\" — unknown is never treated as exhausted.\n */\nexport interface SchedulerInput {\n readonly routing: RoutingDecision\n readonly demand: Demand\n /** Host inventory (adapter-normalized). Candidates absent here are unverifiable. */\n readonly inventory: readonly CandidateModel[]\n /** Configured resources of the required tier, in user order (ADP-005). */\n readonly tierCandidates: readonly ModelRef[]\n readonly health: Readonly<Record<string, Assessment>>\n readonly capacity: Readonly<Record<string, CapacitySignals>>\n}\n\n/** Bound on the `skipped` evidence list of an `apply` decision. */\nexport const MAX_EVIDENCE_SKIPPED = 8\n\n/** Canonical health/capacity map key for a candidate model reference. */\nexport function schedulerHealthKey(ref: ModelRef): string {\n return resourceKeyID(\n ref.variant === undefined\n ? { providerID: ref.providerID, modelID: ref.id }\n : { providerID: ref.providerID, modelID: ref.id, variantID: ref.variant },\n )\n}\n"]}
@@ -1,4 +1,3 @@
1
1
  export * from "./types.js";
2
2
  export * from "./resolve.js";
3
3
  export * from "./tier-list.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tier-policy/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tier-policy/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA","sourcesContent":["export * from \"./types.js\"\nexport * from \"./resolve.js\"\nexport * from \"./tier-list.js\"\n"]}
@@ -16,4 +16,3 @@
16
16
  */
17
17
  import { type RoutingDecision, type RoutingInput } from "./types.js";
18
18
  export declare function resolveRouting(input: RoutingInput): RoutingDecision;
19
- //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/core/tier-policy/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,GAKZ,MAAM,YAAY,CAAA;AAEnB,MAAM,UAAU,cAAc,CAAC,KAAmB;IAChD,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,E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K,CAAC,WAAW,KAAK,SAAS,IAAI,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAA;IAEhG,IAAI,SAAS,KAAK,SAAS,IAAI,aAAa,KAAK,SAAS,IAAI,SAAS,KAAK,aAAa,EAAE,CAAC;QAC1F,OAAO,eAAe,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IAC1E,CAAC;IACD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IACxE,CAAC;IACD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,eAAe,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IACnF,CAAC;IAED,OAAO,eAAe,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;AACxE,CAAC;AAED,SAAS,eAAe,CACtB,IAAc,EACd,MAAqB,EACrB,eAAoC;IAEpC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/D,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AACvC,CAAC","sourcesContent":["/**\n * Routing priority ladder (ADP-002):\n *\n * explicit user/model pin\n * → explicit tier request\n * → supported agent role hint\n * → deterministic local request evidence (auxiliary kinds)\n * → default `standard`\n *\n * Ambiguity within a level resolves to `standard`. An explicit signal whose\n * tier has no configured resources is NOT silently downgraded to another\n * tier (that would borrow across tiers — GOAL tenet 4): the router defers\n * instead (ADP-003), keeping OpenCode's model choice. No LLM call and no\n * keyword classifier participates (ADP-004) — every input is a structured\n * field.\n */\nimport {\n AUXILIARY_TIER,\n DEFAULT_TIER,\n isAuxiliary,\n type RoutingDecision,\n type RoutingInput,\n type RoutingSource,\n type TierName,\n} from \"./types.js\"\n\nexport function resolveRouting(input: RoutingInput): RoutingDecision {\n if (input.pin !== undefined) {\n return { kind: \"pin\", model: input.pin }\n }\n\n if (input.tierRequest !== undefined) {\n return byConfiguration(input.tierRequest.tier, \"tier-request\", input.configuredTiers)\n }\n\n // Role level: an agent-name hint from user policy and deterministic\n // auxiliary-request evidence. Conflict inside the level is ambiguity\n // (ADP-002) and resolves to `standard`; agreement keeps the tier.\n const agentTier =\n input.agent !== undefined &&\n input.agent.length > 0 &&\n input.agentTiers !== undefined &&\n Object.hasOwn(input.agentTiers, input.agent)\n ? input.agentTiers[input.agent]\n : undefined\n const auxiliaryTier =\n input.requestKind !== undefined && isAuxiliary(input.requestKind) ? AUXILIARY_TIER : undefined\n\n if (agentTier !== undefined && auxiliaryTier !== undefined && agentTier !== auxiliaryTier) {\n return byConfiguration(DEFAULT_TIER, \"ambiguity\", input.configuredTiers)\n }\n if (agentTier !== undefined) {\n return byConfiguration(agentTier, \"agent-role\", input.configuredTiers)\n }\n if (auxiliaryTier !== undefined) {\n return byConfiguration(auxiliaryTier, \"auxiliary-request\", input.configuredTiers)\n }\n\n return byConfiguration(DEFAULT_TIER, \"default\", input.configuredTiers)\n}\n\nfunction byConfiguration(\n tier: TierName,\n source: RoutingSource,\n configuredTiers: readonly TierName[],\n): RoutingDecision {\n if (!configuredTiers.includes(tier)) {\n return { kind: \"defer\", tier, reason: \"tier-not-configured\" }\n }\n return { kind: \"tier\", tier, source }\n}\n"]}
@@ -8,4 +8,3 @@
8
8
  */
9
9
  import { type ModelRef } from "../work-unit/types.js";
10
10
  export declare function normalizeTierList(resources: readonly ModelRef[]): ModelRef[];
11
- //# sourceMappingURL=tier-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tier-list.js","sourceRoot":"","sources":["../../../src/core/tier-policy/tier-list.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAiB,MAAM,uBAAuB,CAAA;AAEnE,MAAM,UAAU,iBAAiB,CAAC,SAA8B;IAC9D,MAAM,IAAI,GAAe,EAAE,CAAA;IAC3B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjE,SAAQ;QACV,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC9D,SAAQ;QACV,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
1
+ {"version":3,"file":"tier-list.js","sourceRoot":"","sources":["../../../src/core/tier-policy/tier-list.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAiB,MAAM,uBAAuB,CAAA;AAEnE,MAAM,UAAU,iBAAiB,CAAC,SAA8B;IAC9D,MAAM,IAAI,GAAe,EAAE,CAAA;IAC3B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjE,SAAQ;QACV,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC9D,SAAQ;QACV,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["/**\n * User-configured tier lists (ADP-005): each tier is an ordered list of\n * resources; list order is user policy and is never reordered by Adaptive.\n * Normalization only removes unusable entries and exact duplicates — it\n * never reorders and never merges look-alike names (ADP-006: similar model\n * names across providers are never equivalent unless the user configures\n * both, and full-reference equality below is deliberately provider-scoped).\n */\nimport { sameModelRef, type ModelRef } from \"../work-unit/types.js\"\n\nexport function normalizeTierList(resources: readonly ModelRef[]): ModelRef[] {\n const kept: ModelRef[] = []\n for (const resource of resources) {\n if (resource.providerID.length === 0 || resource.id.length === 0) {\n continue\n }\n if (kept.some((existing) => sameModelRef(existing, resource))) {\n continue\n }\n kept.push(resource)\n }\n return kept\n}\n"]}
@@ -6,6 +6,8 @@
6
6
  import type { ModelRef } from "../work-unit/types.js";
7
7
  export declare const TIERS: readonly ["quick", "standard", "advanced"];
8
8
  export type TierName = (typeof TIERS)[number];
9
+ /** Vocabulary guard without a cast: strict member equality. */
10
+ export declare function isTierName(tier: string): tier is TierName;
9
11
  /**
10
12
  * Request kinds the OpenCode `context` hook exposes for the executing
11
13
  * request. Auxiliary kinds are trivial host-internal requests (title,
@@ -82,4 +84,3 @@ export declare function isAuxiliary(kind: RequestKind): boolean;
82
84
  * → `advanced`. `advanced` is the last tier — there is no next.
83
85
  */
84
86
  export declare function nextTier(tier: TierName): TierName | undefined;
85
- //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,8 @@
1
1
  export const TIERS = ["quick", "standard", "advanced"];
2
+ /** Vocabulary guard without a cast: strict member equality. */
3
+ export function isTierName(tier) {
4
+ return TIERS.some((name) => name === tier);
5
+ }
2
6
  /**
3
7
  * Request kinds the OpenCode `context` hook exposes for the executing
4
8
  * request. Auxiliary kinds are trivial host-internal requests (title,
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/tier-policy/types.ts"],"names":[],"mappings":"AAOA,MAAM,CAA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,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY;IACZ,OAAO;IACP,UAAU;CAC0B,CAAA;AAMtC,2CAA2C;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAa,OAAO,CAAA;AAE/C,2CAA2C;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAa,UAAU,CAAA;AAEhD,iFAAiF;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,gBAAgB;IAChB,iBAAiB;CACmB,CAAA;AAiCtC,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK;IACL,cAAc;IACd,YAAY;IACZ,mBAAmB;IACnB,WAAW;IACX,SAAS;CAC2B,CAAA;AAItC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,qBAAqB,CAAsC,CAAA;AAiBzF,yDAAyD;AACzD,MAAM,UAAU,WAAW,CAAC,IAAiB;IAC3C,OAAO,IAAI,KAAK,SAAS,CAAA;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAc;IACrC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,OAAO,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;AACzB,CAAC","sourcesContent":["/**\n * Tier-policy types (ADP-002..006). Tier names are an ecosystem proposal —\n * OpenCode has no native capability-tier API — so every tier semantic lives\n * in this module and nowhere else.\n */\nimport type { ModelRef } from \"../work-unit/types.js\"\n\nexport const TIERS = [\"quick\", \"standard\", \"advanced\"] as const satisfies readonly string[]\n\nexport type TierName = (typeof TIERS)[number]\n\n/** Vocabulary guard without a cast: strict member equality. */\nexport function isTierName(tier: string): tier is TierName {\n return TIERS.some((name) => name === tier)\n}\n\n/**\n * Request kinds the OpenCode `context` hook exposes for the executing\n * request. Auxiliary kinds are trivial host-internal requests (title,\n * compaction, generate) that must not consume an unnecessarily expensive\n * tier — this is structured host evidence, not prompt keyword matching\n * (ADP-004).\n */\nexport const AUXILIARY_KINDS = [\n \"compaction\",\n \"title\",\n \"generate\",\n] as const satisfies readonly string[]\n\nexport type AuxiliaryKind = (typeof AUXILIARY_KINDS)[number]\n\nexport type RequestKind = \"primary\" | AuxiliaryKind\n\n/** Auxiliary requests route to `quick`. */\nexport const AUXILIARY_TIER: TierName = \"quick\"\n\n/** Unambiguous fallback tier (ADP-002). */\nexport const DEFAULT_TIER: TierName = \"standard\"\n\n/** How an explicit tier request reached the plugin (provenance for receipts). */\nexport const TIER_REQUEST_VIAS = [\n \"manual-command\",\n \"session-setting\",\n] as const satisfies readonly string[]\n\nexport type TierRequestVia = (typeof TIER_REQUEST_VIAS)[number]\n\nexport interface TierRequest {\n readonly tier: TierName\n readonly via: TierRequestVia\n}\n\n/**\n * Everything the ladder may look at, all optional except the configuration\n * view. Every signal is a structured field supplied by the adapter — never\n * text mined from a prompt.\n */\nexport interface RoutingInput {\n /** Explicit user/model pin (manual control); always wins (ADP-002). */\n readonly pin?: ModelRef | undefined\n /** Explicit tier request (manual command or session setting). */\n readonly tierRequest?: TierRequest | undefined\n /** OpenCode agent name of the executing request, when the host supplies one. */\n readonly agent?: string | undefined\n /** Request kind from the `context` hook, when known. */\n readonly requestKind?: RequestKind | undefined\n /** User-configured agent-name → tier mapping (role hints are user policy). */\n readonly agentTiers?: Readonly<Record<string, TierName>> | undefined\n /**\n * Tiers that currently have at least one configured resource (ADP-005).\n * A tier without resources can never be honored — Adaptive does not\n * invent resources and never borrows across tiers (GOAL tenet 4).\n */\n readonly configuredTiers: readonly TierName[]\n}\n\n/** Why the ladder produced a tier decision (receipt provenance). */\nexport const ROUTING_SOURCES = [\n \"pin\",\n \"tier-request\",\n \"agent-role\",\n \"auxiliary-request\",\n \"ambiguity\",\n \"default\",\n] as const satisfies readonly string[]\n\nexport type RoutingSource = (typeof ROUTING_SOURCES)[number]\n\nexport const DEFER_REASONS = [\"tier-not-configured\"] as const satisfies readonly string[]\n\nexport type DeferReason = (typeof DEFER_REASONS)[number]\n\n/**\n * Routing outcome (ADP-002/003):\n * - `pin` — route to the pinned resource.\n * - `tier` — route within the named tier.\n * - `defer` — Adaptive has no reason to override ordinary OpenCode behavior;\n * the unit keeps OpenCode's model choice. `tier` records which tier the\n * ladder resolved to before the configuration gate blocked it.\n */\nexport type RoutingDecision =\n | { readonly kind: \"pin\"; readonly model: ModelRef }\n | { readonly kind: \"tier\"; readonly tier: TierName; readonly source: RoutingSource }\n | { readonly kind: \"defer\"; readonly tier: TierName; readonly reason: DeferReason }\n\n/** True only for the trivial auxiliary request kinds. */\nexport function isAuxiliary(kind: RequestKind): boolean {\n return kind !== \"primary\"\n}\n\n/**\n * Escalation ladder order (GOAL capability escalation): `quick` → `standard`\n * → `advanced`. `advanced` is the last tier — there is no next.\n */\nexport function nextTier(tier: TierName): TierName | undefined {\n const index = TIERS.indexOf(tier)\n return TIERS[index + 1]\n}\n"]}
@@ -1,4 +1,3 @@
1
1
  export * from "./interruption.js";
2
2
  export * from "./types.js";
3
3
  export * from "./tracker.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/work-unit/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/work-unit/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA","sourcesContent":["export * from \"./interruption.js\"\nexport * from \"./types.js\"\nexport * from \"./tracker.js\"\n"]}
@@ -5,4 +5,3 @@
5
5
  */
6
6
  export declare const INTERRUPT_REASONS: readonly ["user", "shutdown", "superseded", "inactivity"];
7
7
  export type InterruptReason = (typeof INTERRUPT_REASONS)[number];
8
- //# sourceMappingURL=interruption.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interruption.js","sourceRoot":"","sources":["../../../src/core/work-unit/interruption.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,UAAU;IACV,YAAY;IACZ,YAAY;CACwB,CAAA"}
1
+ {"version":3,"file":"interruption.js","sourceRoot":"","sources":["../../../src/core/work-unit/interruption.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,UAAU;IACV,YAAY;IACZ,YAAY;CACwB,CAAA","sourcesContent":["/**\n * Why an OpenCode execution was interrupted. Values mirror the verified\n * `session.execution.interrupted` event payload (`reason`), which OpenCode\n * guarantees to be one of these four.\n */\nexport const INTERRUPT_REASONS = [\n \"user\",\n \"shutdown\",\n \"superseded\",\n \"inactivity\",\n] as const satisfies readonly string[]\n\nexport type InterruptReason = (typeof INTERRUPT_REASONS)[number]\n"]}
@@ -15,9 +15,16 @@
15
15
  * then attributed external — again the safe direction, since the adapter
16
16
  * serializes per-session switches.
17
17
  */
18
- import { type ActiveUnit, type ApplyResult, type ModelRef, type ModelTransition, type OpenedResult, type WorkUnitEvent } from "./types.js";
18
+ import { type ActiveUnit, type ApplyResult, type ModelRef, type ModelTransition, type OpenedResult, type SelectionResult, type WorkUnitEvent } from "./types.js";
19
19
  export declare class WorkUnitTracker {
20
20
  #private;
21
+ /**
22
+ * Bounded per-session maps (last model, pending own-switch note): a
23
+ * long-lived host meets unbounded short-lived sessions, and the model
24
+ * knowledge of a long-gone session is worthless. Insertion order gives the
25
+ * eviction (oldest session first).
26
+ */
27
+ static readonly MAX_TRACKED_SESSIONS = 1024;
21
28
  /**
22
29
  * Arms the pending own-switch note consumed by the next matching
23
30
  * `model-selected` event for this session.
@@ -35,12 +42,12 @@ export declare class WorkUnitTracker {
35
42
  apply(event: Extract<WorkUnitEvent, {
36
43
  kind: "execution-started";
37
44
  }>): OpenedResult;
45
+ apply(event: Extract<WorkUnitEvent, {
46
+ kind: "model-selected" | "model-request";
47
+ }>): SelectionResult;
38
48
  apply(event: WorkUnitEvent): ApplyResult;
39
49
  /** The open unit for a session, if any. */
40
50
  active(sessionID: string): ActiveUnit | undefined;
41
- /** All currently open units, in insertion order. */
42
- activeAll(): ActiveUnit[];
43
51
  /** Last model known to be in effect for a session, across episodes. */
44
52
  lastModel(sessionID: string): ModelTransition | undefined;
45
53
  }
46
- //# sourceMappingURL=tracker.d.ts.map
@@ -1,3 +1,4 @@
1
+ var _a;
1
2
  /**
2
3
  * Episode tracker (ADP-001): a deterministic, clock-free state machine over
3
4
  * normalized work-unit events, keyed by session. All timestamps come from the
@@ -16,9 +17,31 @@
16
17
  * serializes per-session switches.
17
18
  */
18
19
  import { sameModelRef, } from "./types.js";
20
+ /** Insert into a bounded map, evicting the oldest (first) entry past the cap. */
21
+ function setBounded(map, key, value, cap) {
22
+ if (!map.has(key) && map.size >= cap) {
23
+ for (const oldest of map.keys()) {
24
+ map.delete(oldest);
25
+ break;
26
+ }
27
+ }
28
+ map.set(key, value);
29
+ }
19
30
  export class WorkUnitTracker {
20
31
  #active = new Map();
32
+ // Intentionally unbounded: evicting an episode counter could re-mint a unit
33
+ // id (`${sessionID}#${episode}`) that a persisted receipt or parked record
34
+ // already carries — a collision replaces parked work. The map holds one
35
+ // number per session ever seen; that growth is bounded by session churn,
36
+ // not by episodes.
21
37
  #episodes = new Map();
38
+ /**
39
+ * Bounded per-session maps (last model, pending own-switch note): a
40
+ * long-lived host meets unbounded short-lived sessions, and the model
41
+ * knowledge of a long-gone session is worthless. Insertion order gives the
42
+ * eviction (oldest session first).
43
+ */
44
+ static MAX_TRACKED_SESSIONS = 1024;
22
45
  #lastModel = new Map();
23
46
  #pendingOwn = new Map();
24
47
  /**
@@ -26,7 +49,7 @@ export class WorkUnitTracker {
26
49
  * `model-selected` event for this session.
27
50
  */
28
51
  noteOwnSwitch(sessionID, model) {
29
- this.#pendingOwn.set(sessionID, model);
52
+ setBounded(this.#pendingOwn, sessionID, model, _a.MAX_TRACKED_SESSIONS);
30
53
  }
31
54
  /**
32
55
  * Raises each session's episode floor. Used at startup: unit ids are
@@ -100,10 +123,6 @@ export class WorkUnitTracker {
100
123
  active(sessionID) {
101
124
  return this.#active.get(sessionID);
102
125
  }
103
- /** All currently open units, in insertion order. */
104
- activeAll() {
105
- return [...this.#active.values()];
106
- }
107
126
  /** Last model known to be in effect for a session, across episodes. */
108
127
  lastModel(sessionID) {
109
128
  return this.#lastModel.get(sessionID);
@@ -120,7 +139,7 @@ export class WorkUnitTracker {
120
139
  }
121
140
  #trackModel(sessionID, at, model, source) {
122
141
  const transition = { at, model, source };
123
- this.#lastModel.set(sessionID, transition);
142
+ setBounded(this.#lastModel, sessionID, transition, _a.MAX_TRACKED_SESSIONS);
124
143
  const current = this.#active.get(sessionID);
125
144
  if (current === undefined)
126
145
  return { kind: "model-noted", transition };
@@ -133,4 +152,5 @@ export class WorkUnitTracker {
133
152
  return { kind: "model-tracked", unit, transition };
134
153
  }
135
154
  }
155
+ _a = WorkUnitTracker;
136
156
  //# sourceMappingURL=tracker.js.map