agentfootprint 9.41.0 → 9.44.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 (367) hide show
  1. package/AGENTS.md +30 -1
  2. package/CLAUDE.md +3 -1
  3. package/ai-instructions/claude-code/SKILL.md +31 -1
  4. package/dist/adapters/hosting/agentcore.js +163 -23
  5. package/dist/adapters/hosting/agentcore.js.map +1 -1
  6. package/dist/adapters/hosting/firestoreSessions.js +184 -14
  7. package/dist/adapters/hosting/firestoreSessions.js.map +1 -1
  8. package/dist/adapters/hosting/googleAgentEngine.js +29 -0
  9. package/dist/adapters/hosting/googleAgentEngine.js.map +1 -1
  10. package/dist/artifacts/conformance/cases.js +20 -0
  11. package/dist/artifacts/conformance/cases.js.map +1 -1
  12. package/dist/artifacts/scopePath.js +41 -1
  13. package/dist/artifacts/scopePath.js.map +1 -1
  14. package/dist/core/Agent.js +17 -1
  15. package/dist/core/Agent.js.map +1 -1
  16. package/dist/core/agent/AgentBuilder.js +56 -1
  17. package/dist/core/agent/AgentBuilder.js.map +1 -1
  18. package/dist/core/agent/buildAgentChart.js +5 -1
  19. package/dist/core/agent/buildAgentChart.js.map +1 -1
  20. package/dist/core/agent/buildDynamicAgentChart.js +5 -1
  21. package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
  22. package/dist/core/agent/coverage/absent.js +163 -0
  23. package/dist/core/agent/coverage/absent.js.map +1 -0
  24. package/dist/core/agent/coverage/answer.js +90 -0
  25. package/dist/core/agent/coverage/answer.js.map +1 -0
  26. package/dist/core/agent/coverage/evidence.js +90 -0
  27. package/dist/core/agent/coverage/evidence.js.map +1 -0
  28. package/dist/core/agent/coverage/index.js +37 -0
  29. package/dist/core/agent/coverage/index.js.map +1 -0
  30. package/dist/core/agent/coverage/items.js +91 -0
  31. package/dist/core/agent/coverage/items.js.map +1 -0
  32. package/dist/core/agent/coverage/ledger.js +131 -0
  33. package/dist/core/agent/coverage/ledger.js.map +1 -0
  34. package/dist/core/agent/coverage/read.js +56 -0
  35. package/dist/core/agent/coverage/read.js.map +1 -0
  36. package/dist/core/agent/coverage/types.js +15 -0
  37. package/dist/core/agent/coverage/types.js.map +1 -0
  38. package/dist/core/agent/evidence/evidenceIndex.js +18 -1
  39. package/dist/core/agent/evidence/evidenceIndex.js.map +1 -1
  40. package/dist/core/agent/stages/prepareFinal.js +44 -3
  41. package/dist/core/agent/stages/prepareFinal.js.map +1 -1
  42. package/dist/core/agent/stages/toolCalls.js +109 -3
  43. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  44. package/dist/core/agent/toolEffects.js +1 -1
  45. package/dist/core/outputFallback.js.map +1 -1
  46. package/dist/debug.js +49 -25
  47. package/dist/debug.js.map +1 -1
  48. package/dist/esm/adapters/hosting/agentcore.d.ts +8 -0
  49. package/dist/esm/adapters/hosting/agentcore.js +163 -23
  50. package/dist/esm/adapters/hosting/agentcore.js.map +1 -1
  51. package/dist/esm/adapters/hosting/firestoreSessions.d.ts +162 -14
  52. package/dist/esm/adapters/hosting/firestoreSessions.js +182 -13
  53. package/dist/esm/adapters/hosting/firestoreSessions.js.map +1 -1
  54. package/dist/esm/adapters/hosting/googleAgentEngine.d.ts +16 -1
  55. package/dist/esm/adapters/hosting/googleAgentEngine.js +29 -0
  56. package/dist/esm/adapters/hosting/googleAgentEngine.js.map +1 -1
  57. package/dist/esm/artifacts/conformance/cases.js +20 -0
  58. package/dist/esm/artifacts/conformance/cases.js.map +1 -1
  59. package/dist/esm/artifacts/scopePath.d.ts +31 -0
  60. package/dist/esm/artifacts/scopePath.js +41 -1
  61. package/dist/esm/artifacts/scopePath.js.map +1 -1
  62. package/dist/esm/core/Agent.d.ts +8 -1
  63. package/dist/esm/core/Agent.js +18 -2
  64. package/dist/esm/core/Agent.js.map +1 -1
  65. package/dist/esm/core/agent/AgentBuilder.d.ts +43 -0
  66. package/dist/esm/core/agent/AgentBuilder.js +56 -1
  67. package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
  68. package/dist/esm/core/agent/buildAgentChart.d.ts +9 -0
  69. package/dist/esm/core/agent/buildAgentChart.js +6 -2
  70. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  71. package/dist/esm/core/agent/buildDynamicAgentChart.js +6 -2
  72. package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
  73. package/dist/esm/core/agent/coverage/absent.d.ts +104 -0
  74. package/dist/esm/core/agent/coverage/absent.js +157 -0
  75. package/dist/esm/core/agent/coverage/absent.js.map +1 -0
  76. package/dist/esm/core/agent/coverage/answer.d.ts +46 -0
  77. package/dist/esm/core/agent/coverage/answer.js +86 -0
  78. package/dist/esm/core/agent/coverage/answer.js.map +1 -0
  79. package/dist/esm/core/agent/coverage/evidence.d.ts +68 -0
  80. package/dist/esm/core/agent/coverage/evidence.js +86 -0
  81. package/dist/esm/core/agent/coverage/evidence.js.map +1 -0
  82. package/dist/esm/core/agent/coverage/index.d.ts +17 -0
  83. package/dist/esm/core/agent/coverage/index.js +17 -0
  84. package/dist/esm/core/agent/coverage/index.js.map +1 -0
  85. package/dist/esm/core/agent/coverage/items.d.ts +35 -0
  86. package/dist/esm/core/agent/coverage/items.js +85 -0
  87. package/dist/esm/core/agent/coverage/items.js.map +1 -0
  88. package/dist/esm/core/agent/coverage/ledger.d.ts +80 -0
  89. package/dist/esm/core/agent/coverage/ledger.js +125 -0
  90. package/dist/esm/core/agent/coverage/ledger.js.map +1 -0
  91. package/dist/esm/core/agent/coverage/read.d.ts +51 -0
  92. package/dist/esm/core/agent/coverage/read.js +52 -0
  93. package/dist/esm/core/agent/coverage/read.js.map +1 -0
  94. package/dist/esm/core/agent/coverage/types.d.ts +142 -0
  95. package/dist/esm/core/agent/coverage/types.js +14 -0
  96. package/dist/esm/core/agent/coverage/types.js.map +1 -0
  97. package/dist/esm/core/agent/evidence/evidenceIndex.d.ts +7 -0
  98. package/dist/esm/core/agent/evidence/evidenceIndex.js +18 -1
  99. package/dist/esm/core/agent/evidence/evidenceIndex.js.map +1 -1
  100. package/dist/esm/core/agent/stages/prepareFinal.d.ts +18 -0
  101. package/dist/esm/core/agent/stages/prepareFinal.js +42 -2
  102. package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
  103. package/dist/esm/core/agent/stages/toolCalls.js +109 -3
  104. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  105. package/dist/esm/core/agent/toolEffects.d.ts +2 -2
  106. package/dist/esm/core/agent/toolEffects.js +1 -1
  107. package/dist/esm/core/agent/types.d.ts +14 -0
  108. package/dist/esm/core/outputFallback.d.ts +15 -1
  109. package/dist/esm/core/outputFallback.js.map +1 -1
  110. package/dist/esm/debug.d.ts +1 -0
  111. package/dist/esm/debug.js +7 -0
  112. package/dist/esm/debug.js.map +1 -1
  113. package/dist/esm/events/dispatcher.d.ts +1 -1
  114. package/dist/esm/events/dispatcher.js.map +1 -1
  115. package/dist/esm/events/payloads.d.ts +82 -0
  116. package/dist/esm/events/registry.d.ts +11 -1
  117. package/dist/esm/events/registry.js +10 -0
  118. package/dist/esm/events/registry.js.map +1 -1
  119. package/dist/esm/hosting/conformance/cases.d.ts +2 -1
  120. package/dist/esm/hosting/conformance/cases.js +229 -22
  121. package/dist/esm/hosting/conformance/cases.js.map +1 -1
  122. package/dist/esm/hosting/conformance/types.d.ts +7 -7
  123. package/dist/esm/hosting/errors.d.ts +28 -0
  124. package/dist/esm/hosting/errors.js +40 -0
  125. package/dist/esm/hosting/errors.js.map +1 -1
  126. package/dist/esm/hosting/index.d.ts +11 -3
  127. package/dist/esm/hosting/index.js +15 -2
  128. package/dist/esm/hosting/index.js.map +1 -1
  129. package/dist/esm/hosting/memorySessions.js +39 -0
  130. package/dist/esm/hosting/memorySessions.js.map +1 -1
  131. package/dist/esm/hosting/sessionRetention.d.ts +56 -0
  132. package/dist/esm/hosting/sessionRetention.js +69 -0
  133. package/dist/esm/hosting/sessionRetention.js.map +1 -0
  134. package/dist/esm/hosting/sqliteSessions.d.ts +11 -1
  135. package/dist/esm/hosting/sqliteSessions.js +51 -0
  136. package/dist/esm/hosting/sqliteSessions.js.map +1 -1
  137. package/dist/esm/hosting/types.d.ts +184 -0
  138. package/dist/esm/hosting/types.js +9 -0
  139. package/dist/esm/hosting/types.js.map +1 -1
  140. package/dist/esm/hosting-providers.d.ts +15 -11
  141. package/dist/esm/hosting-providers.js +21 -11
  142. package/dist/esm/hosting-providers.js.map +1 -1
  143. package/dist/esm/index.d.ts +1 -0
  144. package/dist/esm/index.js +18 -0
  145. package/dist/esm/index.js.map +1 -1
  146. package/dist/esm/lib/context-bisect/arms/apply.d.ts +54 -0
  147. package/dist/esm/lib/context-bisect/arms/apply.js +41 -0
  148. package/dist/esm/lib/context-bisect/arms/apply.js.map +1 -0
  149. package/dist/esm/lib/context-bisect/arms/compare.d.ts +27 -0
  150. package/dist/esm/lib/context-bisect/arms/compare.js +112 -0
  151. package/dist/esm/lib/context-bisect/arms/compare.js.map +1 -0
  152. package/dist/esm/lib/context-bisect/arms/index.d.ts +16 -0
  153. package/dist/esm/lib/context-bisect/arms/index.js +16 -0
  154. package/dist/esm/lib/context-bisect/arms/index.js.map +1 -0
  155. package/dist/esm/lib/context-bisect/arms/manifest.d.ts +79 -0
  156. package/dist/esm/lib/context-bisect/arms/manifest.js +199 -0
  157. package/dist/esm/lib/context-bisect/arms/manifest.js.map +1 -0
  158. package/dist/esm/lib/context-bisect/arms/probe.d.ts +54 -0
  159. package/dist/esm/lib/context-bisect/arms/probe.js +125 -0
  160. package/dist/esm/lib/context-bisect/arms/probe.js.map +1 -0
  161. package/dist/esm/lib/context-bisect/arms/types.d.ts +319 -0
  162. package/dist/esm/lib/context-bisect/arms/types.js +67 -0
  163. package/dist/esm/lib/context-bisect/arms/types.js.map +1 -0
  164. package/dist/esm/lib/context-bisect/arms/validate.d.ts +26 -0
  165. package/dist/esm/lib/context-bisect/arms/validate.js +122 -0
  166. package/dist/esm/lib/context-bisect/arms/validate.js.map +1 -0
  167. package/dist/esm/lib/context-bisect/arms/verdict.d.ts +53 -0
  168. package/dist/esm/lib/context-bisect/arms/verdict.js +103 -0
  169. package/dist/esm/lib/context-bisect/arms/verdict.js.map +1 -0
  170. package/dist/esm/lib/context-bisect/index.d.ts +1 -0
  171. package/dist/esm/lib/context-bisect/index.js +5 -0
  172. package/dist/esm/lib/context-bisect/index.js.map +1 -1
  173. package/dist/esm/lib/injection-engine/index.d.ts +1 -1
  174. package/dist/esm/lib/injection-engine/index.js +3 -1
  175. package/dist/esm/lib/injection-engine/index.js.map +1 -1
  176. package/dist/esm/lib/injection-engine/skillExamples.d.ts +16 -13
  177. package/dist/esm/lib/injection-engine/skillExamples.js +16 -60
  178. package/dist/esm/lib/injection-engine/skillExamples.js.map +1 -1
  179. package/dist/esm/lib/injection-engine/skillGraph.d.ts +50 -0
  180. package/dist/esm/lib/injection-engine/skillGraph.js +52 -1
  181. package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
  182. package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +6 -5
  183. package/dist/esm/lib/injection-engine/skillGraphCheckup.js.map +1 -1
  184. package/dist/esm/lib/injection-engine/skillNeverRoutes.d.ts +131 -0
  185. package/dist/esm/lib/injection-engine/skillNeverRoutes.js +228 -0
  186. package/dist/esm/lib/injection-engine/skillNeverRoutes.js.map +1 -0
  187. package/dist/esm/lib/injection-engine/skillPartition.d.ts +69 -0
  188. package/dist/esm/lib/injection-engine/skillPartition.js +273 -0
  189. package/dist/esm/lib/injection-engine/skillPartition.js.map +1 -0
  190. package/dist/esm/lib/injection-engine/skillsFromDir.d.ts +83 -3
  191. package/dist/esm/lib/injection-engine/skillsFromDir.js +118 -7
  192. package/dist/esm/lib/injection-engine/skillsFromDir.js.map +1 -1
  193. package/dist/esm/lib/injection-engine/skillsFromDirRoutes.d.ts +105 -0
  194. package/dist/esm/lib/injection-engine/skillsFromDirRoutes.js +169 -0
  195. package/dist/esm/lib/injection-engine/skillsFromDirRoutes.js.map +1 -0
  196. package/dist/esm/lib/injection-engine/startRuleClaim.d.ts +91 -0
  197. package/dist/esm/lib/injection-engine/startRuleClaim.js +78 -0
  198. package/dist/esm/lib/injection-engine/startRuleClaim.js.map +1 -0
  199. package/dist/esm/lib/injection-engine/toolOutcome.d.ts +12 -3
  200. package/dist/esm/lib/injection-engine/toolOutcome.js +2 -1
  201. package/dist/esm/lib/injection-engine/toolOutcome.js.map +1 -1
  202. package/dist/events/dispatcher.js.map +1 -1
  203. package/dist/events/registry.js +10 -0
  204. package/dist/events/registry.js.map +1 -1
  205. package/dist/hosting/conformance/cases.js +229 -22
  206. package/dist/hosting/conformance/cases.js.map +1 -1
  207. package/dist/hosting/errors.js +42 -1
  208. package/dist/hosting/errors.js.map +1 -1
  209. package/dist/hosting/index.js +18 -2
  210. package/dist/hosting/index.js.map +1 -1
  211. package/dist/hosting/memorySessions.js +39 -0
  212. package/dist/hosting/memorySessions.js.map +1 -1
  213. package/dist/hosting/sessionRetention.js +73 -0
  214. package/dist/hosting/sessionRetention.js.map +1 -0
  215. package/dist/hosting/sqliteSessions.js +51 -0
  216. package/dist/hosting/sqliteSessions.js.map +1 -1
  217. package/dist/hosting/types.js +10 -1
  218. package/dist/hosting/types.js.map +1 -1
  219. package/dist/hosting-providers.js +21 -11
  220. package/dist/hosting-providers.js.map +1 -1
  221. package/dist/index.js +72 -43
  222. package/dist/index.js.map +1 -1
  223. package/dist/lib/context-bisect/arms/apply.js +45 -0
  224. package/dist/lib/context-bisect/arms/apply.js.map +1 -0
  225. package/dist/lib/context-bisect/arms/compare.js +116 -0
  226. package/dist/lib/context-bisect/arms/compare.js.map +1 -0
  227. package/dist/lib/context-bisect/arms/index.js +35 -0
  228. package/dist/lib/context-bisect/arms/index.js.map +1 -0
  229. package/dist/lib/context-bisect/arms/manifest.js +207 -0
  230. package/dist/lib/context-bisect/arms/manifest.js.map +1 -0
  231. package/dist/lib/context-bisect/arms/probe.js +132 -0
  232. package/dist/lib/context-bisect/arms/probe.js.map +1 -0
  233. package/dist/lib/context-bisect/arms/types.js +68 -0
  234. package/dist/lib/context-bisect/arms/types.js.map +1 -0
  235. package/dist/lib/context-bisect/arms/validate.js +128 -0
  236. package/dist/lib/context-bisect/arms/validate.js.map +1 -0
  237. package/dist/lib/context-bisect/arms/verdict.js +107 -0
  238. package/dist/lib/context-bisect/arms/verdict.js.map +1 -0
  239. package/dist/lib/context-bisect/index.js +23 -1
  240. package/dist/lib/context-bisect/index.js.map +1 -1
  241. package/dist/lib/injection-engine/index.js +4 -1
  242. package/dist/lib/injection-engine/index.js.map +1 -1
  243. package/dist/lib/injection-engine/skillExamples.js +24 -68
  244. package/dist/lib/injection-engine/skillExamples.js.map +1 -1
  245. package/dist/lib/injection-engine/skillGraph.js +52 -1
  246. package/dist/lib/injection-engine/skillGraph.js.map +1 -1
  247. package/dist/lib/injection-engine/skillGraphCheckup.js.map +1 -1
  248. package/dist/lib/injection-engine/skillNeverRoutes.js +234 -0
  249. package/dist/lib/injection-engine/skillNeverRoutes.js.map +1 -0
  250. package/dist/lib/injection-engine/skillPartition.js +277 -0
  251. package/dist/lib/injection-engine/skillPartition.js.map +1 -0
  252. package/dist/lib/injection-engine/skillsFromDir.js +121 -9
  253. package/dist/lib/injection-engine/skillsFromDir.js.map +1 -1
  254. package/dist/lib/injection-engine/skillsFromDirRoutes.js +174 -0
  255. package/dist/lib/injection-engine/skillsFromDirRoutes.js.map +1 -0
  256. package/dist/lib/injection-engine/startRuleClaim.js +85 -0
  257. package/dist/lib/injection-engine/startRuleClaim.js.map +1 -0
  258. package/dist/lib/injection-engine/toolOutcome.js +2 -1
  259. package/dist/lib/injection-engine/toolOutcome.js.map +1 -1
  260. package/dist/types/adapters/hosting/agentcore.d.ts +8 -0
  261. package/dist/types/adapters/hosting/agentcore.d.ts.map +1 -1
  262. package/dist/types/adapters/hosting/firestoreSessions.d.ts +162 -14
  263. package/dist/types/adapters/hosting/firestoreSessions.d.ts.map +1 -1
  264. package/dist/types/adapters/hosting/googleAgentEngine.d.ts +16 -1
  265. package/dist/types/adapters/hosting/googleAgentEngine.d.ts.map +1 -1
  266. package/dist/types/artifacts/conformance/cases.d.ts.map +1 -1
  267. package/dist/types/artifacts/scopePath.d.ts +31 -0
  268. package/dist/types/artifacts/scopePath.d.ts.map +1 -1
  269. package/dist/types/core/Agent.d.ts +8 -1
  270. package/dist/types/core/Agent.d.ts.map +1 -1
  271. package/dist/types/core/agent/AgentBuilder.d.ts +43 -0
  272. package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
  273. package/dist/types/core/agent/buildAgentChart.d.ts +9 -0
  274. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  275. package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
  276. package/dist/types/core/agent/coverage/absent.d.ts +105 -0
  277. package/dist/types/core/agent/coverage/absent.d.ts.map +1 -0
  278. package/dist/types/core/agent/coverage/answer.d.ts +47 -0
  279. package/dist/types/core/agent/coverage/answer.d.ts.map +1 -0
  280. package/dist/types/core/agent/coverage/evidence.d.ts +69 -0
  281. package/dist/types/core/agent/coverage/evidence.d.ts.map +1 -0
  282. package/dist/types/core/agent/coverage/index.d.ts +18 -0
  283. package/dist/types/core/agent/coverage/index.d.ts.map +1 -0
  284. package/dist/types/core/agent/coverage/items.d.ts +36 -0
  285. package/dist/types/core/agent/coverage/items.d.ts.map +1 -0
  286. package/dist/types/core/agent/coverage/ledger.d.ts +81 -0
  287. package/dist/types/core/agent/coverage/ledger.d.ts.map +1 -0
  288. package/dist/types/core/agent/coverage/read.d.ts +52 -0
  289. package/dist/types/core/agent/coverage/read.d.ts.map +1 -0
  290. package/dist/types/core/agent/coverage/types.d.ts +143 -0
  291. package/dist/types/core/agent/coverage/types.d.ts.map +1 -0
  292. package/dist/types/core/agent/evidence/evidenceIndex.d.ts +7 -0
  293. package/dist/types/core/agent/evidence/evidenceIndex.d.ts.map +1 -1
  294. package/dist/types/core/agent/stages/prepareFinal.d.ts +18 -0
  295. package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
  296. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  297. package/dist/types/core/agent/toolEffects.d.ts +2 -2
  298. package/dist/types/core/agent/types.d.ts +14 -0
  299. package/dist/types/core/agent/types.d.ts.map +1 -1
  300. package/dist/types/core/outputFallback.d.ts +15 -1
  301. package/dist/types/core/outputFallback.d.ts.map +1 -1
  302. package/dist/types/debug.d.ts +1 -0
  303. package/dist/types/debug.d.ts.map +1 -1
  304. package/dist/types/events/dispatcher.d.ts +1 -1
  305. package/dist/types/events/dispatcher.d.ts.map +1 -1
  306. package/dist/types/events/payloads.d.ts +82 -0
  307. package/dist/types/events/payloads.d.ts.map +1 -1
  308. package/dist/types/events/registry.d.ts +11 -1
  309. package/dist/types/events/registry.d.ts.map +1 -1
  310. package/dist/types/hosting/conformance/cases.d.ts +2 -1
  311. package/dist/types/hosting/conformance/cases.d.ts.map +1 -1
  312. package/dist/types/hosting/conformance/types.d.ts +7 -7
  313. package/dist/types/hosting/conformance/types.d.ts.map +1 -1
  314. package/dist/types/hosting/errors.d.ts +28 -0
  315. package/dist/types/hosting/errors.d.ts.map +1 -1
  316. package/dist/types/hosting/index.d.ts +11 -3
  317. package/dist/types/hosting/index.d.ts.map +1 -1
  318. package/dist/types/hosting/memorySessions.d.ts.map +1 -1
  319. package/dist/types/hosting/sessionRetention.d.ts +57 -0
  320. package/dist/types/hosting/sessionRetention.d.ts.map +1 -0
  321. package/dist/types/hosting/sqliteSessions.d.ts +11 -1
  322. package/dist/types/hosting/sqliteSessions.d.ts.map +1 -1
  323. package/dist/types/hosting/types.d.ts +184 -0
  324. package/dist/types/hosting/types.d.ts.map +1 -1
  325. package/dist/types/hosting-providers.d.ts +15 -11
  326. package/dist/types/hosting-providers.d.ts.map +1 -1
  327. package/dist/types/index.d.ts +1 -0
  328. package/dist/types/index.d.ts.map +1 -1
  329. package/dist/types/lib/context-bisect/arms/apply.d.ts +55 -0
  330. package/dist/types/lib/context-bisect/arms/apply.d.ts.map +1 -0
  331. package/dist/types/lib/context-bisect/arms/compare.d.ts +28 -0
  332. package/dist/types/lib/context-bisect/arms/compare.d.ts.map +1 -0
  333. package/dist/types/lib/context-bisect/arms/index.d.ts +17 -0
  334. package/dist/types/lib/context-bisect/arms/index.d.ts.map +1 -0
  335. package/dist/types/lib/context-bisect/arms/manifest.d.ts +80 -0
  336. package/dist/types/lib/context-bisect/arms/manifest.d.ts.map +1 -0
  337. package/dist/types/lib/context-bisect/arms/probe.d.ts +55 -0
  338. package/dist/types/lib/context-bisect/arms/probe.d.ts.map +1 -0
  339. package/dist/types/lib/context-bisect/arms/types.d.ts +320 -0
  340. package/dist/types/lib/context-bisect/arms/types.d.ts.map +1 -0
  341. package/dist/types/lib/context-bisect/arms/validate.d.ts +27 -0
  342. package/dist/types/lib/context-bisect/arms/validate.d.ts.map +1 -0
  343. package/dist/types/lib/context-bisect/arms/verdict.d.ts +54 -0
  344. package/dist/types/lib/context-bisect/arms/verdict.d.ts.map +1 -0
  345. package/dist/types/lib/context-bisect/index.d.ts +1 -0
  346. package/dist/types/lib/context-bisect/index.d.ts.map +1 -1
  347. package/dist/types/lib/injection-engine/index.d.ts +1 -1
  348. package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
  349. package/dist/types/lib/injection-engine/skillExamples.d.ts +16 -13
  350. package/dist/types/lib/injection-engine/skillExamples.d.ts.map +1 -1
  351. package/dist/types/lib/injection-engine/skillGraph.d.ts +50 -0
  352. package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
  353. package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts +6 -5
  354. package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts.map +1 -1
  355. package/dist/types/lib/injection-engine/skillNeverRoutes.d.ts +132 -0
  356. package/dist/types/lib/injection-engine/skillNeverRoutes.d.ts.map +1 -0
  357. package/dist/types/lib/injection-engine/skillPartition.d.ts +70 -0
  358. package/dist/types/lib/injection-engine/skillPartition.d.ts.map +1 -0
  359. package/dist/types/lib/injection-engine/skillsFromDir.d.ts +83 -3
  360. package/dist/types/lib/injection-engine/skillsFromDir.d.ts.map +1 -1
  361. package/dist/types/lib/injection-engine/skillsFromDirRoutes.d.ts +106 -0
  362. package/dist/types/lib/injection-engine/skillsFromDirRoutes.d.ts.map +1 -0
  363. package/dist/types/lib/injection-engine/startRuleClaim.d.ts +92 -0
  364. package/dist/types/lib/injection-engine/startRuleClaim.d.ts.map +1 -0
  365. package/dist/types/lib/injection-engine/toolOutcome.d.ts +12 -3
  366. package/dist/types/lib/injection-engine/toolOutcome.d.ts.map +1 -1
  367. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../../../../src/lib/context-bisect/arms/probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,KAAK,EACV,cAAc,EAEd,SAAS,EACT,QAAQ,EACR,eAAe,EACf,WAAW,EACZ,MAAM,YAAY,CAAC;AAIpB,iEAAiE;AACjE,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,iBAAiB,GAChC,OAAO,CAAC,gBAAgB,CAAC,CAgB3B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,gBAAgB,EAC/B,KAAK,EAAE,OAAO,GACb,QAAQ,CAgBV;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,SAAS,eAAe,EAAE,GACpC,cAAc,CAuBhB"}
