@jinn-network/client 0.1.8 → 0.1.9-canary.023faefb

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 (733) hide show
  1. package/CONTRIBUTING.md +2 -2
  2. package/README.md +6 -0
  3. package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
  4. package/deployments/deployment-stolas-l2-baseSepolia-fast.json +23 -3
  5. package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +34 -6
  6. package/dist/adapters/mech/adapter.d.ts +31 -1
  7. package/dist/adapters/mech/adapter.js +126 -53
  8. package/dist/adapters/mech/adapter.js.map +1 -1
  9. package/dist/adapters/mech/contracts.d.ts +174 -13
  10. package/dist/adapters/mech/contracts.js +99 -49
  11. package/dist/adapters/mech/contracts.js.map +1 -1
  12. package/dist/adapters/mech/safe-revert.d.ts +4 -0
  13. package/dist/adapters/mech/safe-revert.js +5 -1
  14. package/dist/adapters/mech/safe-revert.js.map +1 -1
  15. package/dist/adapters/mech/safe.js +77 -1
  16. package/dist/adapters/mech/safe.js.map +1 -1
  17. package/dist/adapters/mech/types.d.ts +5 -130
  18. package/dist/adapters/mech/types.js +9 -65
  19. package/dist/adapters/mech/types.js.map +1 -1
  20. package/dist/adapters/mech/verdict-code.js +1 -1
  21. package/dist/adapters/mech/verdict-code.js.map +1 -1
  22. package/dist/api/bootstrap-endpoint.d.ts +19 -3
  23. package/dist/api/bootstrap-endpoint.js +4 -0
  24. package/dist/api/bootstrap-endpoint.js.map +1 -1
  25. package/dist/api/discovery-endpoint.d.ts +1 -0
  26. package/dist/api/discovery-endpoint.js +24 -0
  27. package/dist/api/discovery-endpoint.js.map +1 -1
  28. package/dist/api/fleet-build.d.ts +1 -7
  29. package/dist/api/fleet-build.js +0 -7
  30. package/dist/api/fleet-build.js.map +1 -1
  31. package/dist/api/gather-status.d.ts +26 -17
  32. package/dist/api/gather-status.js +62 -520
  33. package/dist/api/gather-status.js.map +1 -1
  34. package/dist/api/harness-auth-status-endpoint.d.ts +21 -0
  35. package/dist/api/harness-auth-status-endpoint.js +17 -0
  36. package/dist/api/harness-auth-status-endpoint.js.map +1 -0
  37. package/dist/api/launcher-endpoints.js +6 -1
  38. package/dist/api/launcher-endpoints.js.map +1 -1
  39. package/dist/api/launcher-status.d.ts +2 -0
  40. package/dist/api/launcher-status.js.map +1 -1
  41. package/dist/api/launcher-tasks.d.ts +47 -0
  42. package/dist/api/launcher-tasks.js +88 -3
  43. package/dist/api/launcher-tasks.js.map +1 -1
  44. package/dist/api/loop-completion-build.d.ts +79 -0
  45. package/dist/api/loop-completion-build.js +154 -0
  46. package/dist/api/loop-completion-build.js.map +1 -0
  47. package/dist/api/operator-artifacts-endpoint.js +1 -1
  48. package/dist/api/operator-artifacts-endpoint.js.map +1 -1
  49. package/dist/api/portfolio-v0-build.d.ts +2 -1
  50. package/dist/api/portfolio-v0-build.js +5 -7
  51. package/dist/api/portfolio-v0-build.js.map +1 -1
  52. package/dist/api/prediction-v1-build.d.ts +2 -2
  53. package/dist/api/prediction-v1-build.js +5 -7
  54. package/dist/api/prediction-v1-build.js.map +1 -1
  55. package/dist/api/rewards-build.d.ts +8 -1
  56. package/dist/api/rewards-build.js +32 -4
  57. package/dist/api/rewards-build.js.map +1 -1
  58. package/dist/api/rewards-endpoint.d.ts +12 -0
  59. package/dist/api/rewards-endpoint.js +46 -0
  60. package/dist/api/rewards-endpoint.js.map +1 -0
  61. package/dist/api/server.d.ts +6 -16
  62. package/dist/api/server.js +29 -26
  63. package/dist/api/server.js.map +1 -1
  64. package/dist/api/setup-endpoints.d.ts +45 -0
  65. package/dist/api/setup-endpoints.js +271 -52
  66. package/dist/api/setup-endpoints.js.map +1 -1
  67. package/dist/api/solvernets-endpoints.js +4 -1
  68. package/dist/api/solvernets-endpoints.js.map +1 -1
  69. package/dist/api/status-build.d.ts +71 -94
  70. package/dist/api/status-build.js +11 -77
  71. package/dist/api/status-build.js.map +1 -1
  72. package/dist/api/status-rollup-build.d.ts +0 -4
  73. package/dist/api/status-rollup-build.js +0 -4
  74. package/dist/api/status-rollup-build.js.map +1 -1
  75. package/dist/api/stop-hook.d.ts +1 -1
  76. package/dist/api/stop-hook.js +1 -1
  77. package/dist/api/stop-hook.js.map +1 -1
  78. package/dist/api/task-run-routing.d.ts +1 -1
  79. package/dist/api/task-runs-build.d.ts +2 -2
  80. package/dist/api/task-runs-build.js +5 -7
  81. package/dist/api/task-runs-build.js.map +1 -1
  82. package/dist/bin/jinn-distil-mcp.js +813 -0
  83. package/dist/bin/jinn-layer.js +12568 -0
  84. package/dist/build-info.json +4 -4
  85. package/dist/build-meta.json +1 -1
  86. package/dist/captures/distil-export.d.ts +54 -0
  87. package/dist/captures/distil-export.js +135 -0
  88. package/dist/captures/distil-export.js.map +1 -0
  89. package/dist/captures/ingest.d.ts +21 -0
  90. package/dist/captures/ingest.js +144 -0
  91. package/dist/captures/ingest.js.map +1 -0
  92. package/dist/captures/live-publisher.d.ts +9 -0
  93. package/dist/captures/live-publisher.js +5 -3
  94. package/dist/captures/live-publisher.js.map +1 -1
  95. package/dist/captures/publish.d.ts +15 -0
  96. package/dist/captures/publish.js +17 -7
  97. package/dist/captures/publish.js.map +1 -1
  98. package/dist/cli/commands/codedigest-revert-check.js +6 -2
  99. package/dist/cli/commands/codedigest-revert-check.js.map +1 -1
  100. package/dist/cli/commands/doctor.d.ts +3 -0
  101. package/dist/cli/commands/doctor.js +36 -4
  102. package/dist/cli/commands/doctor.js.map +1 -1
  103. package/dist/cli/commands/eval.d.ts +87 -0
  104. package/dist/cli/commands/eval.js +481 -0
  105. package/dist/cli/commands/eval.js.map +1 -0
  106. package/dist/cli/commands/rewards.d.ts +2 -0
  107. package/dist/cli/commands/rewards.js +39 -10
  108. package/dist/cli/commands/rewards.js.map +1 -1
  109. package/dist/cli/commands/solver-nets.js +68 -0
  110. package/dist/cli/commands/solver-nets.js.map +1 -1
  111. package/dist/cli/commands/status.js +0 -1
  112. package/dist/cli/commands/status.js.map +1 -1
  113. package/dist/cli/commands/update.js +8 -0
  114. package/dist/cli/commands/update.js.map +1 -1
  115. package/dist/cli/commands/version.js +4 -0
  116. package/dist/cli/commands/version.js.map +1 -1
  117. package/dist/cli/execution-context.js +2 -1
  118. package/dist/cli/execution-context.js.map +1 -1
  119. package/dist/cli/index.js +2 -0
  120. package/dist/cli/index.js.map +1 -1
  121. package/dist/cli/introspection-context.js +0 -3
  122. package/dist/cli/introspection-context.js.map +1 -1
  123. package/dist/config.d.ts +158 -541
  124. package/dist/config.js +190 -197
  125. package/dist/config.js.map +1 -1
  126. package/dist/contracts/abis.d.ts +100 -0
  127. package/dist/contracts/abis.js +58 -0
  128. package/dist/contracts/abis.js.map +1 -0
  129. package/dist/contracts/addresses.d.ts +36 -0
  130. package/dist/contracts/addresses.js +60 -0
  131. package/dist/contracts/addresses.js.map +1 -0
  132. package/dist/corpus/acquire.d.ts +7 -6
  133. package/dist/corpus/acquire.js +10 -10
  134. package/dist/corpus/acquire.js.map +1 -1
  135. package/dist/corpus/fetch-artifact.d.ts +21 -0
  136. package/dist/corpus/fetch-artifact.js +33 -0
  137. package/dist/corpus/fetch-artifact.js.map +1 -0
  138. package/dist/corpus/index.d.ts +2 -2
  139. package/dist/corpus/onchain-query.d.ts +0 -1
  140. package/dist/corpus/onchain-query.js +2 -5
  141. package/dist/corpus/onchain-query.js.map +1 -1
  142. package/dist/corpus/route-resolver.d.ts +3 -3
  143. package/dist/corpus/route-resolver.js +3 -3
  144. package/dist/daemon/ai-units-gate.d.ts +6 -6
  145. package/dist/daemon/ai-units-gate.js +11 -10
  146. package/dist/daemon/ai-units-gate.js.map +1 -1
  147. package/dist/daemon/balance-topup-loop.js +27 -9
  148. package/dist/daemon/balance-topup-loop.js.map +1 -1
  149. package/dist/daemon/checkpoint-loop.js +2 -2
  150. package/dist/daemon/creator.d.ts +1 -0
  151. package/dist/daemon/creator.js +39 -25
  152. package/dist/daemon/creator.js.map +1 -1
  153. package/dist/daemon/daemon.d.ts +15 -10
  154. package/dist/daemon/daemon.js +95 -41
  155. package/dist/daemon/daemon.js.map +1 -1
  156. package/dist/daemon/delivery-watcher.d.ts +9 -0
  157. package/dist/daemon/delivery-watcher.js +24 -1
  158. package/dist/daemon/delivery-watcher.js.map +1 -1
  159. package/dist/daemon/eviction-loop.d.ts +7 -0
  160. package/dist/daemon/eviction-loop.js +19 -3
  161. package/dist/daemon/eviction-loop.js.map +1 -1
  162. package/dist/daemon/join-applier.d.ts +35 -0
  163. package/dist/daemon/join-applier.js +49 -0
  164. package/dist/daemon/join-applier.js.map +1 -0
  165. package/dist/daemon/loop-heartbeat.d.ts +89 -0
  166. package/dist/daemon/loop-heartbeat.js +75 -0
  167. package/dist/daemon/loop-heartbeat.js.map +1 -0
  168. package/dist/{api/peers.js → daemon/peer-sync.js} +3 -1
  169. package/dist/daemon/peer-sync.js.map +1 -0
  170. package/dist/daemon/reward-claim-loop.js +28 -10
  171. package/dist/daemon/reward-claim-loop.js.map +1 -1
  172. package/dist/daemon/skip-log-dedup.d.ts +1 -1
  173. package/dist/daemon/skip-log-dedup.js +3 -0
  174. package/dist/daemon/skip-log-dedup.js.map +1 -1
  175. package/dist/daemon/spend-cap-gate.d.ts +0 -6
  176. package/dist/daemon/spend-cap-gate.js +1 -8
  177. package/dist/daemon/spend-cap-gate.js.map +1 -1
  178. package/dist/daemon/watchdog-loop.d.ts +84 -0
  179. package/dist/daemon/watchdog-loop.js +91 -0
  180. package/dist/daemon/watchdog-loop.js.map +1 -0
  181. package/dist/dashboard/assets/index-B_5Cb-ZH.js +161 -0
  182. package/dist/dashboard/assets/index-D7rvJRNa.css +1 -0
  183. package/dist/dashboard/index.html +2 -2
  184. package/dist/discovery/http.d.ts +17 -0
  185. package/dist/discovery/http.js +378 -26
  186. package/dist/discovery/http.js.map +1 -1
  187. package/dist/discovery/onchain.js +174 -10
  188. package/dist/discovery/onchain.js.map +1 -1
  189. package/dist/discovery/types.d.ts +149 -0
  190. package/dist/discovery/types.js +40 -0
  191. package/dist/discovery/types.js.map +1 -1
  192. package/dist/discovery/with-fallback.js +24 -0
  193. package/dist/discovery/with-fallback.js.map +1 -1
  194. package/dist/earning/bootstrap-run.d.ts +25 -0
  195. package/dist/earning/bootstrap-run.js +315 -0
  196. package/dist/earning/bootstrap-run.js.map +1 -0
  197. package/dist/earning/bootstrap.d.ts +31 -11
  198. package/dist/earning/bootstrap.js +123 -212
  199. package/dist/earning/bootstrap.js.map +1 -1
  200. package/dist/earning/contracts.d.ts +2 -232
  201. package/dist/earning/contracts.js +16 -205
  202. package/dist/earning/contracts.js.map +1 -1
  203. package/dist/earning/faucet-topup-store.d.ts +41 -0
  204. package/dist/earning/faucet-topup-store.js +89 -0
  205. package/dist/earning/faucet-topup-store.js.map +1 -0
  206. package/dist/earning/faucet.d.ts +1 -1
  207. package/dist/earning/faucet.js +2 -2
  208. package/dist/earning/faucet.js.map +1 -1
  209. package/dist/earning/safe-adapter.js +12 -45
  210. package/dist/earning/safe-adapter.js.map +1 -1
  211. package/dist/earning/steps/context.d.ts +42 -0
  212. package/dist/earning/steps/context.js +4 -0
  213. package/dist/earning/steps/context.js.map +1 -0
  214. package/dist/earning/steps/fleet-identity-register.d.ts +4 -0
  215. package/dist/earning/steps/fleet-identity-register.js +65 -0
  216. package/dist/earning/steps/fleet-identity-register.js.map +1 -0
  217. package/dist/earning/steps/fleet-safe-deploy.d.ts +4 -0
  218. package/dist/earning/steps/fleet-safe-deploy.js +62 -0
  219. package/dist/earning/steps/fleet-safe-deploy.js.map +1 -0
  220. package/dist/earning/steps/fleet-safe-predict.d.ts +4 -0
  221. package/dist/earning/steps/fleet-safe-predict.js +18 -0
  222. package/dist/earning/steps/fleet-safe-predict.js.map +1 -0
  223. package/dist/earning/steps/receipt-parsing.d.ts +12 -0
  224. package/dist/earning/steps/receipt-parsing.js +71 -0
  225. package/dist/earning/steps/receipt-parsing.js.map +1 -0
  226. package/dist/earning/stolas-claim.js +8 -8
  227. package/dist/earning/stolas-claim.js.map +1 -1
  228. package/dist/earning/{jinn-rewards.d.ts → stolas-staking.d.ts} +4 -8
  229. package/dist/earning/{jinn-rewards.js → stolas-staking.js} +6 -10
  230. package/dist/earning/stolas-staking.js.map +1 -0
  231. package/dist/earning/testnet-setup-migration.d.ts +1 -0
  232. package/dist/earning/testnet-setup-migration.js +7 -2
  233. package/dist/earning/testnet-setup-migration.js.map +1 -1
  234. package/dist/earning/types.d.ts +1 -1
  235. package/dist/earning/types.js +1 -1
  236. package/dist/earning/types.js.map +1 -1
  237. package/dist/earning/viem-clients.d.ts +3 -19
  238. package/dist/earning/viem-clients.js +4 -31
  239. package/dist/earning/viem-clients.js.map +1 -1
  240. package/dist/erc8004/addresses.d.ts +6 -5
  241. package/dist/erc8004/addresses.js +7 -5
  242. package/dist/erc8004/addresses.js.map +1 -1
  243. package/dist/erc8004/identity.d.ts +12 -1
  244. package/dist/erc8004/identity.js +31 -0
  245. package/dist/erc8004/identity.js.map +1 -1
  246. package/dist/erc8004/index.d.ts +1 -1
  247. package/dist/erc8004/index.js +1 -1
  248. package/dist/erc8004/index.js.map +1 -1
  249. package/dist/eval/capability-slate.d.ts +54 -0
  250. package/dist/eval/capability-slate.js +116 -0
  251. package/dist/eval/capability-slate.js.map +1 -0
  252. package/dist/eval/capability-stats.d.ts +39 -0
  253. package/dist/eval/capability-stats.js +123 -0
  254. package/dist/eval/capability-stats.js.map +1 -0
  255. package/dist/eval/contested-band.d.ts +18 -0
  256. package/dist/eval/contested-band.js +19 -0
  257. package/dist/eval/contested-band.js.map +1 -0
  258. package/dist/eval/corpus-index.d.ts +21 -0
  259. package/dist/eval/corpus-index.js +55 -0
  260. package/dist/eval/corpus-index.js.map +1 -0
  261. package/dist/eval/disjointness.d.ts +26 -0
  262. package/dist/eval/disjointness.js +67 -0
  263. package/dist/eval/disjointness.js.map +1 -0
  264. package/dist/eval/eval-harness-run.d.ts +63 -0
  265. package/dist/eval/eval-harness-run.js +123 -0
  266. package/dist/eval/eval-harness-run.js.map +1 -0
  267. package/dist/eval/mcnemar-power.d.ts +14 -0
  268. package/dist/eval/mcnemar-power.js +40 -0
  269. package/dist/eval/mcnemar-power.js.map +1 -0
  270. package/dist/eval/orchestrator.d.ts +224 -0
  271. package/dist/eval/orchestrator.js +250 -0
  272. package/dist/eval/orchestrator.js.map +1 -0
  273. package/dist/eval/paired.d.ts +68 -0
  274. package/dist/eval/paired.js +93 -0
  275. package/dist/eval/paired.js.map +1 -0
  276. package/dist/eval/resolve-slate-tasks.d.ts +35 -0
  277. package/dist/eval/resolve-slate-tasks.js +56 -0
  278. package/dist/eval/resolve-slate-tasks.js.map +1 -0
  279. package/dist/eval/screen-discovery.d.ts +22 -0
  280. package/dist/eval/screen-discovery.js +71 -0
  281. package/dist/eval/screen-discovery.js.map +1 -0
  282. package/dist/eval/screen-progress.d.ts +41 -0
  283. package/dist/eval/screen-progress.js +60 -0
  284. package/dist/eval/screen-progress.js.map +1 -0
  285. package/dist/eval/screen-runner.d.ts +30 -0
  286. package/dist/eval/screen-runner.js +289 -0
  287. package/dist/eval/screen-runner.js.map +1 -0
  288. package/dist/eval/screen.d.ts +107 -0
  289. package/dist/eval/screen.js +159 -0
  290. package/dist/eval/screen.js.map +1 -0
  291. package/dist/eval/slope.d.ts +29 -0
  292. package/dist/eval/slope.js +46 -0
  293. package/dist/eval/slope.js.map +1 -0
  294. package/dist/eval/train-sequence.d.ts +35 -0
  295. package/dist/eval/train-sequence.js +59 -0
  296. package/dist/eval/train-sequence.js.map +1 -0
  297. package/dist/eval/wilson.d.ts +45 -0
  298. package/dist/eval/wilson.js +48 -0
  299. package/dist/eval/wilson.js.map +1 -0
  300. package/dist/events/types.d.ts +1 -1
  301. package/dist/events/types.js +1 -1
  302. package/dist/events/types.js.map +1 -1
  303. package/dist/harnesses/auth-source.d.ts +51 -0
  304. package/dist/harnesses/auth-source.js +155 -0
  305. package/dist/harnesses/auth-source.js.map +1 -0
  306. package/dist/harnesses/engine/canonical-json.js +5 -3
  307. package/dist/harnesses/engine/canonical-json.js.map +1 -1
  308. package/dist/harnesses/engine/engine.d.ts +34 -1
  309. package/dist/harnesses/engine/engine.js +91 -11
  310. package/dist/harnesses/engine/engine.js.map +1 -1
  311. package/dist/harnesses/engine/packaging.js +5 -5
  312. package/dist/harnesses/engine/packaging.js.map +1 -1
  313. package/dist/harnesses/engine/persistence.d.ts +19 -61
  314. package/dist/harnesses/engine/persistence.js +28 -0
  315. package/dist/harnesses/engine/persistence.js.map +1 -1
  316. package/dist/harnesses/impls/_evaluator-base.d.ts +48 -0
  317. package/dist/harnesses/impls/_evaluator-base.js +35 -0
  318. package/dist/harnesses/impls/_evaluator-base.js.map +1 -0
  319. package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +1 -1
  320. package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js +1 -1
  321. package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -1
  322. package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +2 -3
  323. package/dist/harnesses/impls/claude-mcp-prediction/index.js +29 -99
  324. package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
  325. package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +4 -21
  326. package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -1
  327. package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +2 -0
  328. package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +1 -1
  329. package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
  330. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +30 -79
  331. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
  332. package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +4 -19
  333. package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -1
  334. package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +2 -0
  335. package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +1 -1
  336. package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
  337. package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.d.ts +39 -0
  338. package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js +62 -0
  339. package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js.map +1 -0
  340. package/dist/harnesses/impls/claude-mcp-shared/mcp-server.d.ts +40 -0
  341. package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js +44 -0
  342. package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js.map +1 -0
  343. package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.d.ts +56 -0
  344. package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js +79 -0
  345. package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js.map +1 -0
  346. package/dist/harnesses/impls/hermes-agent/adapter.d.ts +2 -0
  347. package/dist/harnesses/impls/hermes-agent/adapter.js +8 -5
  348. package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
  349. package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +1 -0
  350. package/dist/harnesses/impls/hermes-agent/bootstrap.js +6 -1
  351. package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
  352. package/dist/harnesses/impls/hermes-agent/harness.d.ts +25 -3
  353. package/dist/harnesses/impls/hermes-agent/harness.js +89 -5
  354. package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
  355. package/dist/harnesses/impls/index.d.ts +2 -0
  356. package/dist/harnesses/impls/index.js +10 -1
  357. package/dist/harnesses/impls/index.js.map +1 -1
  358. package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.d.ts +34 -0
  359. package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js +111 -0
  360. package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js.map +1 -0
  361. package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.d.ts +24 -0
  362. package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js +19 -0
  363. package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js.map +1 -0
  364. package/dist/harnesses/impls/jinn-repo-evaluator/harness.d.ts +64 -0
  365. package/dist/harnesses/impls/jinn-repo-evaluator/harness.js +125 -0
  366. package/dist/harnesses/impls/jinn-repo-evaluator/harness.js.map +1 -0
  367. package/dist/harnesses/impls/jinn-repo-evaluator/repro.d.ts +32 -0
  368. package/dist/harnesses/impls/jinn-repo-evaluator/repro.js +73 -0
  369. package/dist/harnesses/impls/jinn-repo-evaluator/repro.js.map +1 -0
  370. package/dist/harnesses/impls/learner/adapters/claude-code.js +5 -0
  371. package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
  372. package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +11 -1
  373. package/dist/harnesses/impls/learner/adapters/codex-code.js +130 -15
  374. package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
  375. package/dist/harnesses/impls/learner/harness.d.ts +29 -1
  376. package/dist/harnesses/impls/learner/harness.js +85 -1
  377. package/dist/harnesses/impls/learner/harness.js.map +1 -1
  378. package/dist/harnesses/impls/learner/harvest.d.ts +2 -0
  379. package/dist/harnesses/impls/learner/harvest.js +51 -1
  380. package/dist/harnesses/impls/learner/harvest.js.map +1 -1
  381. package/dist/harnesses/impls/learner/plugin-path.js +1 -0
  382. package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
  383. package/dist/harnesses/impls/portfolio-v0-evaluator/index.d.ts +5 -15
  384. package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +10 -29
  385. package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
  386. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +5 -15
  387. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +10 -23
  388. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
  389. package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +5 -15
  390. package/dist/harnesses/impls/prediction-v0-evaluator/index.js +10 -25
  391. package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
  392. package/dist/harnesses/impls/stub.d.ts +2 -2
  393. package/dist/harnesses/impls/stub.js +2 -2
  394. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +8 -0
  395. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
  396. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +3 -1
  397. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
  398. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +2 -2
  399. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +3 -1
  400. package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
  401. package/dist/harnesses/readiness-registry.d.ts +16 -0
  402. package/dist/harnesses/readiness-registry.js +28 -6
  403. package/dist/harnesses/readiness-registry.js.map +1 -1
  404. package/dist/harnesses/types.d.ts +26 -0
  405. package/dist/learner/revert-decision.d.ts +16 -1
  406. package/dist/learner/revert-decision.js +38 -18
  407. package/dist/learner/revert-decision.js.map +1 -1
  408. package/dist/learner/revert-stats.d.ts +14 -0
  409. package/dist/learner/revert-stats.js +42 -0
  410. package/dist/learner/revert-stats.js.map +1 -1
  411. package/dist/learner/verification-gate.d.ts +53 -0
  412. package/dist/learner/verification-gate.js +80 -0
  413. package/dist/learner/verification-gate.js.map +1 -0
  414. package/dist/local-provider-url.d.ts +3 -0
  415. package/dist/local-provider-url.js +28 -0
  416. package/dist/local-provider-url.js.map +1 -0
  417. package/dist/main.js +188 -566
  418. package/dist/main.js.map +1 -1
  419. package/dist/mcp/acquire-artifact.d.ts +3 -3
  420. package/dist/mcp/acquire-artifact.js +3 -3
  421. package/dist/mcp/operator-server.js +1 -1
  422. package/dist/mcp/operator-server.js.map +1 -1
  423. package/dist/mcp/server.js +5 -6
  424. package/dist/mcp/server.js.map +1 -1
  425. package/dist/monitoring/net-liveness.d.ts +143 -0
  426. package/dist/monitoring/net-liveness.js +301 -0
  427. package/dist/monitoring/net-liveness.js.map +1 -0
  428. package/dist/observability/emit-event.d.ts +1 -1
  429. package/dist/observability/emit-event.js +0 -4
  430. package/dist/observability/emit-event.js.map +1 -1
  431. package/dist/observability/progress.d.ts +11 -0
  432. package/dist/observability/progress.js +16 -0
  433. package/dist/observability/progress.js.map +1 -0
  434. package/dist/pilot/cost.d.ts +19 -0
  435. package/dist/pilot/cost.js +31 -0
  436. package/dist/pilot/cost.js.map +1 -0
  437. package/dist/pilot/instance.d.ts +20 -0
  438. package/dist/pilot/instance.js +19 -0
  439. package/dist/pilot/instance.js.map +1 -0
  440. package/dist/pilot/repo.d.ts +31 -0
  441. package/dist/pilot/repo.js +42 -0
  442. package/dist/pilot/repo.js.map +1 -0
  443. package/dist/pilot/solve.d.ts +22 -0
  444. package/dist/pilot/solve.js +37 -0
  445. package/dist/pilot/solve.js.map +1 -0
  446. package/dist/pilot/tally.d.ts +35 -0
  447. package/dist/pilot/tally.js +61 -0
  448. package/dist/pilot/tally.js.map +1 -0
  449. package/dist/plugins/learner/.claude-plugin/plugin.json +1 -1
  450. package/dist/plugins/learner/.codex-plugin/plugin.json +1 -1
  451. package/dist/plugins/learner/hooks/session-start +30 -1
  452. package/dist/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
  453. package/dist/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
  454. package/dist/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
  455. package/dist/plugins/local-trace-distiller/.mcp.json +8 -0
  456. package/dist/plugins/local-trace-distiller/README.md +27 -0
  457. package/dist/plugins/local-trace-distiller/jinn.plugin.json +36 -0
  458. package/dist/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
  459. package/dist/preflight/deployment-readiness.d.ts +127 -0
  460. package/dist/preflight/deployment-readiness.js +308 -0
  461. package/dist/preflight/deployment-readiness.js.map +1 -0
  462. package/dist/preflight/pidfile-liveness.d.ts +7 -1
  463. package/dist/preflight/pidfile-liveness.js +14 -0
  464. package/dist/preflight/pidfile-liveness.js.map +1 -1
  465. package/dist/preflight/rpc-network.d.ts +10 -3
  466. package/dist/preflight/rpc-network.js +46 -13
  467. package/dist/preflight/rpc-network.js.map +1 -1
  468. package/dist/preflight/stable-cwd.d.ts +29 -0
  469. package/dist/preflight/stable-cwd.js +98 -0
  470. package/dist/preflight/stable-cwd.js.map +1 -0
  471. package/dist/rpc/transport.d.ts +43 -5
  472. package/dist/rpc/transport.js +131 -30
  473. package/dist/rpc/transport.js.map +1 -1
  474. package/dist/scripts/swe-rebench-v2-seed-pool.json +2 -1
  475. package/dist/solver-nets/registry.d.ts +19 -0
  476. package/dist/solver-nets/registry.js +95 -66
  477. package/dist/solver-nets/registry.js.map +1 -1
  478. package/dist/solver-types/_jinn-repo-pool.d.ts +27 -0
  479. package/dist/solver-types/_jinn-repo-pool.js +27 -0
  480. package/dist/solver-types/_jinn-repo-pool.js.map +1 -0
  481. package/dist/solver-types/_swe-rebench-v2-held-out-slate.d.ts +76 -0
  482. package/dist/solver-types/_swe-rebench-v2-held-out-slate.js +156 -0
  483. package/dist/solver-types/_swe-rebench-v2-held-out-slate.js.map +1 -0
  484. package/dist/solver-types/_swe-rebench-v2-pool-recovery.d.ts +81 -0
  485. package/dist/solver-types/_swe-rebench-v2-pool-recovery.js +116 -0
  486. package/dist/solver-types/_swe-rebench-v2-pool-recovery.js.map +1 -0
  487. package/dist/solver-types/_swe-rebench-v2-state.d.ts +9 -0
  488. package/dist/solver-types/_swe-rebench-v2-state.js +14 -0
  489. package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
  490. package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +30 -0
  491. package/dist/solver-types/_swe-rebench-v2-validated-pool.js +40 -0
  492. package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
  493. package/dist/solver-types/index.js +2 -0
  494. package/dist/solver-types/index.js.map +1 -1
  495. package/dist/solver-types/jinn-repo-admit.d.ts +17 -0
  496. package/dist/solver-types/jinn-repo-admit.js +16 -0
  497. package/dist/solver-types/jinn-repo-admit.js.map +1 -0
  498. package/dist/solver-types/jinn-repo-auto.d.ts +60 -0
  499. package/dist/solver-types/jinn-repo-auto.js +163 -0
  500. package/dist/solver-types/jinn-repo-auto.js.map +1 -0
  501. package/dist/solver-types/jinn-repo-definition.d.ts +15 -0
  502. package/dist/solver-types/jinn-repo-definition.js +34 -0
  503. package/dist/solver-types/jinn-repo-definition.js.map +1 -0
  504. package/dist/solver-types/jinn-repo-extract.d.ts +16 -0
  505. package/dist/solver-types/jinn-repo-extract.js +32 -0
  506. package/dist/solver-types/jinn-repo-extract.js.map +1 -0
  507. package/dist/solver-types/jinn-repo.d.ts +21 -0
  508. package/dist/solver-types/jinn-repo.js +23 -0
  509. package/dist/solver-types/jinn-repo.js.map +1 -0
  510. package/dist/solver-types/learner-loop-test.js +1 -1
  511. package/dist/solver-types/learner-loop-test.js.map +1 -1
  512. package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v1.json +20 -0
  513. package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.json +19 -0
  514. package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.screening-report.json +628 -0
  515. package/dist/solver-types/solver-type.d.ts +8 -0
  516. package/dist/solver-types/swe-rebench-v2.d.ts +2 -0
  517. package/dist/solver-types/swe-rebench-v2.js +115 -10
  518. package/dist/solver-types/swe-rebench-v2.js.map +1 -1
  519. package/dist/solvernets/launched-record-dispatcher.d.ts +5 -0
  520. package/dist/solvernets/launched-record-dispatcher.js +14 -1
  521. package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
  522. package/dist/solvernets/registry-client-erc8004.js +29 -37
  523. package/dist/solvernets/registry-client-erc8004.js.map +1 -1
  524. package/dist/solvernets/registry-client.d.ts +6 -0
  525. package/dist/solvernets/store.d.ts +1 -1
  526. package/dist/solvernets/store.js +8 -3
  527. package/dist/solvernets/store.js.map +1 -1
  528. package/dist/spend/ai-units-config.d.ts +10 -0
  529. package/dist/spend/ai-units-config.js +7 -1
  530. package/dist/spend/ai-units-config.js.map +1 -1
  531. package/dist/spend/ai-units.d.ts +51 -0
  532. package/dist/spend/ai-units.js +73 -0
  533. package/dist/spend/ai-units.js.map +1 -1
  534. package/dist/spend/credential.d.ts +2 -2
  535. package/dist/spend/credential.js +9 -3
  536. package/dist/spend/credential.js.map +1 -1
  537. package/dist/spend/record.js +12 -5
  538. package/dist/spend/record.js.map +1 -1
  539. package/dist/spend/spend-cap.d.ts +10 -0
  540. package/dist/spend/spend-cap.js +13 -0
  541. package/dist/spend/spend-cap.js.map +1 -0
  542. package/dist/spend/usage.js +39 -3
  543. package/dist/spend/usage.js.map +1 -1
  544. package/dist/store/store.d.ts +106 -5
  545. package/dist/store/store.js +194 -8
  546. package/dist/store/store.js.map +1 -1
  547. package/dist/trajectory/emit.d.ts +6 -0
  548. package/dist/trajectory/emit.js +9 -1
  549. package/dist/trajectory/emit.js.map +1 -1
  550. package/dist/trajectory/harness-bundle-schema.d.ts +1 -1
  551. package/dist/trajectory/harness-bundle-schema.js +1 -1
  552. package/dist/trajectory/harness-bundle-schema.js.map +1 -1
  553. package/dist/trajectory/processors/identity-scrub.js +22 -3
  554. package/dist/trajectory/processors/identity-scrub.js.map +1 -1
  555. package/dist/trajectory/schema.d.ts +1 -1
  556. package/dist/trajectory/schema.js +1 -1
  557. package/dist/trajectory/schema.js.map +1 -1
  558. package/dist/trajectory/scrub/build.d.ts +46 -0
  559. package/dist/trajectory/scrub/build.js +76 -0
  560. package/dist/trajectory/scrub/build.js.map +1 -0
  561. package/dist/trajectory/scrub/emit-scrub.d.ts +41 -0
  562. package/dist/trajectory/scrub/emit-scrub.js +88 -0
  563. package/dist/trajectory/scrub/emit-scrub.js.map +1 -0
  564. package/dist/trajectory/scrub/key-policy.d.ts +20 -0
  565. package/dist/trajectory/scrub/key-policy.js +43 -0
  566. package/dist/trajectory/scrub/key-policy.js.map +1 -0
  567. package/dist/trajectory/scrub/layer2.d.ts +23 -0
  568. package/dist/trajectory/scrub/layer2.js +33 -0
  569. package/dist/trajectory/scrub/layer2.js.map +1 -0
  570. package/dist/trajectory/scrub/ml-pii-stage.d.ts +24 -0
  571. package/dist/trajectory/scrub/ml-pii-stage.js +43 -0
  572. package/dist/trajectory/scrub/ml-pii-stage.js.map +1 -0
  573. package/dist/trajectory/scrub/openredaction-stage.d.ts +178 -0
  574. package/dist/trajectory/scrub/openredaction-stage.js +269 -0
  575. package/dist/trajectory/scrub/openredaction-stage.js.map +1 -0
  576. package/dist/trajectory/scrub/pii-build.d.ts +31 -0
  577. package/dist/trajectory/scrub/pii-build.js +64 -0
  578. package/dist/trajectory/scrub/pii-build.js.map +1 -0
  579. package/dist/trajectory/scrub/pipeline.d.ts +37 -0
  580. package/dist/trajectory/scrub/pipeline.js +83 -0
  581. package/dist/trajectory/scrub/pipeline.js.map +1 -0
  582. package/dist/trajectory/scrub/plain-patterns-stage.d.ts +31 -0
  583. package/dist/trajectory/scrub/plain-patterns-stage.js +85 -0
  584. package/dist/trajectory/scrub/plain-patterns-stage.js.map +1 -0
  585. package/dist/trajectory/scrub/secretlint-stage.d.ts +35 -0
  586. package/dist/trajectory/scrub/secretlint-stage.js +250 -0
  587. package/dist/trajectory/scrub/secretlint-stage.js.map +1 -0
  588. package/dist/trajectory/scrub/transformers-detector.d.ts +35 -0
  589. package/dist/trajectory/scrub/transformers-detector.js +68 -0
  590. package/dist/trajectory/scrub/transformers-detector.js.map +1 -0
  591. package/dist/trajectory/scrub/types.d.ts +25 -0
  592. package/dist/trajectory/scrub/types.js +2 -0
  593. package/dist/trajectory/scrub/types.js.map +1 -0
  594. package/dist/trajectory/transcript-parsers/types.d.ts +1 -1
  595. package/dist/trajectory/transcript-parsers/types.js +1 -1
  596. package/dist/trajectory/transcript-parsers/types.js.map +1 -1
  597. package/dist/trajectory/transcript-watcher.d.ts +26 -0
  598. package/dist/trajectory/transcript-watcher.js +33 -0
  599. package/dist/trajectory/transcript-watcher.js.map +1 -1
  600. package/dist/tx-retry.d.ts +12 -0
  601. package/dist/tx-retry.js +41 -12
  602. package/dist/tx-retry.js.map +1 -1
  603. package/dist/types/envelope.d.ts +1 -1
  604. package/dist/types/envelope.js +1 -1
  605. package/dist/types/envelope.js.map +1 -1
  606. package/dist/types/payloads/index.d.ts +1 -1
  607. package/dist/types/payloads/index.js +7 -1
  608. package/dist/types/payloads/index.js.map +1 -1
  609. package/dist/types/payloads/portfolio-v0.d.ts +1 -1
  610. package/dist/types/payloads/portfolio-v0.js +1 -1
  611. package/dist/types/payloads/portfolio-v0.js.map +1 -1
  612. package/dist/types/payloads/prediction-apy-v0.d.ts +1 -1
  613. package/dist/types/payloads/prediction-apy-v0.js +1 -1
  614. package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
  615. package/dist/types/payloads/prediction-v0.d.ts +1 -1
  616. package/dist/types/payloads/prediction-v0.js +1 -1
  617. package/dist/types/payloads/prediction-v0.js.map +1 -1
  618. package/dist/types/portfolio.d.ts +1 -1
  619. package/dist/types/portfolio.js +1 -1
  620. package/dist/types/portfolio.js.map +1 -1
  621. package/dist/types/prediction-apy.d.ts +1 -1
  622. package/dist/types/prediction-apy.js +1 -1
  623. package/dist/types/prediction-apy.js.map +1 -1
  624. package/dist/types/prediction.d.ts +1 -1
  625. package/dist/types/prediction.js +1 -1
  626. package/dist/types/prediction.js.map +1 -1
  627. package/dist/types/session-provenance.d.ts +1 -1
  628. package/dist/types/session-provenance.js +1 -1
  629. package/dist/types/session-provenance.js.map +1 -1
  630. package/dist/types/skill-artifact.d.ts +442 -0
  631. package/dist/types/skill-artifact.js +137 -0
  632. package/dist/types/skill-artifact.js.map +1 -0
  633. package/dist/types/task-document.d.ts +315 -1
  634. package/dist/types/task-document.js +9 -1
  635. package/dist/types/task-document.js.map +1 -1
  636. package/dist/types/task-run-read-model.d.ts +21 -0
  637. package/dist/types/task-run-read-model.js +2 -0
  638. package/dist/types/task-run-read-model.js.map +1 -0
  639. package/dist/types/task-run.d.ts +75 -0
  640. package/dist/types/task-run.js +2 -0
  641. package/dist/types/task-run.js.map +1 -0
  642. package/dist/types/task.d.ts +29 -1
  643. package/dist/types/task.js +1 -1
  644. package/dist/types/task.js.map +1 -1
  645. package/dist/types/window.d.ts +1 -1
  646. package/dist/types/window.js +1 -1
  647. package/dist/types/window.js.map +1 -1
  648. package/dist/util/redact-rpc-urls.d.ts +1 -1
  649. package/dist/util/redact-rpc-urls.js +57 -2
  650. package/dist/util/redact-rpc-urls.js.map +1 -1
  651. package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +1 -1
  652. package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +1 -1
  653. package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +3 -2
  654. package/dist/vendor/@jinn-network/sdk/dist/contracts.js +49 -0
  655. package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.d.ts +44 -0
  656. package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.js +25 -0
  657. package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +1 -1
  658. package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +1 -1
  659. package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.d.ts +38 -0
  660. package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.js +22 -0
  661. package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +1 -1
  662. package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +1 -1
  663. package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.d.ts +1 -1
  664. package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.js +1 -1
  665. package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +109 -2
  666. package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +26 -2
  667. package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +1 -1
  668. package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +1 -1
  669. package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.d.ts +4 -0
  670. package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.js +2 -0
  671. package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +1 -1
  672. package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -1
  673. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.d.ts +65 -0
  674. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.js +123 -0
  675. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.d.ts +2 -2
  676. package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.js +1 -1
  677. package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.d.ts +1 -1
  678. package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +1 -1
  679. package/dist/vendor/@jinn-network/sdk/package.json +9 -1
  680. package/docker-compose.yml +3 -2
  681. package/package.json +43 -28
  682. package/plugins/jinn-repo-runtime/.claude-plugin/plugin.json +5 -0
  683. package/plugins/jinn-repo-runtime/.codex-plugin/plugin.json +39 -0
  684. package/plugins/jinn-repo-runtime/README.md +27 -0
  685. package/plugins/jinn-repo-runtime/hooks/hooks.json +16 -0
  686. package/plugins/jinn-repo-runtime/hooks/session-start +73 -0
  687. package/plugins/jinn-repo-runtime/jinn.plugin.json +11 -0
  688. package/plugins/jinn-repo-runtime/skills/task/SKILL.md +92 -0
  689. package/plugins/learner/.claude-plugin/plugin.json +1 -1
  690. package/plugins/learner/.codex-plugin/plugin.json +1 -1
  691. package/plugins/learner/hooks/session-start +30 -1
  692. package/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
  693. package/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
  694. package/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
  695. package/plugins/local-trace-distiller/.mcp.json +8 -0
  696. package/plugins/local-trace-distiller/README.md +27 -0
  697. package/plugins/local-trace-distiller/jinn.plugin.json +36 -0
  698. package/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
  699. package/plugins/swe-rebench-v2-runtime/hooks/hooks.json +16 -0
  700. package/plugins/swe-rebench-v2-runtime/hooks/session-start +74 -0
  701. package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +0 -55
  702. package/deployments/deployment-jinn-mvi-l1-sepolia.json +0 -55
  703. package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +0 -13
  704. package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +0 -15
  705. package/dist/api/peers.js.map +0 -1
  706. package/dist/daemon/jinn-claim-loop-canonical.d.ts +0 -207
  707. package/dist/daemon/jinn-claim-loop-canonical.js +0 -296
  708. package/dist/daemon/jinn-claim-loop-canonical.js.map +0 -1
  709. package/dist/daemon/jinn-claim-loop-mock.d.ts +0 -61
  710. package/dist/daemon/jinn-claim-loop-mock.js +0 -122
  711. package/dist/daemon/jinn-claim-loop-mock.js.map +0 -1
  712. package/dist/daemon/jinn-claim-loop-wiring.d.ts +0 -33
  713. package/dist/daemon/jinn-claim-loop-wiring.js +0 -40
  714. package/dist/daemon/jinn-claim-loop-wiring.js.map +0 -1
  715. package/dist/daemon/jinn-claim-loop.d.ts +0 -130
  716. package/dist/daemon/jinn-claim-loop.js +0 -328
  717. package/dist/daemon/jinn-claim-loop.js.map +0 -1
  718. package/dist/dashboard/assets/index-CzKxvMcU.css +0 -32
  719. package/dist/dashboard/assets/index-yVemxHot.js +0 -351
  720. package/dist/earning/jinn-rewards.js.map +0 -1
  721. package/dist/scripts/donation-consumption-acceptance.d.ts +0 -85
  722. package/dist/scripts/donation-consumption-acceptance.js +0 -1382
  723. package/dist/scripts/donation-consumption-acceptance.js.map +0 -1
  724. package/dist/x402/acquire.d.ts +0 -17
  725. package/dist/x402/acquire.js +0 -49
  726. package/dist/x402/acquire.js.map +0 -1
  727. package/dist/x402/facilitator.d.ts +0 -11
  728. package/dist/x402/facilitator.js +0 -52
  729. package/dist/x402/facilitator.js.map +0 -1
  730. package/dist/x402/handler.d.ts +0 -27
  731. package/dist/x402/handler.js +0 -236
  732. package/dist/x402/handler.js.map +0 -1
  733. /package/dist/{api/peers.d.ts → daemon/peer-sync.d.ts} +0 -0
