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,142 @@
1
+ /**
2
+ * coverage/types — the shared vocabulary of the two coverage primitives.
3
+ *
4
+ * Pattern: one value type, two consumers — `absent()` says "I looked HERE and
5
+ * found nothing", `coverage()` says "my answer covers THIS and not
6
+ * THAT". Both are statements about the same thing: the ground a
7
+ * result stands on. Spelling them with one vocabulary is what lets
8
+ * the answer-level block merge an absence's boundary with a
9
+ * verdict's without translating between two grammars.
10
+ * Role: core/ layer, pure data. No imports, no behavior.
11
+ * Emits: N/A.
12
+ */
13
+ /**
14
+ * One piece of ground, and (optionally) why it is where it is.
15
+ *
16
+ * `what` is prose the TOOL AUTHOR wrote — a source, a window, a filter, a
17
+ * fleet ("the fcns database on shq-fab-a", "the last 24h", "all four
18
+ * arrays"). It is never composed from the model's arguments by this library,
19
+ * because the library does not know which of them are real.
20
+ */
21
+ export interface CoverageItem {
22
+ /** The source, window, filter or population. Non-empty. */
23
+ readonly what: string;
24
+ /**
25
+ * Why it sits where it does. REQUIRED on `cannotCover` (a permanent blind
26
+ * spot is a claim about capability, and a claim with no reason cannot be
27
+ * acted on or disproved); optional on `checked` and `notChecked`, where
28
+ * "we did" and "we did not need to" are often the whole story.
29
+ */
30
+ readonly why?: string;
31
+ }
32
+ /** What an author may write in a coverage list: bare prose, or prose + why. */
33
+ export type CoverageInput = string | CoverageItem;
34
+ /**
35
+ * The three lists, normalized. This is the shape everything downstream reads —
36
+ * the renderer, the event payload, the answer-level block.
37
+ *
38
+ * The three are NOT interchangeable, and the difference is the whole point:
39
+ *
40
+ * • `checked` — ground this result actually stands on. A clean verdict here
41
+ * means VERIFIED.
42
+ * • `notChecked` — ground this run could have covered and did not (budget,
43
+ * a timeout, a scope the caller chose). A clean verdict says nothing
44
+ * about it. Re-asking with a wider scope can move it to `checked`.
45
+ * • `cannotCover` — ground no call to this tool will ever reach (no
46
+ * collector, no permission, no such telemetry). A clean verdict says
47
+ * nothing about it, and no retry ever will. This is the list that turns
48
+ * "everything looks fine" into "everything I can see looks fine".
49
+ */
50
+ export interface Coverage {
51
+ readonly checked: readonly CoverageItem[];
52
+ readonly notChecked: readonly CoverageItem[];
53
+ readonly cannotCover: readonly CoverageItem[];
54
+ }
55
+ /** What a tool author passes to {@link import('./ledger.js').coverage}. */
56
+ export interface CoverageDeclaration {
57
+ readonly checked?: readonly CoverageInput[];
58
+ readonly notChecked?: readonly CoverageInput[];
59
+ readonly cannotCover?: readonly CoverageInput[];
60
+ }
61
+ /** What a tool author passes to {@link import('./absent.js').absent}. */
62
+ export interface AbsenceDeclaration {
63
+ /**
64
+ * What was looked for, in the author's own words ("FLOGI entries on
65
+ * fc1/3"). Required: an absence that cannot say what it did not find is
66
+ * indistinguishable from a tool that returned nothing by accident.
67
+ */
68
+ readonly what: string;
69
+ /**
70
+ * The coverage of the search — REQUIRED and non-empty. An absence that
71
+ * names no coverage is a `null` with extra steps: the reader still cannot
72
+ * tell "I looked and there is nothing" from "I could not look", which is
73
+ * the entire failure this primitive exists to prevent.
74
+ */
75
+ readonly checked: readonly CoverageInput[];
76
+ /** Ground the search did not reach this time — an absence here proves
77
+ * nothing about it. */
78
+ readonly notChecked?: readonly CoverageInput[];
79
+ /** Ground no search by this tool can reach. Each needs a `why`. */
80
+ readonly cannotCover?: readonly CoverageInput[];
81
+ /**
82
+ * Where to go INSTEAD, in one sentence ("widen the window with
83
+ * `window: '7d'`, or ask for a different interface"). Optional, and the
84
+ * highest-value optional field in the shape: the loop this primitive stops
85
+ * is a model with nowhere else to go.
86
+ */
87
+ readonly tryInstead?: string;
88
+ }
89
+ /**
90
+ * The rendered absence — the exact object a tool hands back and the model
91
+ * reads. Field names are snake_case and English on purpose: this value is
92
+ * read by a language model far more often than by code, and `af_absent` is
93
+ * the only field here that exists for the machine.
94
+ *
95
+ * The `af_absent` key is RESERVED vocabulary on the tool-result wire (the
96
+ * `propose-transition` / `require-instruction` precedent): a plain object
97
+ * carrying it is an absence, and nothing else in this library will treat any
98
+ * other shape as one.
99
+ */
100
+ export interface ToolAbsence {
101
+ readonly af_absent: true;
102
+ /** The plain-English handle. Present so a model that skims one key still
103
+ * reads the outcome rather than inferring it from a missing field. */
104
+ readonly outcome: 'nothing_found';
105
+ readonly looked_for: string;
106
+ readonly checked: readonly CoverageItem[];
107
+ readonly not_checked?: readonly CoverageItem[];
108
+ readonly cannot_cover?: readonly CoverageItem[];
109
+ /** Stated as data as well as prose — the note can be skimmed past, a
110
+ * `true` in a field named for the question cannot. */
111
+ readonly retry_returns_the_same: true;
112
+ readonly try_instead?: string;
113
+ /** The static sentence. Never interpolated — see `absent.ts`. */
114
+ readonly note: string;
115
+ }
116
+ /** The rendered coverage ledger, wrapped around the result it bounds. */
117
+ export interface CoveredResult<T = unknown> {
118
+ readonly af_coverage: {
119
+ readonly checked?: readonly CoverageItem[];
120
+ readonly not_checked?: readonly CoverageItem[];
121
+ readonly cannot_cover?: readonly CoverageItem[];
122
+ readonly note: string;
123
+ };
124
+ /** The tool's own answer, untouched. */
125
+ readonly result: T;
126
+ }
127
+ /**
128
+ * One coverage statement as the RUN recorded it — what the event carries and
129
+ * what accumulates in `AgentState.coverageDeclared`.
130
+ *
131
+ * `kind` is kept because the two read differently at the answer boundary: a
132
+ * `'ledger'` bounds a verdict the answer is probably built on, an
133
+ * `'absence'` bounds a search that found nothing.
134
+ */
135
+ export interface DeclaredCoverage extends Coverage {
136
+ readonly kind: 'absence' | 'ledger';
137
+ readonly toolName: string;
138
+ readonly toolCallId?: string;
139
+ readonly iteration: number;
140
+ /** Present for `'absence'` only — what the search was for. */
141
+ readonly lookedFor?: string;
142
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * coverage/types — the shared vocabulary of the two coverage primitives.
3
+ *
4
+ * Pattern: one value type, two consumers — `absent()` says "I looked HERE and
5
+ * found nothing", `coverage()` says "my answer covers THIS and not
6
+ * THAT". Both are statements about the same thing: the ground a
7
+ * result stands on. Spelling them with one vocabulary is what lets
8
+ * the answer-level block merge an absence's boundary with a
9
+ * verdict's without translating between two grammars.
10
+ * Role: core/ layer, pure data. No imports, no behavior.
11
+ * Emits: N/A.
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/core/agent/coverage/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -26,6 +26,13 @@
26
26
  * value because the model passed it to a tool would let any invention
27
27
  * launder itself through one failed lookup.
28
28
  * • **The model's own earlier answers do not count**, for the same reason.
29
+ * • **An `absent(…)` result grounds its COVERAGE only.** An absence names
30
+ * what was looked FOR, which in practice quotes the arguments the model
31
+ * passed — so indexing the whole frame would ground an invented
32
+ * identifier through the one operation that proves nothing about it: a
33
+ * lookup that found nothing. `checked` / `not_checked` / `cannot_cover`
34
+ * are the tool's own words about the world and do count. See
35
+ * `../coverage/evidence.ts`.
29
36
  *
30
37
  * The EXEMPT index is built from a different corpus with the same machinery:
31
38
  * the user's own message, the conversation's user/system turns, and the
@@ -26,6 +26,13 @@
26
26
  * value because the model passed it to a tool would let any invention
27
27
  * launder itself through one failed lookup.
28
28
  * • **The model's own earlier answers do not count**, for the same reason.
29
+ * • **An `absent(…)` result grounds its COVERAGE only.** An absence names
30
+ * what was looked FOR, which in practice quotes the arguments the model
31
+ * passed — so indexing the whole frame would ground an invented
32
+ * identifier through the one operation that proves nothing about it: a
33
+ * lookup that found nothing. `checked` / `not_checked` / `cannot_cover`
34
+ * are the tool's own words about the world and do count. See
35
+ * `../coverage/evidence.ts`.
29
36
  *
30
37
  * The EXEMPT index is built from a different corpus with the same machinery:
31
38
  * the user's own message, the conversation's user/system turns, and the
@@ -33,6 +40,7 @@
33
40
  * not a fabrication — the user gave it — and neither is one the app's own
34
41
  * prompt or skill body put in front of the model.
35
42
  */
43
+ import { absenceEvidenceProjection } from '../coverage/index.js';
36
44
  import { isLibraryAuthoredTurn } from './frames.js';
37
45
  import { lookupForms, normalizeToken, tokenize } from './normalize.js';
38
46
  /**
@@ -93,7 +101,16 @@ function indexResult(content, sink) {
93
101
  const trimmed = content.trim();
94
102
  if (trimmed.startsWith('{') || trimmed.startsWith('[')) {
95
103
  try {
96
- walk(JSON.parse(trimmed), sink);
104
+ const parsed = JSON.parse(trimmed);
105
+ // An `absent(…)` frame grounds its COVERAGE and nothing else: the rest
106
+ // of it is prose about the REQUEST, which usually quotes the model's own
107
+ // arguments, and indexing that would ground every identifier a model
108
+ // invented as long as it handed the invention to one tool that found
109
+ // nothing. See `../coverage/evidence.ts` — it is the frames.ts argument
110
+ // on the tool side of the conversation. `undefined` (every other result
111
+ // ever returned) keeps the walk it always had.
112
+ const projection = absenceEvidenceProjection(parsed);
113
+ walk(projection ?? parsed, sink);
97
114
  return;
98
115
  }
99
116
  catch {
@@ -1 +1 @@
1
- {"version":3,"file":"evidenceIndex.js","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/evidenceIndex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAoBjC,SAAS,GAAG,CAAC,IAAU,EAAE,GAAW;IAClC,M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AAG,IAAI,IAAI,CAAC,sBAAsB,IAAI,EAAE,EAAE,CAAC;QACpD,IAAI,GAAG,CAAC,UAAU;YAAE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QAClD,wEAAwE;QACxE,wEAAwE;QACxE,iCAAiC;aAC5B,IAAI,GAAG,CAAC,cAAc;YAAE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC"}
@@ -27,3 +27,21 @@
27
27
  import type { TypedScope } from 'footprintjs';
28
28
  import type { AgentState } from '../types.js';
29
29
  export declare const prepareFinalStage: (scope: TypedScope<AgentState>) => void;
30
+ /**
31
+ * `.limitsTravelWithTheAnswer()`'s half of prepare-final — the SAME stage,
32
+ * with the run's declared coverage folded into the answer first.
33
+ *
34
+ * Mounted in place of `prepareFinalStage` by both chart builders when the
35
+ * option is configured, and nowhere else: an agent that did not ask for it
36
+ * runs the function above, byte for byte. Written as one stage rather than a
37
+ * second one because everything the capture files must agree about what the
38
+ * answer WAS — a second stage afterwards would leave `turn_end` reporting an
39
+ * answer the caller never saw.
40
+ *
41
+ * It runs AFTER the evidence gate has judged (the gate is in the Route
42
+ * decider, one stage earlier). That ordering is deliberate: the block is
43
+ * composed by the framework out of what the TOOLS declared, so subjecting it
44
+ * to a check for values the MODEL could not support would be asking whether
45
+ * the library grounded itself.
46
+ */
47
+ export declare const prepareFinalWithLimitsStage: (scope: TypedScope<AgentState>) => void;
@@ -25,9 +25,22 @@
25
25
  * `stages/route.ts`.
26
26
  */
27
27
  import { typedEmit } from '../../../recorders/core/typedEmit.js';
28
- export const prepareFinalStage = (scope) => {
28
+ import { composeAnswerWithCoverage } from '../coverage/index.js';
29
+ /**
30
+ * The stage body, with the answer passed IN.
31
+ *
32
+ * One body, two entry points. The answer is a parameter rather than a read of
33
+ * `scope.llmLatestContent` because `.limitsTravelWithTheAnswer()` composes a
34
+ * different one — and everything filed here (`finalContent`, `newMessages`,
35
+ * which memory persists, and `turn_end.finalContent`) must agree about what
36
+ * the answer WAS. Note that `llmLatestContent` itself is a READ-ONLY input to
37
+ * this branch subflow, so there is no version of this where the composed
38
+ * answer is written back over it: the capture is the only place all four
39
+ * readers meet.
40
+ */
41
+ const captureTurnPayload = (scope, answer) => {
29
42
  const iteration = scope.iteration;
30
- scope.finalContent = scope.llmLatestContent;
43
+ scope.finalContent = answer;
31
44
  // v2.14 — attach thinking blocks to the assistant final message
32
45
  // (if any). For non-Anthropic providers this is informational; for
33
46
  // Anthropic + extended-thinking-with-tool-use, signature round-trip
@@ -59,4 +72,31 @@ export const prepareFinalStage = (scope) => {
59
72
  durationMs: Date.now() - scope.turnStartMs,
60
73
  });
61
74
  };
75
+ export const prepareFinalStage = (scope) => {
76
+ captureTurnPayload(scope, scope.llmLatestContent);
77
+ };
78
+ /**
79
+ * `.limitsTravelWithTheAnswer()`'s half of prepare-final — the SAME stage,
80
+ * with the run's declared coverage folded into the answer first.
81
+ *
82
+ * Mounted in place of `prepareFinalStage` by both chart builders when the
83
+ * option is configured, and nowhere else: an agent that did not ask for it
84
+ * runs the function above, byte for byte. Written as one stage rather than a
85
+ * second one because everything the capture files must agree about what the
86
+ * answer WAS — a second stage afterwards would leave `turn_end` reporting an
87
+ * answer the caller never saw.
88
+ *
89
+ * It runs AFTER the evidence gate has judged (the gate is in the Route
90
+ * decider, one stage earlier). That ordering is deliberate: the block is
91
+ * composed by the framework out of what the TOOLS declared, so subjecting it
92
+ * to a check for values the MODEL could not support would be asking whether
93
+ * the library grounded itself.
94
+ */
95
+ export const prepareFinalWithLimitsStage = (scope) => {
96
+ const declared = scope.coverageDeclared;
97
+ const answer = declared !== undefined && declared.length > 0
98
+ ? composeAnswerWithCoverage(scope.llmLatestContent, declared)
99
+ : scope.llmLatestContent;
100
+ captureTurnPayload(scope, answer);
101
+ };
62
102
  //# sourceMappingURL=prepareFinal.js.map
@@ -1 +1 @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AiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,cAAc,EAAE,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,WAAW;KAC3C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAQ,EAAE;IACvE,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAA6B,EAAQ,EAAE;IACjF,MAAM,QAAQ,GAAG,KAAK,CAAC,gBAAgB,CAAC;IACxC,MAAM,MAAM,GACV,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAC3C,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC;QAC7D,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC7B,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC"}
@@ -65,6 +65,7 @@ import { safeStringify } from '../validators.js';
65
65
  import { capToolResult } from '../toolResultCap.js';
66
66
  import { applyResultCeiling } from '../resultCeiling.js';
67
67
  import { currentStepOf, pointerOf, readSkillStepIntro, skipAdvanceSentence, skipHoldSentence, skipNeedsReasonSentence, skipNothingActiveSentence, stepAdvanceSuffix, stepInProgress, SKIP_STEP_TOOL_NAME, } from '../../../lib/injection-engine/skillSteps.js';
68
+ import { readCoverageResult, } from '../coverage/index.js';
68
69
  import { explainStatusOnlyNearMiss, pruneLeases, readToolResultEnvelope, tenantOf, } from '../toolEffects.js';
69
70
  /** Declaration order preserved, ids de-duplicated — the shape the gate's re-prompt
70
71
  * and the `skill.rejected` payload both report as "what this gate accepts". */
@@ -306,6 +307,76 @@ export function buildToolCallsHandler(deps) {
306
307
  });