@@ -0,0 +1,320 @@
1
+ /**
2
+ * Strategy arms — the SUBSTITUTION tier of the counterfactual engine.
3
+ *
4
+ * Pattern: sibling spec type, shared statistics.
5
+ * Role: answer "scorer A versus scorer B", "topK versus a re-ranker",
6
+ * "sliding-window versus token-budget" with the SAME seeded-rerun
7
+ * discipline the ablation tier uses — and without pretending a
8
+ * substitution is a removal.
9
+ *
10
+ * ## Why this is NOT a fifth arm on `AblationSpec`
11
+ *
12
+ * Ablation is REMOVAL. `AblationSpec` names inputs an agent is BUILT from and
13
+ * `applyAblations` filters them out; the ablated agent is strictly smaller than
14
+ * the original. Substitution is REPLACEMENT: the agent that re-ranks instead of
15
+ * taking top-K is not smaller, it is different. Three concrete costs decided
16
+ * this, and each one is a place a shared union would have produced a
17
+ * confident-looking verdict for an incoherent comparison:
18
+ *
19
+ * 1. **`bisectCulprits` would accept it.** The union feeds a delta-debugging
20
+ * search (`bisect.ts`) whose premise is that probes are SUBSETS of removals:
21
+ * it halves the candidate set, probes each half, and returns a "minimal
22
+ * culprit set". Substitutions do not compose that way — swapping the scorer
23
+ * and swapping the window at once is a THIRD arm, not a bigger removal — and
24
+ * the answer it would print ("minimal culprit set = {scorer swap}") is the
25
+ * wrong tier of claim entirely: an arm is an alternative configuration, not
26
+ * a culprit. A type that lets an incoherent comparison reach a verdict is
27
+ * worse than the limitation it removes.
28
+ * 2. **`rerunWithoutSources` would report it under `removed`.** Its result
29
+ * type, its `removableSources` vocabulary and every sentence it composes say
30
+ * "removing X". A substitution arriving through its `ignore` escape hatch
31
+ * would be described, in a field NAME, as something it is not.
32
+ * 3. **`applyAblations` has nowhere to put it.** It returns filtered
33
+ * `{tools, injections, memoryEntries}`. A substitution is not a filter of
34
+ * those inputs; it is a construction choice made before they exist.
35
+ *
36
+ * The rejected third option — a `'strategy'` arm that genuinely ABLATES, i.e.
37
+ * falls back to the library default — was rejected because "no retrieval at
38
+ * all" and "re-rank instead of top-K" are different experiments and only the
39
+ * second is what a researcher means. The manifest already treats `memories: []`
40
+ * as an arm of its own; an arm that silently meant "the default" would answer a
41
+ * question nobody asked while looking like it supported the one they did.
42
+ *
43
+ * So: sibling TYPE, shared STATISTICS. `AblationRunStats`, `SimilarityStats`,
44
+ * `resolveSamples`, `similarityStats`, `costStatsFrom`, `probeFlipped` and
45
+ * `defaultOutcomeComparator` are reused verbatim; nothing in `ablation.ts`,
46
+ * `bisect.ts`, `rerun.ts` or `cost.ts` changed, so the four existing spec arms
47
+ * behave identically (pinned by test/lib/context-bisect/ablation-union-pinned).
48
+ *
49
+ * ## What the library can and cannot DO with an arm
50
+ *
51
+ * For a removal the library can perform the intervention: `applyAblations`
52
+ * filters the inputs. For a substitution it cannot — construction is the
53
+ * consumer's code, and no library can reach into it and replace a scorer. What
54
+ * it can do instead is DECLARE the arm and then VERIFY it took effect, because
55
+ * 9.41.0 made configuration self-describing: `agentfootprint.agent.run_configured`
56
+ * names the provider, model, react mode, window, each memory's strategy /
57
+ * retrieval / embedder, the graph's posture and classifier, and the evidence
58
+ * posture. {@link ArmFacets} is deliberately that same vocabulary, so a run's
59
+ * own manifest — not the experimenter's bookkeeping — says which arm it belonged
60
+ * to, and an arm whose runs contradict its declaration gets no verdict at all.
61
+ *
62
+ * An arm may ALSO carry `ablations`: removals ride inside an arm through the
63
+ * unchanged removal machinery (`applyArm` → `applyAblations`). Composition, not
64
+ * union — each type still means exactly one thing.
65
+ */
66
+ import type { Embedder } from '../../influence-core/index.js';
67
+ import type { AblationRunStats, AblationSpec, AblationVerdict, OutcomeComparator, RunCost, SimilarityStats } from '../types.js';
68
+ /**
69
+ * One mounted memory as the run manifest describes it — structurally satisfied
70
+ * by `RunConfiguredMemoryPayload`.
71
+ */
72
+ export interface ManifestMemoryLike {
73
+ readonly id?: string;
74
+ readonly type?: string;
75
+ readonly strategy?: string;
76
+ readonly retrieval?: string;
77
+ readonly embedderId?: string;
78
+ readonly flavor?: string;
79
+ }
80
+ /**
81
+ * The run-configuration manifest, structurally — satisfied by
82
+ * `AgentRunConfiguredPayload` (the payload of
83
+ * `agentfootprint.agent.run_configured`, 9.41.0).
84
+ *
85
+ * Declared structurally, and every member optional, for the same reason
86
+ * `CapturedEventLike` and `QualityTriggerLookup` are: `context-bisect` is a
87
+ * LEAF. It must not import the event registry to read one payload, and a
88
+ * consumer replaying manifests out of a saved recording must be able to hand in
89
+ * any bag shaped like this.
90
+ */
91
+ export interface RunManifestLike {
92
+ readonly agentId?: string;
93
+ readonly llm?: {
94
+ readonly provider?: string;
95
+ readonly model?: string;
96
+ };
97
+ readonly reactMode?: string;
98
+ readonly memories?: readonly ManifestMemoryLike[];
99
+ readonly window?: string;
100
+ readonly skillGraph?: {
101
+ readonly routing?: string;
102
+ readonly continuity?: string;
103
+ readonly scorer?: string;
104
+ };
105
+ readonly evidenceGate?: string;
106
+ }
107
+ /** The memory facet of an arm — matched against the manifest's memory rows. */
108
+ export interface ArmMemoryFacet {
109
+ /** Narrow the match to ONE mounted memory by `defineMemory({ id })`. Without
110
+ * it, ANY mounted memory satisfying the other fields counts as a match. */
111
+ readonly id?: string;
112
+ readonly type?: string;
113
+ /** The compiled strategy KIND (`'window'`, `'topK'`, …). */
114
+ readonly strategy?: string;
115
+ /** `RetrievalStrategy.name` — the spelled-out retrieval rule. This is the
116
+ * field a "topK versus re-rank" study varies. */
117
+ readonly retrieval?: string;
118
+ readonly embedderId?: string;
119
+ readonly flavor?: string;
120
+ }
121
+ /**
122
+ * What ONE arm holds constant, in the vocabulary the run manifest speaks.
123
+ *
124
+ * Every field here has a counterpart in `AgentRunConfiguredPayload`, and that
125
+ * is the whole point: a facet a consumer declares is a facet the engine can
126
+ * CHECK against the run that actually happened. A configuration difference the
127
+ * manifest cannot name (a prompt tweak, a temperature) is not expressible here
128
+ * on purpose — declaring it would produce an arm label nothing can verify.
129
+ */
130
+ export interface ArmFacets {
131
+ /** `LLMProvider.name` of the effective provider. */
132
+ readonly provider?: string;
133
+ readonly model?: string;
134
+ readonly reactMode?: 'classic' | 'dynamic' | 'dynamic-grouped';
135
+ /** `WindowStrategy.name` — the "sliding-window versus token-budget" axis. */
136
+ readonly window?: string;
137
+ /** `IntentScorer.name` — the "scorer A versus scorer B" axis. */
138
+ readonly scorer?: string;
139
+ readonly routing?: 'assist' | 'guard' | 'rails';
140
+ readonly continuity?: 'turn' | 'conversation';
141
+ readonly evidenceGate?: 'assist' | 'guard' | 'rails';
142
+ readonly memory?: ArmMemoryFacet;
143
+ }
144
+ /**
145
+ * One configuration under test.
146
+ *
147
+ * `facets` is what the run manifest should say about this arm; `ablations` is
148
+ * anything this arm additionally REMOVES, applied by the unchanged removal
149
+ * machinery (`applyArm`). An arm needs at least one of the two — except the
150
+ * baseline arm, which may declare nothing at all and mean "the configuration as
151
+ * it stands".
152
+ */
153
+ export interface StrategyArm {
154
+ /** Stable label. Appears in every verdict sentence and keys the readout. */
155
+ readonly id: string;
156
+ readonly facets?: ArmFacets;
157
+ /** Removals this arm also applies — the four `AblationSpec` kinds, unchanged. */
158
+ readonly ablations?: readonly AblationSpec[];
159
+ }
160
+ /**
161
+ * What one seeded run of one arm reported back.
162
+ *
163
+ * `manifest` is the connection to 9.41.0: capture it with
164
+ * `agent.on('agentfootprint.agent.run_configured', e => …)` inside the runner
165
+ * (or hand the run's captured events to `manifestFromEvents`). Supplying it
166
+ * turns "the experimenter says this run was arm B" into a checked fact.
167
+ */
168
+ export interface ArmRunResult {
169
+ readonly output: string;
170
+ readonly cost?: RunCost;
171
+ readonly manifest?: RunManifestLike;
172
+ }
173
+ /**
174
+ * Consumer-supplied arm runner: BUILD the agent under `arm`'s configuration,
175
+ * run the same scenario, return the output.
176
+ *
177
+ * The engine takes a factory, not an instance — the same shape `AblationRunner`
178
+ * already has, and the reason a strategy comparison fits here at all. Contract,
179
+ * identical in spirit to `AblationRunner`:
180
+ * - `run.seed` varies 0..N-1 within ONE arm. Thread it into any stochastic
181
+ * knob so reruns are deterministic-but-distinct.
182
+ * - Build a FRESH agent/provider per call (scripted mock providers are
183
+ * stateful).
184
+ * - Apply `arm.ablations` with `applyArm` at construction.
185
+ * - Returning a bare string is fine; the object form additionally unlocks the
186
+ * cost readout and the manifest check.
187
+ */
188
+ export type ArmRunner = (arm: StrategyArm, run: {
189
+ readonly seed: number;
190
+ }) => Promise<string | ArmRunResult>;
191
+ /** One declared facet the run manifest contradicted. */
192
+ export interface ArmFacetMismatch {
193
+ /** Dotted facet path — `'model'`, `'memory.retrieval'`, `'skillGraph.scorer'`. */
194
+ readonly facet: string;
195
+ readonly declared: string;
196
+ /** What the manifest said. ABSENT means the manifest did not declare that
197
+ * field at all — which, per the manifest's own rule, means "not configured"
198
+ * and is therefore still a contradiction of a declared arm. */
199
+ readonly observed?: string;
200
+ }
201
+ /** Did the arm the consumer DECLARED match the runs that actually happened? */
202
+ export interface ArmApplication {
203
+ /** How many of this arm's seeded runs reported a manifest. */
204
+ readonly manifestsSeen: number;
205
+ /**
206
+ * The declared facets were really compared against a manifest. FALSE when the
207
+ * runner reported none, or when the arm declares only `ablations` (no
208
+ * manifest names a tool catalog). Read this BEFORE `applied`.
209
+ */
210
+ readonly checked: boolean;
211
+ /** Every seen manifest agreed with every declared facet. Meaningless when
212
+ * `checked` is false. */
213
+ readonly applied: boolean;
214
+ readonly mismatches: readonly ArmFacetMismatch[];
215
+ }
216
+ /**
217
+ * The inert-intervention control for an arm comparison.
218
+ *
219
+ * The cost tier's leave-one-out placebo does NOT transfer: it works by holding
220
+ * out one member of a POPULATION of peer suspects, and a comparison of two arms
221
+ * has no such population — leaving an arm out leaves an experiment, not a
222
+ * control. What does transfer is the placebo IDEA, in a stronger form: the
223
+ * inert intervention is RE-RUNNING THE SAME CONFIGURATION, and the engine
224
+ * already pays for it (the baseline arm's own seeded runs). Its similarity
225
+ * spread against the reference is the null distribution a challenger must fall
226
+ * outside of; `floor` is the strictest point of it.
227
+ *
228
+ * Two axes, two controls, and they are not interchangeable:
229
+ * - the COMPARATOR axis's control is the baseline arm's own flip count, which
230
+ * must be ZERO (the stability gate — same zero-tolerance rule `bisect.ts`
231
+ * and `localize.ts` use);
232
+ * - the SIMILARITY axis's control is this band.
233
+ * The band only participates in a verdict when the flip comparator IS the
234
+ * similarity comparator (`gates`). With a domain comparator the two axes are
235
+ * different instruments, and vetoing a genuine decision flip with an embedding
236
+ * statistic would suppress a true finding — so it is reported and not applied.
237
+ */
238
+ export interface NullBand {
239
+ readonly baselineArmId: string;
240
+ /** The baseline arm's own similarity to the reference across its seeds. */
241
+ readonly similarity: SimilarityStats;
242
+ /** The floor a challenger's mean similarity must fall BELOW to be
243
+ * distinguishable from seed-to-seed noise (`similarity.min`). */
244
+ readonly floor: number;
245
+ /** The baseline reproduced EXACTLY on every seed (zero spread). The band is
246
+ * then a hard floor that any change clears — honest for a deterministic
247
+ * scenario, and only as strong as that determinism (a mock provider is
248
+ * reproducible in a way a real one is not). */
249
+ readonly degenerate: boolean;
250
+ /** The band participated in the verdicts (default comparator only). */
251
+ readonly gates: boolean;
252
+ /** Plain-language recap. PRESENTATION ONLY — read the fields as data. */
253
+ readonly note: string;
254
+ }
255
+ /** One arm's evidence. */
256
+ export interface ArmOutcome {
257
+ readonly armId: string;
258
+ readonly isBaseline: boolean;
259
+ /** The same per-probe statistics the ablation tier reports (samples, flips,
260
+ * similarity mean/min/max/stdev, and `cost` when the runner reported one). */
261
+ readonly runs: AblationRunStats;
262
+ /** Every seeded answer, in seed order. */
263
+ readonly answers: readonly string[];
264
+ /** Mean similarity to the reference fell below the null band's floor. Always
265
+ * false for the baseline arm — an arm cannot be outside its own band. */
266
+ readonly outsideNullBand: boolean;
267
+ readonly application: ArmApplication;
268
+ /**
269
+ * The CAUSAL-tier claim for this arm versus the baseline arm. Absent on the
270
+ * baseline arm itself (it is the reference, not a challenger).
271
+ */
272
+ readonly verdict?: AblationVerdict;
273
+ }
274
+ /** The finished comparison. */
275
+ export interface StrategyComparison {
276
+ /**
277
+ * The answer every arm's similarity and flip count was measured against.
278
+ * `'prior-run'` — the caller's `originalAnswer`, i.e. the run that actually
279
+ * happened. `'baseline-arm'` — no prior answer was supplied, so the baseline
280
+ * arm's seed-0 answer became the reference; that seed then contributes a
281
+ * trivially identical comparison and stability rests on the remaining N−1.
282
+ */
283
+ readonly reference: {
284
+ readonly from: 'prior-run' | 'baseline-arm';
285
+ readonly text: string;
286
+ };
287
+ readonly baselineArmId: string;
288
+ /** The baseline arm reproduced the reference on EVERY seed. False ⇒ every
289
+ * verdict is `'inconclusive'`; nothing is trustworthy on an unstable
290
+ * scenario. */
291
+ readonly baselineStable: boolean;
292
+ readonly nullBand: NullBand;
293
+ /** One row per arm, declaration order, baseline included. */
294
+ readonly arms: readonly ArmOutcome[];
295
+ /** Consumer-runner invocations spent (`samples × arms`). */
296
+ readonly runsUsed: number;
297
+ /** Plain-language recap. PRESENTATION ONLY — read the fields as data. */
298
+ readonly summary: string;
299
+ }
300
+ export interface CompareStrategyArmsOptions {
301
+ /** At least two, distinct, each non-baseline arm declaring something. */
302
+ readonly arms: readonly StrategyArm[];
303
+ readonly runner: ArmRunner;
304
+ /** Embedder for the similarity readout, the null band and the default
305
+ * comparator. `mockEmbedder()` is fine offline. */
306
+ readonly embedder: Embedder;
307
+ /** Which arm is the incumbent. Default: the first arm. */
308
+ readonly baselineArmId?: string;
309
+ /** The answer the run that actually happened produced. Omit for a fresh A/B
310
+ * — the baseline arm's seed-0 answer becomes the reference. */
311
+ readonly originalAnswer?: string;
312
+ /** Seeded runs PER ARM. Default 3; clamped to ≥ 2 (never single-run claims). */
313
+ readonly samples?: number;
314
+ /** Did the answer CHANGE? Default: embedding similarity < `flipThreshold`.
315
+ * Passing one turns the null band OFF as a gate (see {@link NullBand}). */
316
+ readonly answerChanged?: OutcomeComparator;
317
+ /** Similarity floor for the DEFAULT comparator. Default 0.8. */
318
+ readonly flipThreshold?: number;
319
+ }
320
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/context-bisect/arms/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,OAAO,EACP,eAAe,EAChB,MAAM,aAAa,CAAC;AAIrB;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ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6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B;wDACoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;oEACgE;IAChE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;gFAC4E;IAC5E,QAAQ,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAC3C,gEAAgE;IAChE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Arm validation — the teaching refusals.
3
+ *
4
+ * Every refusal here fires BEFORE a single model call. That is the whole design
5
+ * rule: an incoherent comparison must cost nothing. The engine's other refusals
6
+ * (an unstable baseline, an arm that did not take effect) can only be known
7
+ * after the runs, and those refuse a VERDICT rather than throw — refusing after
8
+ * spending N model calls would be hostile. These six can be known from the
9
+ * declaration alone, so they throw.
10
+ */
11
+ import type { ArmFacets, StrategyArm } from './types.js';
12
+ /**
13
+ * A canonical key for one arm's CONFIGURATION (facets + removals), used only to
14
+ * detect two arms that are secretly the same arm. Hand-rolled rather than
15
+ * `JSON.stringify` because key order in an object literal is authoring
16
+ * accident, and two arms written `{model, scorer}` and `{scorer, model}` are
17
+ * the same arm.
18
+ */
19
+ export declare function armConfigKey(arm: StrategyArm): string;
20
+ /** How many facet leaves an arm declares — 0 means it names no configuration. */
21
+ export declare function declaredFacetCount(facets: ArmFacets | undefined): number;
22
+ /**
23
+ * Refuse every comparison that cannot mean anything, and resolve which arm is
24
+ * the incumbent. Returns the resolved baseline arm id.
25
+ */
26
+ export declare function validateStrategyArms(arms: readonly StrategyArm[], baselineArmId: string | undefined): string;
27
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../../src/lib/context-bisect/arms/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKzD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAIrD;AAkBD,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAcxE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,WAAW,EAAE,EAC5B,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,CA2ER"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The arm verdict — the same three tiers, phrased for a substitution.
3
+ *
4
+ * ## Why not widen `verdictFor`
5
+ *
6
+ * `verdictFor` already carries an `action` word (`'ablating'` | `'restoring'`)
7
+ * and a third would have been one line. It ends its NOT-CONFIRMED sentence with
8
+ * "its ranking remains a correlational proxy only" — true of a suspect, which
9
+ * was RANKED before it was probed, and meaningless for an arm, which was never
10
+ * ranked at all. Widening the union would have forced that sentence onto the
11
+ * new tier or edited a string three existing tests pin byte-for-byte. So the
12
+ * tier LOGIC is shared (`probeFlipped`, the majority rule, the zero-tolerance
13
+ * baseline gate) and only the prose is new.
14
+ *
15
+ * ## The tiers, in refusal order
16
+ *
17
+ * 1. **Unstable baseline** → inconclusive. The incumbent could not reproduce
18
+ * the reference answer across its own seeds, so a difference measured
19
+ * against it is measuring the scenario, not the arm. Zero tolerance, exactly
20
+ * as `bisect.ts` and `localize.ts` apply it: ONE un-intervened flip is
21
+ * enough, because the majority rule would let a 1-in-3 flaky scenario reach
22
+ * a causal verdict.
23
+ * 2. **Arm did not take effect** → inconclusive. The run manifest contradicted
24
+ * what the arm declared. Any difference here is evidence about a
25
+ * configuration nobody meant to test.
26
+ * 3. **Inside the null band** → inconclusive. A majority flip whose mean
27
+ * similarity still sits within the baseline arm's own seed-to-seed spread is
28
+ * not separable from noise. Only applied when the flip comparator and the
29
+ * band are the same instrument (see `NullBand.gates`).
30
+ * 4. **Majority flip, outside the band, stable baseline** → confirmed. This is
31
+ * a causal claim of the same tier an ablation verdict makes: a
32
+ * counterfactual intervention, seeded reruns, variance reported, and a
33
+ * baseline that held.
34
+ * 5. **Minority flips** → inconclusive. 6. **No flips** → not-confirmed.
35
+ *
36
+ * Every claim is bounded by the scenario and the comparator, and says so — an
37
+ * arm confirmed on one question has been confirmed on one question.
38
+ */
39
+ import type { AblationRunStats, AblationVerdict } from '../types.js';
40
+ import type { ArmApplication, NullBand } from './types.js';
41
+ /** Everything the verdict needs beyond the arm's own numbers. */
42
+ export interface ArmVerdictContext {
43
+ readonly baselineArmId: string;
44
+ /** The baseline arm reproduced the reference on EVERY seed. */
45
+ readonly baselineStable: boolean;
46
+ readonly baselineStats: AblationRunStats;
47
+ readonly band: NullBand;
48
+ /** Mean similarity fell below the band's floor. */
49
+ readonly outsideNullBand: boolean;
50
+ readonly application: ArmApplication;
51
+ }
52
+ /** Translate one arm's probe evidence into its verdict. See module docs. */
53
+ export declare function verdictForArm(armId: string, stats: AblationRunStats, context: ArmVerdictContext): AblationVerdict;
54
+ //# sourceMappingURL=verdict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../../../../src/lib/context-bisect/arms/verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3D,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;CACtC;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,iBAAiB,GACzB,eAAe,CAgFjB"}
@@ -26,6 +26,7 @@ export { sliceToBacktrackTrace, type SliceToBacktrackTraceOptions, } from './sli
26
26
  export { ablationForSuspect, applyAblations, costStatsFrom, defaultOutcomeComparator, median, probeFlipped, runAblationProbe, verdictFor, type AblationTargets, type ProbeConfig, } from './ablation.js';