@@ -4,6 +4,7 @@
4
4
  * Phase 1 (master): generate mnemonic → fund master EOA
5
5
  * Phase 2 (per-service): derive agent → stake → deploy mech
6
6
  */
7
+ import { type Hex } from 'viem';
7
8
  import type { FleetState, FleetBootstrapResult, StakingMode } from './types.js';
8
9
  import { requestTestnetFunding } from './faucet.js';
9
10
  import { type JinnOnchainNetwork } from './viem-clients.js';
@@ -162,6 +163,11 @@ export interface FleetBootstrapperOptions {
162
163
  * (~1.5 Base Sepolia blocks). Tests pass 0 to skip the sleep entirely.
163
164
  */
164
165
  safeBindingRetryDelayMs?: number;
166
+ /**
167
+ * Backoff before retrying a transient CDP faucet 429 (issue #984 work unit 1).
168
+ * Defaults to 15000 ms. Tests pass 0 to skip the sleep entirely.
169
+ */
170
+ faucetRateLimitBackoffMs?: number;
165
171
  }
166
172
  export declare class FleetBootstrapper {
167
173
  private readonly store;
@@ -179,6 +185,7 @@ export declare class FleetBootstrapper {
179
185
  private readonly autoTestnetFaucet;
180
186
  private readonly safeBindingMaxAttempts;
181
187
  private readonly safeBindingRetryDelayMs;
188
+ private readonly faucetRateLimitBackoffMs;
182
189
  constructor(options?: FleetBootstrapperOptions);
183
190
  getStatus(): Promise<FleetState>;
184
191
  /**
@@ -278,11 +285,8 @@ export declare class FleetBootstrapper {
278
285
  private warnMasterEthRunway;
279
286
  private ensureMasterWallet;
280
287
  private loadExistingMnemonic;
281
- /** Deterministic Safe predict from the HD-index-1 agent EOA. */
282
288
  private stepFleetSafePredict;
283
- /** Deploy the predicted fleet Safe. Funds the agent EOA from master if needed. */
284
289
  private stepFleetSafeDeploy;
285
- /** Mint the fleet agentId + bind Safe via setAgentWallet (ERC-1271). */
286
290
  private stepFleetIdentityRegister;
287
291
  private bootstrapService;
288
292
  /**
@@ -340,6 +344,12 @@ export declare class FleetBootstrapper {
340
344
  private stepSelfBondRegisterAgents;
341
345
  private stepSelfBondDeployService;
342
346
  private stepSelfBondStakeService;
347
+ /**
348
+ * Fresh dependency bag for an extracted step. Rebuilt on every call so a
349
+ * spy installed after construction is honoured; the spied helper arrows
350
+ * dispatch through `this` at call time (see plan Binding rule).
351
+ */
352
+ private stepContext;
343
353
  private getBondTokenBalance;
344
354
  private getServiceState;
345
355
  private waitForSuccessfulTx;
@@ -349,14 +359,6 @@ export declare class FleetBootstrapper {
349
359
  private getStakingState;
350
360
  private parseServiceIdFromReceipt;
351
361
  private parseMultisigFromReceipt;
352
- /**
353
- * Extract `agentId` from an `IdentityRegistry.Registered` log emitted in
354
- * the receipt. Filters by `(address, topic[0])` first to avoid colliding
355
- * with any other contract that happens to share the event signature.
356
- *
357
- * Returns the agentId as a decimal string (uint256) so it round-trips
358
- * cleanly through JSON-persisted EarningState.
359
- */
360
362
  private parseAgentIdFromReceipt;
361
363
  }
362
364
  /** @deprecated Use FleetBootstrapper */
@@ -371,6 +373,24 @@ export interface RecoverEvictedServiceOptions {
371
373
  chain: JinnOnchainNetwork;
372
374
  mnemonic: string;
373
375
  }
376
+ /**
377
+ * Inspect a mined reStake receipt and log the correct outcome (#916).
378
+ *
379
+ * Pure + I/O-free so it can be unit-tested without a chain client. On a
380
+ * `success` receipt it logs `reStake confirmed` at log level. On a `reverted`
381
+ * receipt it logs `reStake reverted` at debug level (a benign substrate event —
382
+ * the NotEnoughTimeStaked window / stale-RPC race; staking is non-load-bearing,
383
+ * DR-2026-06-04 / #1060) with the decoded reason if the caller could obtain one,
384
+ * and still throws so the recovery attempt re-queues (#916 control flow intact).
385
+ */
386
+ export declare function handleReStakeReceipt(args: {
387
+ receipt: {
388
+ status: 'success' | 'reverted';
389
+ };
390
+ serviceDisplayIndex: number;
391
+ reStakeHash: Hex;
392
+ revertReason?: string;
393
+ }): void;
374
394
  /**
375
395
  * Re-stake an evicted service by calling `distributor.reStake(stakingProxy, serviceId)`.
376
396
  *
@@ -4,8 +4,8 @@
4
4
  * Phase 1 (master): generate mnemonic → fund master EOA
5
5
  * Phase 2 (per-service): derive agent → stake → deploy mech
6
6
  */
7
- import { decodeEventLog, encodeAbiParameters, encodeFunctionData, formatEther, getAddress, zeroAddress, } from 'viem';
8
- import { ERC20_ABI, EVENT_TOPICS, IDENTITY_REGISTRY_ABI, IDENTITY_REGISTRY_ADDRESSES, SERVICE_MANAGER_ABI, SERVICE_REGISTRY_APPROVE_ABI, SERVICE_REGISTRY_L2_ABI, STAKING_ABI, MECH_MARKETPLACE_CREATE_ABI, STOLAS_DISTRIBUTOR_ABI, STOLAS_STAKING_SLOTS_ABI, applyChainGasOverrides, cidToBytes32, getChainConfig, } from './contracts.js';
7
+ import { encodeAbiParameters, encodeFunctionData, formatEther, getAddress, zeroAddress, } from 'viem';
8
+ import { ERC20_ABI, IDENTITY_REGISTRY_ABI, IDENTITY_REGISTRY_ADDRESSES, SERVICE_MANAGER_ABI, SERVICE_REGISTRY_APPROVE_ABI, SERVICE_REGISTRY_L2_ABI, STAKING_ABI, MECH_MARKETPLACE_CREATE_ABI, STOLAS_DISTRIBUTOR_ABI, STOLAS_STAKING_SLOTS_ABI, applyChainGasOverrides, cidToBytes32, getChainConfig, } from './contracts.js';
9
9
  import { executeSafeTxBatch, executeSafeTxDirect, initDeployedSafe, initPredictedSafe, } from './safe-adapter.js';
10
10
  import { bindAgentWalletToSafe } from './agent-wallet-binding.js';
11
11
  import { FleetStateStore } from './store.js';
@@ -17,12 +17,17 @@ import { previousSafeBeingAbandoned, sweepOrphanedServiceFunds, } from './orphan
17
17
  import { DEFAULT_FAUCET_LOOP_TIMEOUT_MS, computeFaucetDripCap, requestTestnetFunding, } from './faucet.js';
18
18
  import { flattenErrorMessage, sleep, viemSendTransactionWithRetry, waitForContractCode, waitForTransactionReceiptWithRetry, } from '../tx-retry.js';
19
19
  import { isUnauthorizedAccountError } from '../errors/unauthorized-account.js';
20
+ import { formatKnownRevert } from '../adapters/mech/safe-revert.js';
20
21
  import { createJinnPublicClient, createJinnWalletClient } from './viem-clients.js';
21
22
  import { isTransientEthReadError } from '../chain-read-errors.js';
22
23
  import { nextFleetServiceIndex } from './next-service-index.js';
23
24
  import { displayFleetServiceIndex } from './fleet-display-index.js';
24
25
  import { rpcHostForDisplay } from '../preflight/rpc-network.js';
25
26
  import { detectDeprecatedTestnetSetup, migrateDeprecatedTestnetSetup, } from './testnet-setup-migration.js';
27
+ import { parseAgentIdFromReceipt as parseAgentIdFromReceiptImpl, parseMultisigFromReceipt as parseMultisigFromReceiptImpl, parseServiceIdFromReceipt as parseServiceIdFromReceiptImpl, } from './steps/receipt-parsing.js';
28
+ import { stepFleetSafePredict as stepFleetSafePredictImpl } from './steps/fleet-safe-predict.js';
29
+ import { stepFleetSafeDeploy as stepFleetSafeDeployImpl } from './steps/fleet-safe-deploy.js';
30
+ import { stepFleetIdentityRegister as stepFleetIdentityRegisterImpl } from './steps/fleet-identity-register.js';
26
31
  const addr = (value) => getAddress(value);
27
32
  const SAFE_TOKEN_BOOTSTRAP_MULTIPLIER = 2n;
28
33
  /**
@@ -183,6 +188,8 @@ const MASTER_ETH_RUNWAY_WARN_DAYS = 7n;
183
188
  */
184
189
  const DEFAULT_SAFE_BINDING_MAX_ATTEMPTS = 3;
185
190
  const DEFAULT_SAFE_BINDING_RETRY_DELAY_MS = 3_000;
191
+ const FAUCET_RATE_LIMIT_MAX_RETRIES = 3;
192
+ const DEFAULT_FAUCET_RATE_LIMIT_BACKOFF_MS = 15_000;
186
193
  export class FleetBootstrapper {
187
194
  store;
188
195
  config;
@@ -199,6 +206,7 @@ export class FleetBootstrapper {
199
206
  autoTestnetFaucet;
200
207
  safeBindingMaxAttempts;
201
208
  safeBindingRetryDelayMs;
209
+ faucetRateLimitBackoffMs;
202
210
  constructor(options = {}) {
203
211
  this.store = new FleetStateStore(options.earningDir);
204
212
  this.chain = options.chain ?? 'base';
@@ -215,6 +223,8 @@ export class FleetBootstrapper {
215
223
  options.safeBindingMaxAttempts ?? DEFAULT_SAFE_BINDING_MAX_ATTEMPTS;
216
224
  this.safeBindingRetryDelayMs =
217
225
  options.safeBindingRetryDelayMs ?? DEFAULT_SAFE_BINDING_RETRY_DELAY_MS;
226
+ this.faucetRateLimitBackoffMs =
227
+ options.faucetRateLimitBackoffMs ?? DEFAULT_FAUCET_RATE_LIMIT_BACKOFF_MS;
218
228
  const dailyOpt = options.masterEthDailyEstimateWei;
219
229
  this.masterEthDailyEstimateWei =
220
230
  dailyOpt !== undefined
@@ -550,8 +560,13 @@ export class FleetBootstrapper {
550
560
  targetWei: requiredMasterEth,
551
561
  balanceWei: systemEth,
552
562
  });
553
- const INTER_DRIP_PAUSE_MS = 1_000;
554
563
  const deadline = this.now() + this.faucetLoopTimeoutMs;
564
+ // requestFunding returns synchronously with a txHash and there is no
565
+ // on-chain confirmation to wait for between drips, so the happy path
566
+ // carries NO fixed inter-drip sleep (issue #984 work unit 1). A transient
567
+ // CDP 429 backs off and retries within the session instead of ending it
568
+ // on the first throttle; the wall-clock deadline stays the safety rail.
569
+ let rateLimitRetries = 0;
555
570
  console.error(`[fleet-bootstrap] Master has ${formatEther(systemEth)} ETH; need ${formatEther(requiredMasterEth)} ETH. ` +
556
571
  `Draining CDP faucet on ${this.chain} via ${rpcHostForDisplay(this.config.rpcUrl)} ` +
557
572
  `(each drip ≈ 0.0001 ETH, up to ${maxFaucetIters} drips or ${Math.round(this.faucetLoopTimeoutMs / 1000)}s, whichever comes first).`);
@@ -564,6 +579,13 @@ export class FleetBootstrapper {
564
579
  }
565
580
  const faucetResult = await this.requestFunding(masterAddress, 'base-sepolia');
566
581
  if (!faucetResult.ok) {
582
+ if (faucetResult.rateLimited && rateLimitRetries < FAUCET_RATE_LIMIT_MAX_RETRIES) {
583
+ rateLimitRetries++;
584
+ console.error(`[fleet-bootstrap] CDP faucet rate-limited after ${i} drips: ${faucetResult.reason}. ` +
585
+ `Backing off (retry ${rateLimitRetries}/${FAUCET_RATE_LIMIT_MAX_RETRIES}).`);
586
+ await new Promise(r => setTimeout(r, this.faucetRateLimitBackoffMs));
587
+ continue;
588
+ }
567
589
  if (faucetResult.rateLimited) {
568
590
  console.error(`[fleet-bootstrap] CDP faucet rate-limited after ${i} drips: ${faucetResult.reason}`);
569
591
  }
@@ -572,14 +594,17 @@ export class FleetBootstrapper {
572
594
  }
573
595
  break;
574
596
  }
575
- await new Promise(r => setTimeout(r, INTER_DRIP_PAUSE_MS));
597
+ // Balance is no longer read once per drip — only every 5th drip and on
598
+ // the final iteration (issue #984 work unit 1). Target/early-exit is
599
+ // only checked on iterations where balance was just refreshed.
600
+ if ((i + 1) % 5 !== 0 && i !== maxFaucetIters - 1) {
601
+ continue;
602
+ }
576
603
  const refreshed = await refreshSystemEth();
577
604
  systemEth = refreshed.system;
578
605
  masterBalance = refreshed.master;
579
- if ((i + 1) % 5 === 0) {
580
- console.error(`[fleet-bootstrap] drip ${i + 1}/${maxFaucetIters} · chain=${this.chain} · rpc=${rpcHostForDisplay(this.config.rpcUrl)} · ` +
581
- `master=${formatEther(masterBalance)} ETH · target=${formatEther(requiredMasterEth)} ETH`);
582
- }
606
+ console.error(`[fleet-bootstrap] drip ${i + 1}/${maxFaucetIters} · chain=${this.chain} · rpc=${rpcHostForDisplay(this.config.rpcUrl)} · ` +
607
+ `master=${formatEther(masterBalance)} ETH · target=${formatEther(requiredMasterEth)} ETH`);
583
608
  if (systemEth >= requiredMasterEth) {
584
609
  console.error(`[fleet-bootstrap] Faucet funding sufficient after ${i + 1} drip${i === 0 ? '' : 's'} ` +
585
610
  `(master=${formatEther(masterBalance)} ETH). Continuing bootstrap...`);
@@ -762,131 +787,14 @@ export class FleetBootstrapper {
762
787
  }
763
788
  }
764
789
  // ── Stage 1: fleet-level identity steps (nghf) ────────────────────────
765
- /** Deterministic Safe predict from the HD-index-1 agent EOA. */
766
790
  async stepFleetSafePredict(state, mnemonic) {
767
- const agentAddress = deriveAgentAddress(mnemonic, 1);
768
- const agentKey = walletPrivateKeyAtIndex(mnemonic, 1);
769
- console.error(`[fleet-bootstrap] Stage 1: predicting fleet Safe (owner=${agentAddress})`);
770
- const { address } = await initPredictedSafe({
771
- rpcUrl: this.config.rpcUrl,
772
- signerKey: agentKey,
773
- owners: [agentAddress],
774
- threshold: 1,
775
- });
776
- void state;
777
- return this.store.patchFleet({ fleet_safe_address: getAddress(address) });
791
+ return stepFleetSafePredictImpl(this.stepContext(), state, mnemonic);
778
792
  }
779
- /** Deploy the predicted fleet Safe. Funds the agent EOA from master if needed. */
780
793
  async stepFleetSafeDeploy(state, mnemonic) {
781
- const agentAddress = deriveAgentAddress(mnemonic, 1);
782
- const agentKey = walletPrivateKeyAtIndex(mnemonic, 1);
783
- const agentSigner = deriveAgentSigner(mnemonic, 1);
784
- const fleetSafe = state.fleet_safe_address;
785
- // Fund agent EOA so it can pay for Safe deploy + setAgentWallet gas.
786
- // 0.01 ETH covers Safe deploy (~250k gas) + register (~80k) + setAgentWallet
787
- // (~200k) at testnet gas prices comfortably. STAGE1_AGENT_ETH is the
788
- // module-level constant used both here and in `stage1MinMasterEth` so the
789
- // gate and the transfer agree (jinn-mono-u34i).
790
- const masterAccount = deriveMasterSigner(mnemonic);
791
- const masterWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, masterAccount);
792
- const agentBalance = await this.publicClient.getBalance({
793
- address: getAddress(agentAddress),
794
- });
795
- if (agentBalance < STAGE1_AGENT_ETH) {
796
- const fundAmount = STAGE1_AGENT_ETH - agentBalance;
797
- console.error(`[fleet-bootstrap] Stage 1: funding fleet agent EOA with ${fundAmount} wei from master`);
798
- const fundHash = await viemSendTransactionWithRetry(masterWallet, this.publicClient, {
799
- account: masterAccount,
800
- to: addr(agentAddress),
801
- value: fundAmount,
802
- });
803
- await waitForTransactionReceiptWithRetry(this.publicClient, fundHash);
804
- }
805
- console.error(`[fleet-bootstrap] Stage 1: deploying fleet Safe at ${fleetSafe}`);
806
- const { safe } = await initPredictedSafe({
807
- rpcUrl: this.config.rpcUrl,
808
- signerKey: agentKey,
809
- owners: [agentAddress],
810
- threshold: 1,
811
- });
812
- const deployTx = await safe.createSafeDeploymentTransaction();
813
- const agentWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, agentSigner);
814
- const deployHash = await viemSendTransactionWithRetry(agentWallet, this.publicClient, {
815
- account: agentSigner,
816
- to: deployTx.to,
817
- value: BigInt(deployTx.value),
818
- data: deployTx.data,
819
- });
820
- const receipt = await waitForTransactionReceiptWithRetry(this.publicClient, deployHash);
821
- if (receipt.status !== 'success') {
822
- throw new Error(`Fleet Safe deployment tx failed: ${deployHash}`);
823
- }
824
- try {
825
- await waitForContractCode(this.publicClient, getAddress(fleetSafe));
826
- }
827
- catch {
828
- throw new Error(`Fleet Safe deployment succeeded but no code at ${fleetSafe}`);
829
- }
830
- console.error(`[fleet-bootstrap] Stage 1: fleet Safe deployed (tx=${deployHash})`);
831
- return this.store.load(this.chain);
794
+ return stepFleetSafeDeployImpl(this.stepContext(), state, mnemonic);
832
795
  }
833
- /** Mint the fleet agentId + bind Safe via setAgentWallet (ERC-1271). */
834
796
  async stepFleetIdentityRegister(state, mnemonic) {
835
- const identityRegistry = this.config.identityRegistry ?? IDENTITY_REGISTRY_ADDRESSES[this.config.chainId];
836
- if (!identityRegistry) {
837
- throw new Error(`IdentityRegistry address not configured for chainId=${this.config.chainId}.`);
838
- }
839
- const fleetSafe = state.fleet_safe_address;
840
- const agentSigner = deriveAgentSigner(mnemonic, 1);
841
- const agentWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, agentSigner);
842
- // Mint agentId — empty agent URI for v0 (matches stepRegisterAgent §6.1 in spec).
843
- const registerData = encodeFunctionData({
844
- abi: IDENTITY_REGISTRY_ABI,
845
- functionName: 'register',
846
- args: [''],
847
- });
848
- console.error(`[fleet-bootstrap] Stage 1: minting fleet agentId ` +
849
- `(IdentityRegistry=${identityRegistry}, agentEOA=${agentSigner.address})`);
850
- const mintTxHash = await viemSendTransactionWithRetry(agentWallet, this.publicClient, {
851
- account: agentSigner,
852
- to: addr(identityRegistry),
853
- data: registerData,
854
- });
855
- const mintReceipt = await waitForTransactionReceiptWithRetry(this.publicClient, mintTxHash);
856
- if (mintReceipt.status !== 'success') {
857
- throw new Error(`Fleet IdentityRegistry.register() failed: ${mintTxHash}`);
858
- }
859
- const fleetAgentId = this.parseAgentIdFromReceipt(mintReceipt, identityRegistry);
860
- if (fleetAgentId === null) {
861
- throw new Error(`Fleet IdentityRegistry.register() succeeded but Registered event missing (tx=${mintTxHash})`);
862
- }
863
- // Persist agentId IMMEDIATELY so a crash between mint and bind doesn't lose it.
864
- await this.store.patchFleet({
865
- fleet_agent_id: fleetAgentId,
866
- fleet_identity_registry: getAddress(identityRegistry),
867
- });
868
- // Bind the Safe via setAgentWallet (ERC-1271).
869
- // Wrapped in the freshly-deployed-Safe retry (jinn-mono-k1ng). The
870
- // pre-k1ng single-attempt version halted bootstrap when the documented
871
- // race fired on the first attempt — exactly the 2026-05-18 canary's
872
- // second-time-around failure mode.
873
- console.error(`[fleet-bootstrap] Stage 1: binding fleet Safe ${fleetSafe} to agentId=${fleetAgentId}`);
874
- const bindResult = await this.bindAgentWalletWithRetry({
875
- identityRegistryAddress: addr(identityRegistry),
876
- agentId: BigInt(fleetAgentId),
877
- safeAddress: addr(fleetSafe),
878
- agentEoaAccount: agentSigner,
879
- agentEoaWalletClient: agentWallet,
880
- publicClient: this.publicClient,
881
- chainId: this.config.chainId,
882
- }, 'Stage 1');
883
- if (!bindResult.ok) {
884
- const bindErr = bindResult.error;
885
- throw new Error(`Fleet setAgentWallet failed after ${this.safeBindingMaxAttempts} attempts: ${bindErr.shortMessage}` +
886
- (bindErr.revertReason ? ` (revert: ${bindErr.revertReason})` : ''));
887
- }
888
- console.error(`[fleet-bootstrap] Stage 1: setAgentWallet succeeded (tx=${bindResult.txHash})`);
889
- return this.store.patchFleet({ fleet_stage: 'stage1' });
797
+ return stepFleetIdentityRegisterImpl(this.stepContext(), state, mnemonic);
890
798
  }
891
799
  // ── Phase 2: Per-service bootstrap ───────────────────────────────────
892
800
  async bootstrapService(state, mnemonic, index) {
@@ -1047,25 +955,23 @@ export class FleetBootstrapper {
1047
955
  throw error;
1048
956
  }
1049
957
  if (onChainState === 2) {
1050
- console.error(`[jinn-earning] Noticed service ${svc.service_id} (fleet index ${index}) evicted on-chain; running distributor reStake to restake.`);
1051
- // #789: a startup reStake can revert (e.g. NotEnoughTimeStaked when the
1052
- // service was re-staked < minStakingDuration ago) or fail transiently.
1053
- // Treat it as non-fatal so the daemon still launches work delivery and
1054
- // JINN claims are decoupled from OLAS staking (JinnDistributor mints on
1055
- // delivered-work counts, not stake state), so a failed startup reStake
1056
- // must not block the operator from earning. The standalone EvictionLoop
1057
- // retries on its own cadence when enabled; when staking is intentionally
1058
- // dropped (evictionCheckIntervalMs=0) this simply leaves the service
1059
- // evicted, which does not affect JINN earning.
1060
- try {
1061
- state = await this.recoverEvictedService(state, mnemonic, index);
1062
- svc = state.services.find(s => s.index === index);
1063
- }
1064
- catch (err) {
1065
- console.error(`[jinn-earning] Service ${svc.service_id} (fleet index ${index}) startup reStake failed (non-fatal); ` +
1066
- `continuing launch and deferring to EvictionLoop if enabled: ` +
1067
- `${err instanceof Error ? err.message : String(err)}`);
1068
- }
958
+ // Do NOT eagerly reStake at startup. Re-staking is orthogonal to the
959
+ // protocol loop and to earning (OLAS staking rewards accrue from
960
+ // delivered-work activity counts, not from re-stake liveness), and an inline reStake
961
+ // here broadcasts from the agent EOA during bootcontending with
962
+ // other agent-EOA work that runs in the same window (e.g. a launch's
963
+ // IdentityRegistry.setMetadata, which then reverts and strands the
964
+ // launch at `launching`). #773 removed the inline reStake from the
965
+ // mech-adapter solve path with exactly this reasoning ("staking is
966
+ // orthogonal to the loop re-staking is handled out-of-band by the
967
+ // background EvictionLoop"); this completes #773 for the startup-resume
968
+ // path it missed. The throttled EvictionLoop (#917) restakes on its own
969
+ // cadence when enabled; when staking is intentionally dropped
970
+ // (evictionCheckIntervalMs=0) the service simply stays evicted, which
971
+ // does not affect earning (#789).
972
+ console.log(`[jinn-earning] Service ${svc.service_id} (fleet index ${index}) is evicted on-chain; ` +
973
+ `NOT reStaking inline at startup deferring to the background EvictionLoop ` +
974
+ `(staking is orthogonal to earning; #773/#789/#917). Daemon launch continues.`);
1069
975
  }
1070
976
  }
1071
977
  if (isOperationalServiceStep(svc.step)) {
@@ -1870,6 +1776,38 @@ export class FleetBootstrapper {
1870
1776
  return this.store.updateService(index, { step: 'staked' });
1871
1777
  }
1872
1778
  // ── Helpers ──────────────────────────────────────────────────────────
1779
+ /**
1780
+ * Fresh dependency bag for an extracted step. Rebuilt on every call so a
1781
+ * spy installed after construction is honoured; the spied helper arrows
1782
+ * dispatch through `this` at call time (see plan Binding rule).
1783
+ */
1784
+ stepContext() {
1785
+ return {
1786
+ store: this.store,
1787
+ config: this.config,
1788
+ publicClient: this.publicClient,
1789
+ chain: this.chain,
1790
+ stakingMode: this.stakingMode,
1791
+ targetServices: this.targetServices,
1792
+ debug: this.debug,
1793
+ env: this.env,
1794
+ safeBindingMaxAttempts: this.safeBindingMaxAttempts,
1795
+ safeBindingRetryDelayMs: this.safeBindingRetryDelayMs,
1796
+ bindAgentWalletWithRetry: (args, label) => this.bindAgentWalletWithRetry(args, label),
1797
+ getServiceState: (serviceId) => this.getServiceState(serviceId),
1798
+ waitForSuccessfulTx: (txHash, label) => this.waitForSuccessfulTx(txHash, label),
1799
+ firstServiceUpdate: (index, patch) => this.firstServiceUpdate(index, patch),
1800
+ stakingAddressForService: (svc) => this.stakingAddressForService(svc),
1801
+ shouldPreserveExistingSetup: (svc) => this.shouldPreserveExistingSetup(svc),
1802
+ parseServiceIdFromReceipt: (receipt) => this.parseServiceIdFromReceipt(receipt),
1803
+ parseMultisigFromReceipt: (receipt) => this.parseMultisigFromReceipt(receipt),
1804
+ getStakingState: (serviceId, stakingAddress) => this.getStakingState(serviceId, stakingAddress),
1805
+ getBondTokenBalance: (address) => this.getBondTokenBalance(address),
1806
+ parseAgentIdFromReceipt: (receipt, identityRegistry) => this.parseAgentIdFromReceipt(receipt, identityRegistry),
1807
+ stolasPreflightCheck: () => this.stolasPreflightCheck(),
1808
+ sweepAbandonedSafeForService: (state, mnemonic, serviceIndex, abandonedSafeAddress) => this.sweepAbandonedSafeForService(state, mnemonic, serviceIndex, abandonedSafeAddress),
1809
+ };
1810
+ }
1873
1811
  async getBondTokenBalance(address) {
1874
1812
  return this.publicClient.readContract({
1875
1813
  address: this.config.olasToken,
@@ -1944,76 +1882,37 @@ export class FleetBootstrapper {
1944
1882
  }));
1945
1883
  }
1946
1884
  async parseServiceIdFromReceipt(receipt) {
1947
- const createServiceTopic = EVENT_TOPICS.CreateService;
1948
- const serviceRegistryAddress = this.config.serviceRegistry.toLowerCase();
1949
- for (const log of receipt.logs) {
1950
- if (log.address.toLowerCase() !== serviceRegistryAddress ||
1951
- log.topics[0] !== createServiceTopic) {
1952
- continue;
1953
- }
1954
- try {
1955
- const decoded = decodeEventLog({
1956
- abi: SERVICE_REGISTRY_L2_ABI,
1957
- data: log.data,
1958
- topics: log.topics,
1959
- strict: false,
1960
- });
1961
- if (decoded.eventName === 'CreateService' && 'serviceId' in decoded.args) {
1962
- return Number(decoded.args.serviceId);
1963
- }
1964
- }
1965
- catch {
1966
- // Not a matching event
1967
- }
1968
- }
1969
- return null;
1885
+ return parseServiceIdFromReceiptImpl(receipt, this.config.serviceRegistry);
1970
1886
  }
1971
1887
  parseMultisigFromReceipt(receipt) {
1972
- const topic = EVENT_TOPICS.CreateMultisigWithAgents;
1973
- for (const log of receipt.logs) {
1974
- const t0 = log.topics[0];
1975
- if (t0 === topic && log.topics.length >= 3) {
1976
- return getAddress(('0x' + log.topics[2].slice(26)));
1977
- }
1978
- }
1979
- return null;
1888
+ return parseMultisigFromReceiptImpl(receipt);
1980
1889
  }
1981
- /**
1982
- * Extract `agentId` from an `IdentityRegistry.Registered` log emitted in
1983
- * the receipt. Filters by `(address, topic[0])` first to avoid colliding
1984
- * with any other contract that happens to share the event signature.
1985
- *
1986
- * Returns the agentId as a decimal string (uint256) so it round-trips
1987
- * cleanly through JSON-persisted EarningState.
1988
- */
1989
1890
  parseAgentIdFromReceipt(receipt, identityRegistry) {
1990
- const topic = EVENT_TOPICS.Registered;
1991
- const target = identityRegistry.toLowerCase();
1992
- for (const log of receipt.logs) {
1993
- if (log.address.toLowerCase() !== target)
1994
- continue;
1995
- if (log.topics[0] !== topic)
1996
- continue;
1997
- try {
1998
- const decoded = decodeEventLog({
1999
- abi: IDENTITY_REGISTRY_ABI,
2000
- data: log.data,
2001
- topics: log.topics,
2002
- strict: false,
2003
- });
2004
- if (decoded.eventName === 'Registered' && 'agentId' in decoded.args) {
2005
- return decoded.args.agentId.toString();
2006
- }
2007
- }
2008
- catch {
2009
- // Not a matching event
2010
- }
2011
- }
2012
- return null;
1891
+ return parseAgentIdFromReceiptImpl(receipt, identityRegistry);
2013
1892
  }
2014
1893
  }
2015
1894
  /** @deprecated Use FleetBootstrapper */
2016
1895
  export const EarningBootstrapper = FleetBootstrapper;
1896
+ /**
1897
+ * Inspect a mined reStake receipt and log the correct outcome (#916).
1898
+ *
1899
+ * Pure + I/O-free so it can be unit-tested without a chain client. On a
1900
+ * `success` receipt it logs `reStake confirmed` at log level. On a `reverted`
1901
+ * receipt it logs `reStake reverted` at debug level (a benign substrate event —
1902
+ * the NotEnoughTimeStaked window / stale-RPC race; staking is non-load-bearing,
1903
+ * DR-2026-06-04 / #1060) with the decoded reason if the caller could obtain one,
1904
+ * and still throws so the recovery attempt re-queues (#916 control flow intact).
1905
+ */
1906
+ export function handleReStakeReceipt(args) {
1907
+ const { receipt, serviceDisplayIndex, reStakeHash, revertReason } = args;
1908
+ if (receipt.status === 'success') {
1909
+ console.log(`[eviction-recovery] Service ${serviceDisplayIndex}: reStake confirmed (tx: ${reStakeHash})`);
1910
+ return;
1911
+ }
1912
+ const msg = `[eviction-recovery] Service ${serviceDisplayIndex}: reStake reverted (tx: ${reStakeHash}, reason: ${revertReason ?? 'unavailable'})`;
1913
+ console.debug(msg);
1914
+ throw new Error(msg);
1915
+ }
2017
1916
  /**
2018
1917
  * Re-stake an evicted service by calling `distributor.reStake(stakingProxy, serviceId)`.
2019
1918
  *
@@ -2034,7 +1933,7 @@ export async function recoverEvictedService(opts) {
2034
1933
  functionName: 'reStake',
2035
1934
  args: [addr(stakingAddress), BigInt(serviceId)],
2036
1935
  });
2037
- console.error(`[eviction-recovery] Service ${serviceDisplayIndex}: calling distributor.reStake() for evicted service ${serviceId}`);
1936
+ console.debug(`[eviction-recovery] Service ${serviceDisplayIndex}: calling distributor.reStake() for evicted service ${serviceId}`);
2038
1937
  let reStakeHash;
2039
1938
  try {
2040
1939
  reStakeHash = await viemSendTransactionWithRetry(masterWallet, publicClient, {
@@ -2055,9 +1954,21 @@ export async function recoverEvictedService(opts) {
2055
1954
  throw err;
2056
1955
  }
2057
1956
  const receipt = await waitForTransactionReceiptWithRetry(publicClient, reStakeHash);
1957
+ let revertReason;
2058
1958
  if (receipt.status !== 'success') {
2059
- throw new Error(`reStake failed for service ${serviceDisplayIndex}: ${reStakeHash}`);
1959
+ // Best-effort: replay the call at the mined block to decode the revert.
1960
+ try {
1961
+ await publicClient.call({
1962
+ account: masterAccount,
1963
+ to: addr(distributorAddress),
1964
+ data: reStakeData,
1965
+ blockNumber: receipt.blockNumber,
1966
+ });
1967
+ }
1968
+ catch (err) {
1969
+ revertReason = formatKnownRevert(err) ?? flattenErrorMessage(err);
1970
+ }
2060
1971
  }
2061
- console.error(`[eviction-recovery] Service ${serviceDisplayIndex}: reStake confirmed (tx: ${reStakeHash})`);
1972
+ handleReStakeReceipt({ receipt, serviceDisplayIndex, reStakeHash, revertReason });
2062
1973
  }
2063
1974
  //# sourceMappingURL=bootstrap.js.map