307
308
  return verdict.refusal;
308
309
  };
310
+ /**
311
+ * Coverage declarations — `absent(…)` and `coverage(…)`, recognized at the
312
+ * SAME execute boundaries the ceiling is measured at (one implementation,
313
+ * every door: a resumed call declares its coverage exactly as an inline
314
+ * one).
315
+ *
316
+ * Returns the DELIVERED status: `'absent'` when an absence is in play,
317
+ * `undefined` otherwise. That single line is the whole downstream
318
+ * behavioural change, and it is deliberately narrow — an absence is not an
319
+ * error, so nothing here sets `error: true`, nothing refuses, nothing
320
+ * retries, and the value the model reads is the value the tool minted. The
321
+ * direction-of-error argument (see `../coverage/absent.ts`) is that a
322
+ * *nothing-found* routed as a *failure* sends someone to investigate a
323
+ * healthy collector, while a *failure* routed as *nothing-found* declares a
324
+ * system fine that was never checked; giving the outcome its own word is
325
+ * how `onToolStatus` edges stop having to guess.
326
+ *
327
+ * The RECORD keeps the coverage twice over: on the emit channel (per-call
328
+ * facts belong there) and, because a limit is a fact about the ANSWER
329
+ * rather than about an attempt, in tracked state — where the final-answer
330
+ * block reads it. Written only when a tool declares one, so an agent that
331
+ * returns neither shape commits exactly what it always did.
332
+ */
333
+ const declareCoverage = (scope, call, value) => {
334
+ const reading = readCoverageResult(value);
335
+ if (reading === undefined)
336
+ return undefined;
337
+ const rows = [];
338
+ for (const facts of reading.declared) {
339
+ // Copied item by item — event payloads are detached plain data, never
340
+ // a shared reference into a value the tool still holds.
341
+ const copy = (list) => list.map((i) => ({ what: i.what, ...(i.why !== undefined && { why: i.why }) }));
342
+ const checked = copy(facts.coverage.checked);
343
+ const notChecked = copy(facts.coverage.notChecked);
344
+ const cannotCover = copy(facts.coverage.cannotCover);
345
+ if (facts.kind === 'absence') {
346
+ typedEmit(scope, 'agentfootprint.tools.absent', {
347
+ toolName: call.toolName,
348
+ toolCallId: call.toolCallId,
349
+ iteration: call.iteration,
350
+ ...(facts.lookedFor !== undefined && { lookedFor: facts.lookedFor }),
351
+ checked,
352
+ ...(notChecked.length > 0 && { notChecked }),
353
+ ...(cannotCover.length > 0 && { cannotCover }),
354
+ });
355
+ }
356
+ else {
357
+ typedEmit(scope, 'agentfootprint.tools.coverage_declared', {
358
+ toolName: call.toolName,
359
+ toolCallId: call.toolCallId,
360
+ iteration: call.iteration,
361
+ ...(checked.length > 0 && { checked }),
362
+ ...(notChecked.length > 0 && { notChecked }),
363
+ ...(cannotCover.length > 0 && { cannotCover }),
364
+ });
365
+ }
366
+ rows.push({
367
+ kind: facts.kind,
368
+ toolName: call.toolName,
369
+ toolCallId: call.toolCallId,
370
+ iteration: call.iteration,
371
+ ...(facts.lookedFor !== undefined && { lookedFor: facts.lookedFor }),
372
+ checked,
373
+ notChecked,
374
+ cannotCover,
375
+ });
376
+ }
377
+ scope.coverageDeclared = [...(scope.coverageDeclared ?? []), ...rows];
378
+ return reading.status;
379
+ };
309
380
  // ── Step-procedure boundary (9.18.0) — ONE implementation, five sites ──