27
27
  export { assignCostVerdicts, classifySuspect, MIN_LOOPS_SAVED } from './cost.js';
28
28
  export { removableSources, rerunWithoutSources, type IgnoredSource, type RemovableSource, type RerunWithoutSourcesOptions, type RerunWithoutSourcesResult, type WhatChanged, } from './rerun.js';
29
+ export { applyArm, armConfigKey, armFacetsFromManifest, armLabel, checkArmApplication, checkArmApplied, collectArmRuns, compareStrategyArms, declaredFacetCount, manifestFromEvents, matchArm, nullBandFrom, RUN_CONFIGURED_EVENT, scoreArmRuns, validateStrategyArms, verdictForArm, type ArmApplication, type ArmFacetMismatch, type ArmFacets, type ArmMemoryFacet, type ArmOutcome, type ArmRunResult, type ArmRunner, type ArmRuns, type ArmVerdictContext, type CompareStrategyArmsOptions, type ManifestMemoryLike, type NullBand, type RunManifestLike, type StrategyArm, type StrategyComparison, } from './arms/index.js';
29
30
  export { shortlistEarlyCulprits, DEFAULT_RECENCY_DECAY, type LoopCandidate, type LoopRecallShortlist, type ShortlistEarlyCulpritsOptions, } from './loop-recall.js';