310
381
  // The batch loop and the four resume paths all finalize results; each
311
382
  // calls these where its result becomes final, so a pointer can never miss
@@ -1182,6 +1253,14 @@ export function buildToolCallsHandler(deps) {
1182
1253
  // judged exactly as an inline one's.
1183
1254
  const envelope = readToolResultEnvelope(result);
1184
1255
  if (envelope !== undefined) {
1256
+ // Coverage (this release) before the ceiling, for the same reason the
1257
+ // effects are judged even when the payload is refused: the boundary a
1258
+ // tool declared is not the channel that can overflow, and a limit
1259
+ // that died with an oversized result would be the silence this
1260
+ // primitive exists to break. An absence's status is the tool's own
1261
+ // and wins over the envelope's only when the envelope declared none.
1262
+ const coverageStatus = declareCoverage(scope, { toolName, toolCallId, iteration }, envelope.content);
1263
+ const declaredStatus = envelope.status ?? coverageStatus;
1185
1264
  // The tool's own ceiling (9.20.0) measures the CONTENT — the channel
1186
1265
  // that can overflow a context window. The DECLARED effects are small
1187
1266
  // validated data and are still judged by the caller: a tool that
@@ -1189,7 +1268,7 @@ export function buildToolCallsHandler(deps) {
1189
1268
  // transition. The delivered status becomes 'invalid' (the declared
1190
1269
  // status described a result the model never received — the
1191
1270
  // `result_refused` event keeps what was declared).
1192
- const refusal = refuseOverCeiling(scope, { toolName, toolCallId, iteration }, tool, envelope.content, envelope.status);
1271
+ const refusal = refuseOverCeiling(scope, { toolName, toolCallId, iteration }, tool, envelope.content, declaredStatus);
1193
1272
  if (refusal !== undefined) {
1194
1273
  return {
1195
1274
  result: refusal,
@@ -1198,9 +1277,14 @@ export function buildToolCallsHandler(deps) {
1198
1277
  envelope: { ...envelope, content: refusal, status: 'invalid' },
1199
1278
  };
1200
1279
  }
1201
- return { result: envelope.content, executed: true, envelope };
1280
+ return {
1281
+ result: envelope.content,
1282
+ executed: true,
1283
+ envelope: declaredStatus === envelope.status ? envelope : { ...envelope, status: declaredStatus },
1284
+ };
1202
1285
  }
1203
- const refusal = refuseOverCeiling(scope, { toolName, toolCallId, iteration }, tool, result);
1286
+ const coverageStatus = declareCoverage(scope, { toolName, toolCallId, iteration }, result);
1287
+ const refusal = refuseOverCeiling(scope, { toolName, toolCallId, iteration }, tool, result, coverageStatus);
1204
1288
  if (refusal !== undefined) {
1205
1289
  // Synthesized empty-effects envelope: the resume paths read the
1206
1290
  // routing status off `envelope.status`, and this is how a refused
@@ -1218,6 +1302,19 @@ export function buildToolCallsHandler(deps) {
1218
1302
  const nearMiss = explainStatusOnlyNearMiss(result);
1219
1303
  if (nearMiss !== undefined)
1220
1304
  warnEffect(toolName, nearMiss);
1305
+ if (coverageStatus !== undefined) {
1306
+ // The ceiling path's synthesized envelope, for the same reason: the
1307
+ // resume paths read the routing status off `envelope.status`, and an
1308
+ // absence that lost its status here would route down whichever edge a
1309
+ // statusless result routes down — the confusion the word exists to
1310
+ // end. Empty effects/malformed judge to nothing, so the only thing
1311
+ // this carries is the status.
1312
+ return {
1313
+ result,
1314
+ executed: true,
1315
+ envelope: { content: result, effects: [], status: coverageStatus, malformed: [] },
1316
+ };
1317
+ }
1221
1318
  return { result, executed: true };
1222
1319
  }
1223
1320
  catch (err) {
@@ -1876,6 +1973,15 @@ export function buildToolCallsHandler(deps) {
1876
1973
  if (nearMiss !== undefined)
1877
1974
  warnEffect(tc.name, nearMiss);
1878
1975
  }
1976
+ // Coverage (this release), on the UNWRAPPED content and before
1977
+ // the ceiling — the boundary a tool declared is not the channel
1978
+ // that can overflow. A tool that spelled its own status keeps
1979
+ // it; otherwise an absence names the delivered outcome, so an
1980
+ // `onToolStatus` edge can route "we looked and there was
1981
+ // nothing" somewhere other than "the call broke".
1982
+ const coverageStatus = declareCoverage(scope, { toolName: tc.name, toolCallId: tc.id, iteration }, result);
1983
+ if (toolStatus === undefined)
1984
+ toolStatus = coverageStatus;
1879
1985
  // The tool's own refusing ceiling (9.20.0) — at the execute
1880
1986
  // boundary, BEFORE the gates and the after-tool chain, so
1881
1987
  // governance and the agent-level cap compose over what the