30
31
  export { walkToRoot, walkTrajectory, buildWriterFrameIndex, type HopNarrowedBy, type RootCauseHop, type RootCauseNote, type RootCausePath, type WalkToRootOptions, } from './walk-to-root.js';
31
32
  export { joinVariableSlice, traceVariable, type AgentKeyMoment, type AgentVariableSlice, type DataflowCoverage, type JoinVariableSliceOptions, type TraceVariableOptions, type VariableAblationHook, } from './variable-recall.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK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B,EAC1B,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/context-bisect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,KAAK,eAAe,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K,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
@@ -19,7 +19,7 @@ export { pointerOf, SKIP_STEP_TOOL_NAME, skipStepDescriptor, type OnSkipPolicy,
19
19
  export { defineStepsHint, STEPS_HINT_METADATA_KEY, type StepsHintOptions, } from './factories/defineStepsHint.js';
20
20
  export { checkArtifactVocabularies, vocabularyOf, type ArtifactVocabulary, } from './skillVocabulary.js';
21
21
  export { SkillRegistry, type SkillRegistryOptions } from './SkillRegistry.js';
22
- export { skillsFromDir, type SkillsFromDirOptions } from './skillsFromDir.js';
22
+ export { skillsFromDir, runbookFromDir, type SkillsFromDirOptions, type DirRunbook, } from './skillsFromDir.js';
23
23
  export { buildListSkillsTool, buildReadSkillTool, buildSkipStepTool, type ReadSkillOffer, type SkillToolPair, } from './skillTools.js';
24
24
  export { listSkillsDescriptor, readSkillDescriptor } from './skillToolDescriptors.js';
25
25
  export type { SkillCachePolicy, SkillCachePolicyContext, SkillGraphHost, SkillGraphIterationContext, SkillTool, SkillToolDescriptor, SkillToolSchema, } from './hostContract.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/injection-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,kBAAkB,CAAC;AAG1B,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAKpD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,2BAA2B,EAC3B,KAAK,qBAAqB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ACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,SAAS,EACT,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/injection-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,kBAAkB,CAAC;AAG1B,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAKpD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,2BAA2B,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACpG,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,KAAK,oBAAoB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,cAAc,EACd,sB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0B,EAC/B,KAAK,YAAY,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,SAAS,EACT,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC"}
@@ -93,12 +93,21 @@
93
93
  * visible wherever the graph reports its problems — because a reader who meets
94
94
  * it only in prose docs will meet a clean report first.
95
95
  *
96
+ * ## The opposite assertion lives next door
97
+ *
98
+ * Everything here is POSITIVE: this rule claims this phrase. The negative form
99
+ * — a phrase that must claim NO skill, which is the assertion that catches
100
+ * over-triggering — is `skillNeverRoutes.ts`, declared on the GRAPH rather than
101
+ * on a rule (a phrase that must route nowhere belongs to no skill). Both ask
102
+ * `startRuleClaim.ts` the same question and differ only in which answer is a
103
+ * defect; a phrase declared BOTH ways is reported there as the contradiction it
104
+ * is.
105
+ *
96
106
  * Composed into `graph.checkup()` by `skillGraph.ts`, exactly like
97
107
  * `skillContract`/`skillIntent`/`skillVocabulary`: this module owns the rule
98
108
  * AND its boundaries, and reports in the shared `GraphProblem` voice.
99
109
  */
100
- import type { InjectionContext } from './types.js';
101
- import { type SkillMatchData } from './skillMatch.js';
110
+ import { type StartRuleDecl } from './startRuleClaim.js';
102
111
  import type { GraphProblem } from './skillGraphCheckup.js';
103
112
  /**
104
113
  * The statement the check-up makes about its own reach, carried on
@@ -111,18 +120,12 @@ export declare const EXAMPLES_BOUNDARY: string;
111
120
  * only the order-independent check (self-match) could run. */
112
121
  export declare const EXAMPLES_ORDER_NOT_CHECKED: string;
113
122
  /**
114
- * The slice of an entry declaration this module reads — structural, so
115
- * `skillGraph.ts`'s module-private `EntryDecl` satisfies it unchanged (the
116
- * same trick `skillIntent.ts` uses).
123
+ * The slice of an entry declaration this module reads — the shared claim shape
124
+ * ({@link StartRuleDecl}, which owns "who claims a phrase") plus the one field
125
+ * only this check reads. Structural, so `skillGraph.ts`'s module-private
126
+ * `EntryDecl` satisfies it unchanged (the same trick `skillIntent.ts` uses).
117
127
  */
118
- export interface ExampleRuleDecl {
119
- readonly id: string;
120
- /** The compiled condition (from `match:`) or the author's `when`. Absent on
121
- * an unconditional entry and on an intent rule (no sync predicate). */
122
- readonly when?: (ctx: InjectionContext) => boolean;
123
- /** The serializable matcher behind `when`, when declared as data — quoted
124
- * back in the messages, and the one way to spot the intent arm. */
125
- readonly match?: SkillMatchData;
128
+ export interface ExampleRuleDecl extends StartRuleDecl {
126
129
  /** The phrasings this rule claims (build-time TEST material). */
127
130
  readonly examples?: readonly string[];
128
131
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skillExamples.d.ts","sourceRoot":"","sources":["../../../../src/lib/injection-engine/skillExamples.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,QAEsC,CAAC;AAErE;+DAC+D;AAC/D,eAAO,MAAM,0BAA0B,QAG4B,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;4EACwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CA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A0B,QAG4B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;gEACgE;AAChE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAOD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE;IAAE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GACnE,SAAS,MAAM,EAAE,GAAG,SAAS,CAgD/B;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC,GAAG,eAAe,CAyLlB"}
@@ -208,6 +208,16 @@ export interface SkillGraphFlatConfig {
208
208
  * See {@link BuildOptions.scopeTools}.
209
209
  */
210
210
  readonly scopeTools?: boolean;
211
+ /**
212
+ * Phrasings this graph must claim NOWHERE — the negative routing rows. Same
213
+ * machine as `.neverRoutes([...])`; see that method for what the check
214
+ * proves and what it deliberately does not. A row a declared start rule
215
+ * claims is an ERROR (`never-routes-claimed`), naming the rule.
216
+ *
217
+ * @example
218
+ * skillGraph({ skills, start: { rules }, neverRoutes: ['what is the weather'] });
219
+ */
220
+ readonly neverRoutes?: readonly string[];
211
221
  readonly check?: GraphCheckMode;
212
222
  /** Baseline agent tool names — see {@link BuildOptions.knownTools}. */
213
223
  readonly knownTools?: readonly string[];
@@ -232,6 +242,10 @@ export interface SkillGraphTreeConfig {
232
242
  readonly scopeTools?: boolean;
233
243
  readonly start?: never;
234
244
  readonly steps?: never;
245
+ /** A tree has no start RULES for a negative row to be judged against, so the
246
+ * type refuses it here and `build()` refuses it at runtime (see
247
+ * {@link SkillGraphBuilder.neverRoutes}). */
248
+ readonly neverRoutes?: never;
235
249
  readonly check?: GraphCheckMode;
236
250
  /** Baseline agent tool names — see {@link BuildOptions.knownTools}. */
237
251
  readonly knownTools?: readonly string[];
@@ -815,6 +829,42 @@ export interface SkillGraphBuilder {
815
829
  * router per graph. Flat graphs only.
816
830
  */
817
831
  classify(scorer: IntentScorer, policy?: Partial<RoutingPolicy>): SkillGraphBuilder;
832
+ /**
833
+ * Declare phrasings this graph must claim **NOWHERE** — the negative form of
834
+ * a rule's `examples`, and the one that catches the expensive failure.
835
+ *
836
+ * An under-triggering skill costs a turn (the model tier picks instead). An
837
+ * OVER-triggering skill costs the answer: the wrong body enters the system
838
+ * prompt and the wrong tools enter the tools slot, and everything said after
839
+ * that is shaped by a skill with no business in the turn.
840
+ *
841
+ * It is declared on the GRAPH, not on a skill, because a phrase that must
842
+ * route nowhere belongs to no skill: the assertion is satisfied only when
843
+ * EVERY rule declines, and a row hung on one skill would vanish the day that
844
+ * skill was deleted — exactly when a graph is re-partitioned, which is
845
+ * exactly when over-triggering appears.
846
+ *
847
+ * `graph.checkup()` runs every declared start condition over the phrase on a
848
+ * cold-start context and reports the rule that claims it, BY NAME, as an
849
+ * ERROR (`never-routes-claimed`) — so a default `.build()` refuses.
850
+ *
851
+ * **What it proves, exactly:** no declared start RULE claims the phrase. Not
852
+ * "no routing at all": an intent rule is judged by a classifier at run time, a
853
+ * scorer / `.entryByRead()` menu ranks descriptions, and `read_skill` can
854
+ * always open an open skill by name. That statement rides the report itself
855
+ * (`checkup().notes`).
856
+ *
857
+ * Accepts one phrase or a list; call it as often as you like (rows
858
+ * accumulate). A duplicate row is refused — one row already asserts it
859
+ * against every rule.
860
+ *
861
+ * @example
862
+ * skillGraph()
863
+ * .entry(billing, { match: { keywords: ['refund', 'charge'] } })
864
+ * .neverRoutes(["what's the weather in Berlin"])
865
+ * .build();
866
+ */
867
+ neverRoutes(phrases: string | readonly string[]): SkillGraphBuilder;
818
868
  build(opts?: BuildOptions): SkillGraph;
819
869
  }
820
870
  export declare function skillGraph(): SkillGraphBuilder;