pulseed 0.5.4 → 0.6.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 (561) hide show
  1. package/README.md +13 -9
  2. package/dist/adapters/datasources/artifact-metric-datasource.d.ts +18 -0
  3. package/dist/adapters/datasources/artifact-metric-datasource.d.ts.map +1 -0
  4. package/dist/adapters/datasources/artifact-metric-datasource.js +592 -0
  5. package/dist/adapters/datasources/artifact-metric-datasource.js.map +1 -0
  6. package/dist/adapters/types/mcp.d.ts +6 -6
  7. package/dist/base/types/goal-activation.d.ts +14 -2
  8. package/dist/base/types/goal-activation.d.ts.map +1 -1
  9. package/dist/base/types/goal-activation.js +4 -0
  10. package/dist/base/types/goal-activation.js.map +1 -1
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/interface/chat/chat-runner-commands.d.ts +6 -0
  16. package/dist/interface/chat/chat-runner-commands.d.ts.map +1 -1
  17. package/dist/interface/chat/chat-runner-commands.js +94 -2
  18. package/dist/interface/chat/chat-runner-commands.js.map +1 -1
  19. package/dist/interface/chat/chat-runner-event-bridge.d.ts +8 -1
  20. package/dist/interface/chat/chat-runner-event-bridge.d.ts.map +1 -1
  21. package/dist/interface/chat/chat-runner-event-bridge.js +69 -3
  22. package/dist/interface/chat/chat-runner-event-bridge.js.map +1 -1
  23. package/dist/interface/chat/chat-runner-routes.d.ts.map +1 -1
  24. package/dist/interface/chat/chat-runner-routes.js +23 -7
  25. package/dist/interface/chat/chat-runner-routes.js.map +1 -1
  26. package/dist/interface/chat/chat-runner-support.d.ts +25 -1
  27. package/dist/interface/chat/chat-runner-support.d.ts.map +1 -1
  28. package/dist/interface/chat/chat-runner-support.js +66 -12
  29. package/dist/interface/chat/chat-runner-support.js.map +1 -1
  30. package/dist/interface/chat/chat-runner.d.ts.map +1 -1
  31. package/dist/interface/chat/chat-runner.js +38 -8
  32. package/dist/interface/chat/chat-runner.js.map +1 -1
  33. package/dist/interface/chat/cross-platform-session.d.ts.map +1 -1
  34. package/dist/interface/chat/cross-platform-session.js +13 -1
  35. package/dist/interface/chat/cross-platform-session.js.map +1 -1
  36. package/dist/interface/chat/event-subscriber.d.ts.map +1 -1
  37. package/dist/interface/chat/event-subscriber.js +20 -0
  38. package/dist/interface/chat/event-subscriber.js.map +1 -1
  39. package/dist/interface/chat/failure-recovery.d.ts +43 -1
  40. package/dist/interface/chat/failure-recovery.d.ts.map +1 -1
  41. package/dist/interface/chat/failure-recovery.js +259 -89
  42. package/dist/interface/chat/failure-recovery.js.map +1 -1
  43. package/dist/interface/chat/ingress-router.d.ts +2 -1
  44. package/dist/interface/chat/ingress-router.d.ts.map +1 -1
  45. package/dist/interface/chat/ingress-router.js +2 -3
  46. package/dist/interface/chat/ingress-router.js.map +1 -1
  47. package/dist/interface/chat/tend-command.js +1 -0
  48. package/dist/interface/chat/tend-command.js.map +1 -1
  49. package/dist/interface/cli/cli-command-registry.d.ts.map +1 -1
  50. package/dist/interface/cli/cli-command-registry.js +19 -3
  51. package/dist/interface/cli/cli-command-registry.js.map +1 -1
  52. package/dist/interface/cli/commands/daemon-shared.d.ts +2 -1
  53. package/dist/interface/cli/commands/daemon-shared.d.ts.map +1 -1
  54. package/dist/interface/cli/commands/daemon-shared.js +33 -1
  55. package/dist/interface/cli/commands/daemon-shared.js.map +1 -1
  56. package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
  57. package/dist/interface/cli/commands/daemon.js +59 -8
  58. package/dist/interface/cli/commands/daemon.js.map +1 -1
  59. package/dist/interface/cli/commands/goal-read.d.ts.map +1 -1
  60. package/dist/interface/cli/commands/goal-read.js +10 -3
  61. package/dist/interface/cli/commands/goal-read.js.map +1 -1
  62. package/dist/interface/cli/commands/notify.d.ts.map +1 -1
  63. package/dist/interface/cli/commands/notify.js +7 -1
  64. package/dist/interface/cli/commands/notify.js.map +1 -1
  65. package/dist/interface/cli/commands/run.d.ts.map +1 -1
  66. package/dist/interface/cli/commands/run.js +29 -0
  67. package/dist/interface/cli/commands/run.js.map +1 -1
  68. package/dist/interface/cli/commands/runtime.d.ts +1 -1
  69. package/dist/interface/cli/commands/runtime.d.ts.map +1 -1
  70. package/dist/interface/cli/commands/runtime.js +407 -2
  71. package/dist/interface/cli/commands/runtime.js.map +1 -1
  72. package/dist/interface/cli/data-source-bootstrap.d.ts.map +1 -1
  73. package/dist/interface/cli/data-source-bootstrap.js +25 -12
  74. package/dist/interface/cli/data-source-bootstrap.js.map +1 -1
  75. package/dist/interface/cli/setup.d.ts.map +1 -1
  76. package/dist/interface/cli/setup.js +14 -0
  77. package/dist/interface/cli/setup.js.map +1 -1
  78. package/dist/interface/cli/utils/loop-runner.d.ts.map +1 -1
  79. package/dist/interface/cli/utils/loop-runner.js +2 -1
  80. package/dist/interface/cli/utils/loop-runner.js.map +1 -1
  81. package/dist/interface/cli/utils.d.ts.map +1 -1
  82. package/dist/interface/cli/utils.js +8 -1
  83. package/dist/interface/cli/utils.js.map +1 -1
  84. package/dist/interface/tui/app.d.ts +4 -1
  85. package/dist/interface/tui/app.d.ts.map +1 -1
  86. package/dist/interface/tui/app.js +268 -10
  87. package/dist/interface/tui/app.js.map +1 -1
  88. package/dist/interface/tui/chat-surface.d.ts +2 -0
  89. package/dist/interface/tui/chat-surface.d.ts.map +1 -1
  90. package/dist/interface/tui/chat-surface.js +3 -0
  91. package/dist/interface/tui/chat-surface.js.map +1 -1
  92. package/dist/interface/tui/dashboard.d.ts +37 -1
  93. package/dist/interface/tui/dashboard.d.ts.map +1 -1
  94. package/dist/interface/tui/dashboard.js +264 -1
  95. package/dist/interface/tui/dashboard.js.map +1 -1
  96. package/dist/interface/tui/entry-deps.d.ts +3 -1
  97. package/dist/interface/tui/entry-deps.d.ts.map +1 -1
  98. package/dist/interface/tui/entry-deps.js +19 -1
  99. package/dist/interface/tui/entry-deps.js.map +1 -1
  100. package/dist/interface/tui/entry.d.ts.map +1 -1
  101. package/dist/interface/tui/entry.js +4 -2
  102. package/dist/interface/tui/entry.js.map +1 -1
  103. package/dist/interface/tui/intent-recognizer.d.ts +8 -3
  104. package/dist/interface/tui/intent-recognizer.d.ts.map +1 -1
  105. package/dist/interface/tui/intent-recognizer.js +74 -68
  106. package/dist/interface/tui/intent-recognizer.js.map +1 -1
  107. package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.d.ts.map +1 -1
  108. package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js +41 -0
  109. package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js.map +1 -1
  110. package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts +1 -1
  111. package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.d.ts +1 -1
  112. package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.d.ts.map +1 -1
  113. package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.js +3 -2
  114. package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.js.map +1 -1
  115. package/dist/orchestrator/execution/agent-loop/core-phase-runner.d.ts +1 -1
  116. package/dist/orchestrator/execution/agent-loop/core-phase-runner.d.ts.map +1 -1
  117. package/dist/orchestrator/execution/agent-loop/core-phase-runner.js +10 -1
  118. package/dist/orchestrator/execution/agent-loop/core-phase-runner.js.map +1 -1
  119. package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.d.ts +2 -0
  120. package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.d.ts.map +1 -1
  121. package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.js +4 -0
  122. package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.js.map +1 -1
  123. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts +8 -8
  124. package/dist/orchestrator/execution/task/task-generation.d.ts +3 -1
  125. package/dist/orchestrator/execution/task/task-generation.d.ts.map +1 -1
  126. package/dist/orchestrator/execution/task/task-generation.js +17 -2
  127. package/dist/orchestrator/execution/task/task-generation.js.map +1 -1
  128. package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts +5 -1
  129. package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts.map +1 -1
  130. package/dist/orchestrator/execution/task/task-lifecycle-runner.js +9 -5
  131. package/dist/orchestrator/execution/task/task-lifecycle-runner.js.map +1 -1
  132. package/dist/orchestrator/execution/task/task-lifecycle.d.ts +10 -1
  133. package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
  134. package/dist/orchestrator/execution/task/task-lifecycle.js +108 -7
  135. package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
  136. package/dist/orchestrator/execution/task/task-prompt-builder.d.ts +2 -1
  137. package/dist/orchestrator/execution/task/task-prompt-builder.d.ts.map +1 -1
  138. package/dist/orchestrator/execution/task/task-prompt-builder.js +4 -2
  139. package/dist/orchestrator/execution/task/task-prompt-builder.js.map +1 -1
  140. package/dist/orchestrator/execution/types/pipeline.d.ts +6 -6
  141. package/dist/orchestrator/goal/types/goal.d.ts +282 -0
  142. package/dist/orchestrator/goal/types/goal.d.ts.map +1 -1
  143. package/dist/orchestrator/goal/types/goal.js +20 -0
  144. package/dist/orchestrator/goal/types/goal.js.map +1 -1
  145. package/dist/orchestrator/loop/core-loop/contracts.d.ts +46 -3
  146. package/dist/orchestrator/loop/core-loop/contracts.d.ts.map +1 -1
  147. package/dist/orchestrator/loop/core-loop/contracts.js.map +1 -1
  148. package/dist/orchestrator/loop/core-loop/decision-engine.d.ts.map +1 -1
  149. package/dist/orchestrator/loop/core-loop/decision-engine.js +4 -0
  150. package/dist/orchestrator/loop/core-loop/decision-engine.js.map +1 -1
  151. package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.d.ts +48 -0
  152. package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.d.ts.map +1 -0
  153. package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.js +377 -0
  154. package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.js.map +1 -0
  155. package/dist/orchestrator/loop/core-loop/evidence-ledger.js +1 -1
  156. package/dist/orchestrator/loop/core-loop/evidence-ledger.js.map +1 -1
  157. package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts +1 -0
  158. package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts.map +1 -1
  159. package/dist/orchestrator/loop/core-loop/iteration-kernel.js +492 -1
  160. package/dist/orchestrator/loop/core-loop/iteration-kernel.js.map +1 -1
  161. package/dist/orchestrator/loop/core-loop/phase-policy.d.ts.map +1 -1
  162. package/dist/orchestrator/loop/core-loop/phase-policy.js +35 -0
  163. package/dist/orchestrator/loop/core-loop/phase-policy.js.map +1 -1
  164. package/dist/orchestrator/loop/core-loop/phase-runtime.d.ts +2 -0
  165. package/dist/orchestrator/loop/core-loop/phase-runtime.d.ts.map +1 -1
  166. package/dist/orchestrator/loop/core-loop/phase-runtime.js +43 -2
  167. package/dist/orchestrator/loop/core-loop/phase-runtime.js.map +1 -1
  168. package/dist/orchestrator/loop/core-loop/phase-specs.d.ts +969 -2
  169. package/dist/orchestrator/loop/core-loop/phase-specs.d.ts.map +1 -1
  170. package/dist/orchestrator/loop/core-loop/phase-specs.js +198 -0
  171. package/dist/orchestrator/loop/core-loop/phase-specs.js.map +1 -1
  172. package/dist/orchestrator/loop/core-loop/public-research.d.ts +32 -0
  173. package/dist/orchestrator/loop/core-loop/public-research.d.ts.map +1 -0
  174. package/dist/orchestrator/loop/core-loop/public-research.js +112 -0
  175. package/dist/orchestrator/loop/core-loop/public-research.js.map +1 -0
  176. package/dist/orchestrator/loop/core-loop/task-cycle-stall.d.ts.map +1 -1
  177. package/dist/orchestrator/loop/core-loop/task-cycle-stall.js +141 -5
  178. package/dist/orchestrator/loop/core-loop/task-cycle-stall.js.map +1 -1
  179. package/dist/orchestrator/loop/core-loop/task-cycle.d.ts +4 -0
  180. package/dist/orchestrator/loop/core-loop/task-cycle.d.ts.map +1 -1
  181. package/dist/orchestrator/loop/core-loop/task-cycle.js +7 -0
  182. package/dist/orchestrator/loop/core-loop/task-cycle.js.map +1 -1
  183. package/dist/orchestrator/loop/core-loop.d.ts +15 -5
  184. package/dist/orchestrator/loop/core-loop.d.ts.map +1 -1
  185. package/dist/orchestrator/loop/core-loop.js +283 -17
  186. package/dist/orchestrator/loop/core-loop.js.map +1 -1
  187. package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
  188. package/dist/orchestrator/loop/loop-report-helper.js +4 -0
  189. package/dist/orchestrator/loop/loop-report-helper.js.map +1 -1
  190. package/dist/orchestrator/loop/loop-result-types.d.ts +20 -1
  191. package/dist/orchestrator/loop/loop-result-types.d.ts.map +1 -1
  192. package/dist/orchestrator/loop/loop-result-types.js.map +1 -1
  193. package/dist/orchestrator/loop/post-loop-hooks.d.ts +1 -0
  194. package/dist/orchestrator/loop/post-loop-hooks.d.ts.map +1 -1
  195. package/dist/orchestrator/loop/post-loop-hooks.js +34 -1
  196. package/dist/orchestrator/loop/post-loop-hooks.js.map +1 -1
  197. package/dist/orchestrator/loop/run-policy.d.ts +10 -0
  198. package/dist/orchestrator/loop/run-policy.d.ts.map +1 -0
  199. package/dist/orchestrator/loop/run-policy.js +30 -0
  200. package/dist/orchestrator/loop/run-policy.js.map +1 -0
  201. package/dist/orchestrator/strategy/divergent-exploration.d.ts +37 -0
  202. package/dist/orchestrator/strategy/divergent-exploration.d.ts.map +1 -0
  203. package/dist/orchestrator/strategy/divergent-exploration.js +324 -0
  204. package/dist/orchestrator/strategy/divergent-exploration.js.map +1 -0
  205. package/dist/orchestrator/strategy/strategy-helpers.d.ts +108 -0
  206. package/dist/orchestrator/strategy/strategy-helpers.d.ts.map +1 -1
  207. package/dist/orchestrator/strategy/strategy-helpers.js +34 -2
  208. package/dist/orchestrator/strategy/strategy-helpers.js.map +1 -1
  209. package/dist/orchestrator/strategy/strategy-manager-base.d.ts +20 -1
  210. package/dist/orchestrator/strategy/strategy-manager-base.d.ts.map +1 -1
  211. package/dist/orchestrator/strategy/strategy-manager-base.js +71 -6
  212. package/dist/orchestrator/strategy/strategy-manager-base.js.map +1 -1
  213. package/dist/orchestrator/strategy/types/cross-portfolio.d.ts +2 -2
  214. package/dist/orchestrator/strategy/types/strategy.d.ts +364 -0
  215. package/dist/orchestrator/strategy/types/strategy.d.ts.map +1 -1
  216. package/dist/orchestrator/strategy/types/strategy.js +43 -0
  217. package/dist/orchestrator/strategy/types/strategy.js.map +1 -1
  218. package/dist/platform/dream/dream-activation.d.ts +1 -1
  219. package/dist/platform/dream/dream-event-workflows.d.ts +6 -6
  220. package/dist/platform/dream/dream-types.d.ts +91 -91
  221. package/dist/platform/drive/metric-history.d.ts +61 -0
  222. package/dist/platform/drive/metric-history.d.ts.map +1 -0
  223. package/dist/platform/drive/metric-history.js +206 -0
  224. package/dist/platform/drive/metric-history.js.map +1 -0
  225. package/dist/platform/drive/progress-predictor.d.ts +7 -0
  226. package/dist/platform/drive/progress-predictor.d.ts.map +1 -1
  227. package/dist/platform/drive/progress-predictor.js +23 -0
  228. package/dist/platform/drive/progress-predictor.js.map +1 -1
  229. package/dist/platform/drive/stall-detector.d.ts +3 -1
  230. package/dist/platform/drive/stall-detector.d.ts.map +1 -1
  231. package/dist/platform/drive/stall-detector.js +40 -1
  232. package/dist/platform/drive/stall-detector.js.map +1 -1
  233. package/dist/platform/drive/types/satisficing.d.ts +2 -2
  234. package/dist/platform/drive/types/stall.d.ts +4 -0
  235. package/dist/platform/drive/types/stall.d.ts.map +1 -1
  236. package/dist/platform/drive/types/stall.js +1 -0
  237. package/dist/platform/drive/types/stall.js.map +1 -1
  238. package/dist/platform/knowledge/types/learning.d.ts +2 -2
  239. package/dist/platform/observation/data-source-adapter.d.ts +1 -0
  240. package/dist/platform/observation/data-source-adapter.d.ts.map +1 -1
  241. package/dist/platform/observation/data-source-adapter.js.map +1 -1
  242. package/dist/platform/observation/observation-datasource.d.ts.map +1 -1
  243. package/dist/platform/observation/observation-datasource.js +2 -0
  244. package/dist/platform/observation/observation-datasource.js.map +1 -1
  245. package/dist/platform/observation/types/data-source.d.ts +153 -9
  246. package/dist/platform/observation/types/data-source.d.ts.map +1 -1
  247. package/dist/platform/observation/types/data-source.js +13 -1
  248. package/dist/platform/observation/types/data-source.js.map +1 -1
  249. package/dist/platform/soil/contracts.d.ts +65 -65
  250. package/dist/platform/soil/importer.d.ts +6 -6
  251. package/dist/platform/soil/types.d.ts +8 -8
  252. package/dist/platform/time/deadline-finalization.d.ts +57 -0
  253. package/dist/platform/time/deadline-finalization.d.ts.map +1 -0
  254. package/dist/platform/time/deadline-finalization.js +136 -0
  255. package/dist/platform/time/deadline-finalization.js.map +1 -0
  256. package/dist/platform/time/execution-mode.d.ts +29 -0
  257. package/dist/platform/time/execution-mode.d.ts.map +1 -0
  258. package/dist/platform/time/execution-mode.js +84 -0
  259. package/dist/platform/time/execution-mode.js.map +1 -0
  260. package/dist/platform/traits/types/curiosity.d.ts +9 -9
  261. package/dist/platform/traits/types/guardrail.d.ts +6 -6
  262. package/dist/reporting/report-formatters.d.ts.map +1 -1
  263. package/dist/reporting/report-formatters.js +67 -2
  264. package/dist/reporting/report-formatters.js.map +1 -1
  265. package/dist/reporting/reporting-engine.d.ts.map +1 -1
  266. package/dist/reporting/reporting-engine.js +3 -1
  267. package/dist/reporting/reporting-engine.js.map +1 -1
  268. package/dist/reporting/reporting-types.d.ts +4 -0
  269. package/dist/reporting/reporting-types.d.ts.map +1 -1
  270. package/dist/reporting/types/report.d.ts +59 -0
  271. package/dist/reporting/types/report.d.ts.map +1 -1
  272. package/dist/reporting/types/report.js +9 -0
  273. package/dist/reporting/types/report.js.map +1 -1
  274. package/dist/runtime/command-dispatcher.d.ts +2 -0
  275. package/dist/runtime/command-dispatcher.d.ts.map +1 -1
  276. package/dist/runtime/command-dispatcher.js +16 -0
  277. package/dist/runtime/command-dispatcher.js.map +1 -1
  278. package/dist/runtime/confirmation-decision.d.ts +94 -0
  279. package/dist/runtime/confirmation-decision.d.ts.map +1 -0
  280. package/dist/runtime/confirmation-decision.js +109 -0
  281. package/dist/runtime/confirmation-decision.js.map +1 -0
  282. package/dist/runtime/control/daemon-runtime-control-executor.d.ts.map +1 -1
  283. package/dist/runtime/control/daemon-runtime-control-executor.js +31 -1
  284. package/dist/runtime/control/daemon-runtime-control-executor.js.map +1 -1
  285. package/dist/runtime/control/runtime-control-intent.d.ts +9 -1
  286. package/dist/runtime/control/runtime-control-intent.d.ts.map +1 -1
  287. package/dist/runtime/control/runtime-control-intent.js +82 -16
  288. package/dist/runtime/control/runtime-control-intent.js.map +1 -1
  289. package/dist/runtime/control/runtime-control-service.d.ts +35 -1
  290. package/dist/runtime/control/runtime-control-service.d.ts.map +1 -1
  291. package/dist/runtime/control/runtime-control-service.js +285 -5
  292. package/dist/runtime/control/runtime-control-service.js.map +1 -1
  293. package/dist/runtime/daemon/client.d.ts +12 -0
  294. package/dist/runtime/daemon/client.d.ts.map +1 -1
  295. package/dist/runtime/daemon/client.js +9 -0
  296. package/dist/runtime/daemon/client.js.map +1 -1
  297. package/dist/runtime/daemon/runner-commands.d.ts +6 -2
  298. package/dist/runtime/daemon/runner-commands.d.ts.map +1 -1
  299. package/dist/runtime/daemon/runner-commands.js +237 -1
  300. package/dist/runtime/daemon/runner-commands.js.map +1 -1
  301. package/dist/runtime/daemon/runner-goal-cycle.d.ts.map +1 -1
  302. package/dist/runtime/daemon/runner-goal-cycle.js +59 -1
  303. package/dist/runtime/daemon/runner-goal-cycle.js.map +1 -1
  304. package/dist/runtime/daemon/runner-startup.d.ts.map +1 -1
  305. package/dist/runtime/daemon/runner-startup.js +12 -2
  306. package/dist/runtime/daemon/runner-startup.js.map +1 -1
  307. package/dist/runtime/daemon/runner.d.ts +4 -0
  308. package/dist/runtime/daemon/runner.d.ts.map +1 -1
  309. package/dist/runtime/daemon/runner.js +14 -1
  310. package/dist/runtime/daemon/runner.js.map +1 -1
  311. package/dist/runtime/daemon/runtime-ownership.d.ts +9 -0
  312. package/dist/runtime/daemon/runtime-ownership.d.ts.map +1 -1
  313. package/dist/runtime/daemon/runtime-ownership.js +248 -1
  314. package/dist/runtime/daemon/runtime-ownership.js.map +1 -1
  315. package/dist/runtime/dream-sidecar-review.d.ts +92 -0
  316. package/dist/runtime/dream-sidecar-review.d.ts.map +1 -0
  317. package/dist/runtime/dream-sidecar-review.js +495 -0
  318. package/dist/runtime/dream-sidecar-review.js.map +1 -0
  319. package/dist/runtime/event/server-command-handler.d.ts +2 -4
  320. package/dist/runtime/event/server-command-handler.d.ts.map +1 -1
  321. package/dist/runtime/event/server-command-handler.js +36 -6
  322. package/dist/runtime/event/server-command-handler.js.map +1 -1
  323. package/dist/runtime/event/server-snapshot-reader.d.ts +15 -1
  324. package/dist/runtime/event/server-snapshot-reader.d.ts.map +1 -1
  325. package/dist/runtime/event/server-snapshot-reader.js +66 -2
  326. package/dist/runtime/event/server-snapshot-reader.js.map +1 -1
  327. package/dist/runtime/event/server-types.d.ts +7 -0
  328. package/dist/runtime/event/server-types.d.ts.map +1 -1
  329. package/dist/runtime/event/server.d.ts +5 -0
  330. package/dist/runtime/event/server.d.ts.map +1 -1
  331. package/dist/runtime/event/server.js +43 -11
  332. package/dist/runtime/event/server.js.map +1 -1
  333. package/dist/runtime/evidence-answer.d.ts +41 -0
  334. package/dist/runtime/evidence-answer.d.ts.map +1 -0
  335. package/dist/runtime/evidence-answer.js +366 -0
  336. package/dist/runtime/evidence-answer.js.map +1 -0
  337. package/dist/runtime/executor/goal-worker.d.ts +4 -1
  338. package/dist/runtime/executor/goal-worker.d.ts.map +1 -1
  339. package/dist/runtime/executor/goal-worker.js +5 -1
  340. package/dist/runtime/executor/goal-worker.js.map +1 -1
  341. package/dist/runtime/executor/loop-supervisor.d.ts +4 -0
  342. package/dist/runtime/executor/loop-supervisor.d.ts.map +1 -1
  343. package/dist/runtime/executor/loop-supervisor.js +35 -6
  344. package/dist/runtime/executor/loop-supervisor.js.map +1 -1
  345. package/dist/runtime/guardrails/backpressure-controller.d.ts +32 -0
  346. package/dist/runtime/guardrails/backpressure-controller.d.ts.map +1 -0
  347. package/dist/runtime/guardrails/backpressure-controller.js +88 -0
  348. package/dist/runtime/guardrails/backpressure-controller.js.map +1 -0
  349. package/dist/runtime/guardrails/circuit-breaker.d.ts +32 -0
  350. package/dist/runtime/guardrails/circuit-breaker.d.ts.map +1 -0
  351. package/dist/runtime/guardrails/circuit-breaker.js +88 -0
  352. package/dist/runtime/guardrails/circuit-breaker.js.map +1 -0
  353. package/dist/runtime/guardrails/guardrail-store.d.ts +23 -0
  354. package/dist/runtime/guardrails/guardrail-store.d.ts.map +1 -0
  355. package/dist/runtime/guardrails/guardrail-store.js +95 -0
  356. package/dist/runtime/guardrails/guardrail-store.js.map +1 -0
  357. package/dist/runtime/guardrails/index.d.ts +4 -0
  358. package/dist/runtime/guardrails/index.d.ts.map +1 -0
  359. package/dist/runtime/guardrails/index.js +4 -0
  360. package/dist/runtime/guardrails/index.js.map +1 -0
  361. package/dist/runtime/interactive-automation/browser-session-store.d.ts +43 -0
  362. package/dist/runtime/interactive-automation/browser-session-store.d.ts.map +1 -0
  363. package/dist/runtime/interactive-automation/browser-session-store.js +104 -0
  364. package/dist/runtime/interactive-automation/browser-session-store.js.map +1 -0
  365. package/dist/runtime/interactive-automation/failure-classifier.d.ts +12 -0
  366. package/dist/runtime/interactive-automation/failure-classifier.d.ts.map +1 -0
  367. package/dist/runtime/interactive-automation/failure-classifier.js +50 -0
  368. package/dist/runtime/interactive-automation/failure-classifier.js.map +1 -0
  369. package/dist/runtime/interactive-automation/index.d.ts +2 -0
  370. package/dist/runtime/interactive-automation/index.d.ts.map +1 -1
  371. package/dist/runtime/interactive-automation/index.js +2 -0
  372. package/dist/runtime/interactive-automation/index.js.map +1 -1
  373. package/dist/runtime/interactive-automation/providers/manus-browser.d.ts.map +1 -1
  374. package/dist/runtime/interactive-automation/providers/manus-browser.js +17 -1
  375. package/dist/runtime/interactive-automation/providers/manus-browser.js.map +1 -1
  376. package/dist/runtime/interactive-automation/types.d.ts +4 -0
  377. package/dist/runtime/interactive-automation/types.d.ts.map +1 -1
  378. package/dist/runtime/interactive-automation/types.js.map +1 -1
  379. package/dist/runtime/notification-routing.d.ts +45 -2
  380. package/dist/runtime/notification-routing.d.ts.map +1 -1
  381. package/dist/runtime/notification-routing.js +196 -79
  382. package/dist/runtime/notification-routing.js.map +1 -1
  383. package/dist/runtime/run-spec/confirmation.d.ts +34 -0
  384. package/dist/runtime/run-spec/confirmation.d.ts.map +1 -0
  385. package/dist/runtime/run-spec/confirmation.js +176 -0
  386. package/dist/runtime/run-spec/confirmation.js.map +1 -0
  387. package/dist/runtime/run-spec/derive.d.ts +284 -0
  388. package/dist/runtime/run-spec/derive.d.ts.map +1 -0
  389. package/dist/runtime/run-spec/derive.js +379 -0
  390. package/dist/runtime/run-spec/derive.js.map +1 -0
  391. package/dist/runtime/run-spec/index.d.ts +5 -0
  392. package/dist/runtime/run-spec/index.d.ts.map +1 -0
  393. package/dist/runtime/run-spec/index.js +5 -0
  394. package/dist/runtime/run-spec/index.js.map +1 -0
  395. package/dist/runtime/run-spec/store.d.ts +11 -0
  396. package/dist/runtime/run-spec/store.d.ts.map +1 -0
  397. package/dist/runtime/run-spec/store.js +36 -0
  398. package/dist/runtime/run-spec/store.js.map +1 -0
  399. package/dist/runtime/run-spec/types.d.ts +495 -0
  400. package/dist/runtime/run-spec/types.d.ts.map +1 -0
  401. package/dist/runtime/run-spec/types.js +87 -0
  402. package/dist/runtime/run-spec/types.js.map +1 -0
  403. package/dist/runtime/schedule/engine-execution.d.ts +2 -1
  404. package/dist/runtime/schedule/engine-execution.d.ts.map +1 -1
  405. package/dist/runtime/schedule/engine-execution.js +1 -1
  406. package/dist/runtime/schedule/engine-execution.js.map +1 -1
  407. package/dist/runtime/schedule/engine-layers.d.ts +2 -1
  408. package/dist/runtime/schedule/engine-layers.d.ts.map +1 -1
  409. package/dist/runtime/schedule/engine-layers.js +3 -1
  410. package/dist/runtime/schedule/engine-layers.js.map +1 -1
  411. package/dist/runtime/schedule/engine.d.ts +2 -1
  412. package/dist/runtime/schedule/engine.d.ts.map +1 -1
  413. package/dist/runtime/schedule/engine.js.map +1 -1
  414. package/dist/runtime/schedule/history.d.ts +4 -4
  415. package/dist/runtime/session-registry/registry.d.ts.map +1 -1
  416. package/dist/runtime/session-registry/registry.js +2 -0
  417. package/dist/runtime/session-registry/registry.js.map +1 -1
  418. package/dist/runtime/session-registry/types.d.ts +102 -94
  419. package/dist/runtime/session-registry/types.d.ts.map +1 -1
  420. package/dist/runtime/session-registry/types.js +2 -0
  421. package/dist/runtime/session-registry/types.js.map +1 -1
  422. package/dist/runtime/store/artifact-retention.d.ts +44 -0
  423. package/dist/runtime/store/artifact-retention.d.ts.map +1 -0
  424. package/dist/runtime/store/artifact-retention.js +263 -0
  425. package/dist/runtime/store/artifact-retention.js.map +1 -0
  426. package/dist/runtime/store/background-run-store.d.ts +1 -0
  427. package/dist/runtime/store/background-run-store.d.ts.map +1 -1
  428. package/dist/runtime/store/background-run-store.js +1 -0
  429. package/dist/runtime/store/background-run-store.js.map +1 -1
  430. package/dist/runtime/store/budget-store.d.ts +442 -0
  431. package/dist/runtime/store/budget-store.d.ts.map +1 -0
  432. package/dist/runtime/store/budget-store.js +318 -0
  433. package/dist/runtime/store/budget-store.js.map +1 -0
  434. package/dist/runtime/store/dream-checkpoints.d.ts +9 -0
  435. package/dist/runtime/store/dream-checkpoints.d.ts.map +1 -0
  436. package/dist/runtime/store/dream-checkpoints.js +16 -0
  437. package/dist/runtime/store/dream-checkpoints.js.map +1 -0
  438. package/dist/runtime/store/evaluator-results.d.ts +97 -0
  439. package/dist/runtime/store/evaluator-results.d.ts.map +1 -0
  440. package/dist/runtime/store/evaluator-results.js +355 -0
  441. package/dist/runtime/store/evaluator-results.js.map +1 -0
  442. package/dist/runtime/store/evidence-ledger.d.ts +5298 -0
  443. package/dist/runtime/store/evidence-ledger.d.ts.map +1 -0
  444. package/dist/runtime/store/evidence-ledger.js +1452 -0
  445. package/dist/runtime/store/evidence-ledger.js.map +1 -0
  446. package/dist/runtime/store/experiment-queue-store.d.ts +1164 -0
  447. package/dist/runtime/store/experiment-queue-store.d.ts.map +1 -0
  448. package/dist/runtime/store/experiment-queue-store.js +341 -0
  449. package/dist/runtime/store/experiment-queue-store.js.map +1 -0
  450. package/dist/runtime/store/health-store.d.ts.map +1 -1
  451. package/dist/runtime/store/health-store.js +6 -0
  452. package/dist/runtime/store/health-store.js.map +1 -1
  453. package/dist/runtime/store/index.d.ts +25 -2
  454. package/dist/runtime/store/index.d.ts.map +1 -1
  455. package/dist/runtime/store/index.js +13 -1
  456. package/dist/runtime/store/index.js.map +1 -1
  457. package/dist/runtime/store/metric-history.d.ts +10 -0
  458. package/dist/runtime/store/metric-history.d.ts.map +1 -0
  459. package/dist/runtime/store/metric-history.js +56 -0
  460. package/dist/runtime/store/metric-history.js.map +1 -0
  461. package/dist/runtime/store/operator-handoff-store.d.ts +179 -0
  462. package/dist/runtime/store/operator-handoff-store.d.ts.map +1 -0
  463. package/dist/runtime/store/operator-handoff-store.js +120 -0
  464. package/dist/runtime/store/operator-handoff-store.js.map +1 -0
  465. package/dist/runtime/store/postmortem-report.d.ts +485 -0
  466. package/dist/runtime/store/postmortem-report.d.ts.map +1 -0
  467. package/dist/runtime/store/postmortem-report.js +561 -0
  468. package/dist/runtime/store/postmortem-report.js.map +1 -0
  469. package/dist/runtime/store/reproducibility-manifest.d.ts +565 -0
  470. package/dist/runtime/store/reproducibility-manifest.d.ts.map +1 -0
  471. package/dist/runtime/store/reproducibility-manifest.js +392 -0
  472. package/dist/runtime/store/reproducibility-manifest.js.map +1 -0
  473. package/dist/runtime/store/research-evidence.d.ts +8 -0
  474. package/dist/runtime/store/research-evidence.d.ts.map +1 -0
  475. package/dist/runtime/store/research-evidence.js +15 -0
  476. package/dist/runtime/store/research-evidence.js.map +1 -0
  477. package/dist/runtime/store/runtime-operation-schemas.d.ts +70 -24
  478. package/dist/runtime/store/runtime-operation-schemas.d.ts.map +1 -1
  479. package/dist/runtime/store/runtime-operation-schemas.js +16 -1
  480. package/dist/runtime/store/runtime-operation-schemas.js.map +1 -1
  481. package/dist/runtime/store/runtime-paths.d.ts +25 -0
  482. package/dist/runtime/store/runtime-paths.d.ts.map +1 -1
  483. package/dist/runtime/store/runtime-paths.js +73 -0
  484. package/dist/runtime/store/runtime-paths.js.map +1 -1
  485. package/dist/runtime/store/runtime-schemas.d.ts +1936 -17
  486. package/dist/runtime/store/runtime-schemas.d.ts.map +1 -1
  487. package/dist/runtime/store/runtime-schemas.js +201 -0
  488. package/dist/runtime/store/runtime-schemas.js.map +1 -1
  489. package/dist/runtime/store/safe-pause-store.d.ts +28 -0
  490. package/dist/runtime/store/safe-pause-store.d.ts.map +1 -0
  491. package/dist/runtime/store/safe-pause-store.js +103 -0
  492. package/dist/runtime/store/safe-pause-store.js.map +1 -0
  493. package/dist/runtime/types/daemon.d.ts +224 -14
  494. package/dist/runtime/types/daemon.d.ts.map +1 -1
  495. package/dist/runtime/types/daemon.js +27 -2
  496. package/dist/runtime/types/daemon.js.map +1 -1
  497. package/dist/runtime/types/envelope.d.ts +10 -10
  498. package/dist/runtime/types/hook.d.ts +9 -9
  499. package/dist/runtime/types/notification.d.ts +6 -6
  500. package/dist/runtime/types/plugin.d.ts +2 -2
  501. package/dist/runtime/types/schedule.d.ts +97 -54
  502. package/dist/runtime/types/schedule.d.ts.map +1 -1
  503. package/dist/runtime/types/schedule.js +10 -1
  504. package/dist/runtime/types/schedule.js.map +1 -1
  505. package/dist/runtime/types/trigger.d.ts +2 -2
  506. package/dist/tools/automation/InteractiveAutomationTools.d.ts +10 -0
  507. package/dist/tools/automation/InteractiveAutomationTools.d.ts.map +1 -1
  508. package/dist/tools/automation/InteractiveAutomationTools.js +139 -8
  509. package/dist/tools/automation/InteractiveAutomationTools.js.map +1 -1
  510. package/dist/tools/builtin/exports.d.ts +1 -1
  511. package/dist/tools/builtin/exports.d.ts.map +1 -1
  512. package/dist/tools/builtin/exports.js +1 -1
  513. package/dist/tools/builtin/exports.js.map +1 -1
  514. package/dist/tools/builtin/factory.d.ts +5 -0
  515. package/dist/tools/builtin/factory.d.ts.map +1 -1
  516. package/dist/tools/builtin/factory.js +18 -2
  517. package/dist/tools/builtin/factory.js.map +1 -1
  518. package/dist/tools/kaggle/KaggleExperimentTools.d.ts +792 -8
  519. package/dist/tools/kaggle/KaggleExperimentTools.d.ts.map +1 -1
  520. package/dist/tools/kaggle/KaggleExperimentTools.js +284 -19
  521. package/dist/tools/kaggle/KaggleExperimentTools.js.map +1 -1
  522. package/dist/tools/kaggle/KaggleSubmissionTools.d.ts +18 -12
  523. package/dist/tools/kaggle/KaggleSubmissionTools.d.ts.map +1 -1
  524. package/dist/tools/kaggle/KaggleSubmissionTools.js +23 -4
  525. package/dist/tools/kaggle/KaggleSubmissionTools.js.map +1 -1
  526. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.d.ts +28 -9
  527. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.d.ts.map +1 -1
  528. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js +182 -4
  529. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js.map +1 -1
  530. package/dist/tools/kaggle/index.d.ts +1 -1
  531. package/dist/tools/kaggle/index.d.ts.map +1 -1
  532. package/dist/tools/kaggle/index.js +1 -1
  533. package/dist/tools/kaggle/index.js.map +1 -1
  534. package/dist/tools/kaggle/metrics.d.ts +845 -4
  535. package/dist/tools/kaggle/metrics.d.ts.map +1 -1
  536. package/dist/tools/kaggle/metrics.js +410 -1
  537. package/dist/tools/kaggle/metrics.js.map +1 -1
  538. package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.d.ts +6 -0
  539. package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.d.ts.map +1 -1
  540. package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.js +9 -2
  541. package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.js.map +1 -1
  542. package/dist/tools/mutation/TaskCreateTool/TaskCreateTool.d.ts +4 -4
  543. package/dist/tools/network/McpStdioTool/McpStdioTool.d.ts +4 -4
  544. package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.d.ts +2 -2
  545. package/dist/tools/query/runtime-dream-review-tool.d.ts +34 -0
  546. package/dist/tools/query/runtime-dream-review-tool.d.ts.map +1 -0
  547. package/dist/tools/query/runtime-dream-review-tool.js +62 -0
  548. package/dist/tools/query/runtime-dream-review-tool.js.map +1 -0
  549. package/dist/tools/query/runtime-session-tools.d.ts.map +1 -1
  550. package/dist/tools/query/runtime-session-tools.js +2 -0
  551. package/dist/tools/query/runtime-session-tools.js.map +1 -1
  552. package/dist/tools/runtime/LongRunningRuntimeTools.d.ts +103 -103
  553. package/dist/tools/runtime/LongRunningRuntimeTools.d.ts.map +1 -1
  554. package/dist/tools/runtime/LongRunningRuntimeTools.js +60 -0
  555. package/dist/tools/runtime/LongRunningRuntimeTools.js.map +1 -1
  556. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts +62 -32
  557. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts.map +1 -1
  558. package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts +78 -44
  559. package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts.map +1 -1
  560. package/dist/tools/system/TestRunnerTool/TestRunnerTool.d.ts +4 -4
  561. package/package.json +2 -1
package/README.md CHANGED
@@ -58,7 +58,6 @@ PulSeed will guide provider and adapter setup when needed.
58
58
 
59
59
  - [Get Started](docs/getting-started.md)
60
60
  - [Docs Index](docs/index.md)
61
- - [Use Cases](docs/usecase.md)
62
61
  - [Runtime](docs/runtime.md)
63
62
  - [Configuration](docs/configuration.md)
64
63
  - [Status](docs/status.md)
@@ -97,17 +96,22 @@ PulSeed will guide provider and adapter setup when needed.
97
96
  - `pulseed schedule ...` for schedule management
98
97
  - Lower-level commands for scripting, diagnostics, and compatibility
99
98
 
100
- ## Use Cases
99
+ ## Achievements
101
100
 
102
- PulSeed is a fit when the work is bigger than one prompt and needs follow-through:
101
+ PulSeed joined [Kaggle Playground Series S6E4](https://www.kaggle.com/competitions/playground-series-s6e4).
103
102
 
104
- - keep a codebase moving toward a maintenance goal
105
- - track a business KPI and adjust strategy as results change
106
- - coordinate recurring reports, reminders, and external actions
107
- - observe external data sources and ask for confirmation when a human decision
108
- is required
103
+ | Area | Result |
104
+ | --- | --- |
105
+ | Long-running workflow | It has been running straight over 10 hours and made decent progress. |
106
+ | Local OOF balanced accuracy | Improved from early 0.45-level baselines to `0.970413051791`. |
107
+ | Exploration path | CatBoost-focused ensembles, probability adjustment, and post-OOF calibration. |
108
+ | Current best local artifact | Preserved full OOF predictions and per-class recall. |
109
109
 
110
- More detailed examples live in [Use Cases](docs/usecase.md).
110
+ Current best per-class recall:
111
+
112
+ - High: `0.957351611214`
113
+ - Low: `0.994598788377`
114
+ - Medium: `0.959288755783`
111
115
 
112
116
  ## Docs and Community
113
117
 
@@ -0,0 +1,18 @@
1
+ import type { DataSourceConfig, DataSourceQuery, DataSourceResult, DataSourceType } from "../../base/types/data-source.js";
2
+ import type { IDataSourceAdapter } from "../../platform/observation/data-source-adapter.js";
3
+ export declare function createWorkspaceArtifactMetricDataSource(workspacePath?: string): ArtifactMetricDataSourceAdapter;
4
+ export declare class ArtifactMetricDataSourceAdapter implements IDataSourceAdapter {
5
+ readonly sourceId: string;
6
+ readonly sourceType: DataSourceType;
7
+ readonly config: DataSourceConfig;
8
+ constructor(config: DataSourceConfig);
9
+ connect(): Promise<void>;
10
+ disconnect(): Promise<void>;
11
+ healthCheck(): Promise<boolean>;
12
+ getSupportedDimensions(): string[];
13
+ supportsDimension(dimensionName: string): boolean;
14
+ query(params: DataSourceQuery): Promise<DataSourceResult>;
15
+ private workspaceRoot;
16
+ private scanOptions;
17
+ }
18
+ //# sourceMappingURL=artifact-metric-datasource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-metric-datasource.d.ts","sourceRoot":"","sources":["../../../src/adapters/datasources/artifact-metric-datasource.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAuE5F,wBAAgB,uCAAuC,CAAC,aAAa,SAAgB,GAAG,+BAA+B,CAStH;AAED,qBAAa,+BAAgC,YAAW,kBAAkB;IACxE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAqB;IACxD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;gBAEtB,MAAM,EAAE,gBAAgB;IAK9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IASrC,sBAAsB,IAAI,MAAM,EAAE;IAWlC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAI3C,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyE/D,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,WAAW;CAoBpB"}
@@ -0,0 +1,592 @@
1
+ import * as fs from "node:fs/promises";
2
+ import * as path from "node:path";
3
+ const BUILTIN_SOURCE_ID = "ds_builtin_workspace_artifacts";
4
+ const DEFAULT_METRIC_FILE_NAMES = ["metrics.json", "result.json"];
5
+ const DEFAULT_ARTIFACT_ROOTS = ["artifacts", "runs", "reports", "outputs", "results", "logs"];
6
+ const DEFAULT_EXCLUDE_DIRS = new Set([
7
+ ".cache",
8
+ ".git",
9
+ ".mypy_cache",
10
+ ".pytest_cache",
11
+ ".venv",
12
+ "__pycache__",
13
+ "env",
14
+ "node_modules",
15
+ "venv",
16
+ ]);
17
+ const DEFAULT_EXCLUDE_PATHS = new Set(["data/raw"]);
18
+ const DEFAULT_MAX_METRIC_FILES = 5_000;
19
+ const DEFAULT_MAX_ARTIFACT_FILES = 100_000;
20
+ const DEFAULT_MAX_CANDIDATES = 200;
21
+ const MAX_RAW_CANDIDATES = 25;
22
+ export function createWorkspaceArtifactMetricDataSource(workspacePath = process.cwd()) {
23
+ return new ArtifactMetricDataSourceAdapter({
24
+ id: BUILTIN_SOURCE_ID,
25
+ name: "builtin:workspace artifact metrics",
26
+ type: "artifact_metric",
27
+ connection: { path: workspacePath },
28
+ enabled: true,
29
+ created_at: new Date().toISOString(),
30
+ });
31
+ }
32
+ export class ArtifactMetricDataSourceAdapter {
33
+ sourceId;
34
+ sourceType = "artifact_metric";
35
+ config;
36
+ constructor(config) {
37
+ this.config = config;
38
+ this.sourceId = config.id;
39
+ }
40
+ async connect() {
41
+ await fs.access(this.workspaceRoot());
42
+ }
43
+ async disconnect() {
44
+ // no persistent connection
45
+ }
46
+ async healthCheck() {
47
+ try {
48
+ await fs.access(this.workspaceRoot());
49
+ return true;
50
+ }
51
+ catch {
52
+ return false;
53
+ }
54
+ }
55
+ getSupportedDimensions() {
56
+ const dimensions = new Set([
57
+ ...Object.keys(this.config.dimension_mapping ?? {}),
58
+ ...Object.keys(this.config.connection.dimension_metrics ?? {}),
59
+ ...Object.keys(this.config.connection.dimension_aggregations ?? {}),
60
+ "validated_experiment_count",
61
+ "durable_artifact_count",
62
+ ]);
63
+ return Array.from(dimensions).sort();
64
+ }
65
+ supportsDimension(dimensionName) {
66
+ return this.getSupportedDimensions().includes(dimensionName) || isRecognizedBestMetricDimension(dimensionName);
67
+ }
68
+ async query(params) {
69
+ const root = this.workspaceRoot();
70
+ const expression = this.config.dimension_mapping?.[params.dimension_name] ?? params.expression;
71
+ const aggregation = resolveAggregation(params.dimension_name, expression, this.config);
72
+ const timestamp = new Date().toISOString();
73
+ const options = this.scanOptions();
74
+ if (aggregation === "file_count") {
75
+ const count = await countArtifactFiles(root, options);
76
+ return {
77
+ value: count,
78
+ raw: {
79
+ root,
80
+ aggregation,
81
+ file_count: count,
82
+ discovery: discoveryRaw(options),
83
+ },
84
+ timestamp,
85
+ source_id: this.sourceId,
86
+ };
87
+ }
88
+ const keys = resolveMetricKeys(params.dimension_name, expression, this.config);
89
+ const candidates = await discoverMetricCandidates(root, options, keys);
90
+ const observations = await readMetricObservations(candidates);
91
+ const evidenceCandidates = buildEvidenceCandidates(observations, keys, aggregation === "min" ? "min" : "max");
92
+ if (aggregation === "count") {
93
+ const matched = observations.filter((observation) => hasAnyMetric(observation, keys));
94
+ return {
95
+ value: matched.length,
96
+ raw: {
97
+ root,
98
+ aggregation,
99
+ inspected_metric_files: candidates.length,
100
+ matched_metric_files: matched.length,
101
+ metric_keys: keys,
102
+ discovery: discoveryRaw(options),
103
+ candidates: rawCandidates(candidates),
104
+ evidence_candidates: evidenceCandidates,
105
+ conflicts: detectMetricConflicts(params.dimension_name, observations, keys),
106
+ stale_candidates: staleRaw(observations),
107
+ strategic_correctness: "not_evaluated",
108
+ },
109
+ timestamp,
110
+ source_id: this.sourceId,
111
+ };
112
+ }
113
+ const match = selectMetric(observations, keys, aggregation);
114
+ return {
115
+ value: match?.value ?? 0,
116
+ raw: {
117
+ root,
118
+ aggregation,
119
+ inspected_metric_files: candidates.length,
120
+ metric_keys: keys,
121
+ selected_path: match?.path ?? null,
122
+ selected_key: match?.key ?? null,
123
+ selected_value: match?.value ?? 0,
124
+ selected: match,
125
+ discovery: discoveryRaw(options),
126
+ candidates: rawCandidates(candidates),
127
+ evidence_candidates: evidenceCandidates,
128
+ conflicts: detectMetricConflicts(params.dimension_name, observations, keys),
129
+ stale_candidates: staleRaw(observations),
130
+ strategic_correctness: "not_evaluated",
131
+ },
132
+ timestamp,
133
+ source_id: this.sourceId,
134
+ };
135
+ }
136
+ workspaceRoot() {
137
+ const configuredPath = this.config.connection.path;
138
+ return configuredPath ? path.resolve(configuredPath) : process.cwd();
139
+ }
140
+ scanOptions() {
141
+ return {
142
+ metricFileNames: new Set(this.config.connection.metric_file_names ?? DEFAULT_METRIC_FILE_NAMES),
143
+ artifactRoots: unique([
144
+ ...(this.config.connection.artifact_roots ?? []),
145
+ ...(this.config.connection.artifact_roots ? [] : DEFAULT_ARTIFACT_ROOTS),
146
+ ].map(normalizeRelativePath)),
147
+ includePaths: unique((this.config.connection.include_paths ?? []).map(normalizeRelativePath)),
148
+ parserHints: new Set(this.config.connection.parser_hints ?? ["json"]),
149
+ excludeDirs: new Set([...(this.config.connection.exclude_dirs ?? []), ...DEFAULT_EXCLUDE_DIRS]),
150
+ excludePaths: new Set([
151
+ ...Array.from(DEFAULT_EXCLUDE_PATHS),
152
+ ...(this.config.connection.exclude_paths ?? []),
153
+ ].map(normalizeRelativePath)),
154
+ maxMetricFiles: this.config.connection.max_metric_files ?? DEFAULT_MAX_METRIC_FILES,
155
+ maxArtifactFiles: this.config.connection.max_artifact_files ?? DEFAULT_MAX_ARTIFACT_FILES,
156
+ maxCandidates: this.config.connection.max_candidates ?? DEFAULT_MAX_CANDIDATES,
157
+ staleAfterMs: this.config.connection.stale_after_ms,
158
+ };
159
+ }
160
+ }
161
+ async function discoverMetricCandidates(root, options, keys) {
162
+ const discovered = new Map();
163
+ for (const includePath of options.includePaths) {
164
+ if (discovered.size >= options.maxMetricFiles)
165
+ break;
166
+ const absolute = path.resolve(root, includePath);
167
+ if (!isInsideRoot(root, absolute) || !(await isFile(absolute)))
168
+ continue;
169
+ if (!options.metricFileNames.has(path.basename(absolute)))
170
+ continue;
171
+ const candidate = await buildMetricCandidate(root, absolute, options, keys);
172
+ discovered.set(candidate.path, candidate);
173
+ }
174
+ const searchRoots = await resolveSearchRoots(root, options);
175
+ for (const searchRoot of searchRoots) {
176
+ if (discovered.size >= options.maxMetricFiles)
177
+ break;
178
+ await walkFiles(root, searchRoot, options, async (filePath) => {
179
+ if (discovered.size >= options.maxMetricFiles)
180
+ return;
181
+ if (!options.metricFileNames.has(path.basename(filePath)))
182
+ return;
183
+ const candidate = await buildMetricCandidate(root, filePath, options, keys);
184
+ discovered.set(candidate.path, candidate);
185
+ });
186
+ }
187
+ return Array.from(discovered.values())
188
+ .sort(compareCandidates)
189
+ .slice(0, options.maxCandidates);
190
+ }
191
+ async function resolveSearchRoots(root, options) {
192
+ const roots = [];
193
+ for (const includePath of [...options.includePaths, ...options.artifactRoots]) {
194
+ const absolute = path.resolve(root, includePath);
195
+ if (!isInsideRoot(root, absolute))
196
+ continue;
197
+ if (await isDirectory(absolute))
198
+ roots.push(absolute);
199
+ }
200
+ if (roots.length === 0)
201
+ roots.push(root);
202
+ return unique(roots);
203
+ }
204
+ async function buildMetricCandidate(root, filePath, options, keys) {
205
+ const stats = await fs.stat(filePath);
206
+ const relativePath = normalizeRelativePath(path.relative(root, filePath));
207
+ const reasons = [];
208
+ let score = 0;
209
+ if (options.metricFileNames.has(path.basename(filePath))) {
210
+ score += 35;
211
+ reasons.push("metric filename match");
212
+ }
213
+ const matchedRoot = options.artifactRoots.find((rootHint) => relativePath === rootHint || relativePath.startsWith(`${rootHint}/`));
214
+ if (matchedRoot) {
215
+ score += 20;
216
+ reasons.push(`artifact root match: ${matchedRoot}`);
217
+ }
218
+ for (const key of keys) {
219
+ if (relativePath.toLowerCase().includes(key.toLowerCase())) {
220
+ score += 8;
221
+ reasons.push(`path metric hint: ${key}`);
222
+ break;
223
+ }
224
+ }
225
+ const mtime = stats.mtime;
226
+ if (Date.now() - mtime.getTime() < 24 * 60 * 60 * 1000) {
227
+ score += 10;
228
+ reasons.push("recent artifact");
229
+ }
230
+ const stale = options.staleAfterMs !== undefined && Date.now() - mtime.getTime() > options.staleAfterMs;
231
+ if (stale) {
232
+ score -= 30;
233
+ reasons.push("stale artifact");
234
+ }
235
+ return {
236
+ path: filePath,
237
+ relativePath,
238
+ updatedTime: mtime.toISOString(),
239
+ candidateScore: score,
240
+ reasons,
241
+ stale,
242
+ };
243
+ }
244
+ async function countArtifactFiles(root, options) {
245
+ let count = 0;
246
+ await walkFiles(root, root, options, async () => {
247
+ if (count < options.maxArtifactFiles)
248
+ count += 1;
249
+ });
250
+ return count;
251
+ }
252
+ async function walkFiles(root, startDir, options, onFile) {
253
+ async function visit(dir) {
254
+ let entries;
255
+ try {
256
+ entries = await fs.readdir(dir, { withFileTypes: true });
257
+ }
258
+ catch {
259
+ return;
260
+ }
261
+ for (const entry of entries) {
262
+ const fullPath = path.join(dir, entry.name);
263
+ const relPath = normalizeRelativePath(path.relative(root, fullPath));
264
+ if (entry.isDirectory()) {
265
+ if (shouldSkipDirectory(entry.name, relPath, options))
266
+ continue;
267
+ await visit(fullPath);
268
+ }
269
+ else if (entry.isFile()) {
270
+ await onFile(fullPath);
271
+ }
272
+ }
273
+ }
274
+ await visit(startDir);
275
+ }
276
+ function shouldSkipDirectory(name, relPath, options) {
277
+ if (options.excludeDirs.has(name))
278
+ return true;
279
+ for (const excludedPath of options.excludePaths) {
280
+ if (relPath === excludedPath || relPath.startsWith(`${excludedPath}/`))
281
+ return true;
282
+ }
283
+ return false;
284
+ }
285
+ async function readMetricObservations(candidates) {
286
+ const observations = [];
287
+ for (const candidate of candidates) {
288
+ try {
289
+ const parsed = JSON.parse(await fs.readFile(candidate.path, "utf8"));
290
+ const metrics = extractNumericMetrics(parsed);
291
+ if (metrics.length > 0) {
292
+ observations.push({
293
+ ...candidate,
294
+ parser: "json",
295
+ metrics,
296
+ extractionConfidence: Math.max(...metrics.map((metric) => metric.confidence)),
297
+ });
298
+ }
299
+ }
300
+ catch {
301
+ // Ignore incomplete or invalid artifacts while the long-running process is writing.
302
+ }
303
+ }
304
+ return observations;
305
+ }
306
+ function extractNumericMetrics(value) {
307
+ const metrics = [];
308
+ if (!isRecord(value))
309
+ return metrics;
310
+ for (const [key, field] of Object.entries(value)) {
311
+ addNumber(metrics, key, key, field, 0.95);
312
+ }
313
+ const nestedMetrics = value["metrics"];
314
+ if (isRecord(nestedMetrics)) {
315
+ for (const [key, field] of Object.entries(nestedMetrics)) {
316
+ addNumber(metrics, key, `metrics.${key}`, field, 0.90);
317
+ }
318
+ }
319
+ const allMetrics = value["all_metrics"];
320
+ if (isRecord(allMetrics)) {
321
+ for (const [key, field] of Object.entries(allMetrics)) {
322
+ addNumber(metrics, key, `all_metrics.${key}`, field, 0.90);
323
+ }
324
+ }
325
+ const metricName = typeof value["metric_name"] === "string" ? value["metric_name"] : null;
326
+ if (metricName) {
327
+ addNumber(metrics, metricName, "score", value["score"], 0.85);
328
+ addNumber(metrics, metricName, "cv_score", value["cv_score"], 0.85);
329
+ }
330
+ const evidence = value["evidence"];
331
+ if (Array.isArray(evidence)) {
332
+ for (const [index, item] of evidence.entries()) {
333
+ if (!isRecord(item))
334
+ continue;
335
+ const label = typeof item["label"] === "string" ? item["label"] : null;
336
+ if (!label)
337
+ continue;
338
+ addNumber(metrics, label, `evidence.${index}.value`, item["value"], 0.80);
339
+ }
340
+ }
341
+ return metrics;
342
+ }
343
+ function addNumber(metrics, key, keyPath, value, confidence) {
344
+ if (typeof value === "number" && Number.isFinite(value)) {
345
+ metrics.push({ key, keyPath, value, confidence });
346
+ }
347
+ }
348
+ function hasAnyMetric(observation, keys) {
349
+ if (keys.length === 0)
350
+ return observation.metrics.length > 0;
351
+ return keys.some((key) => observation.metrics.some((metric) => metric.key === key));
352
+ }
353
+ function selectMetric(observations, keys, aggregation) {
354
+ const matches = matchingMetrics(observations, keys);
355
+ if (matches.length === 0)
356
+ return null;
357
+ const sorted = [...matches].sort((left, right) => compareMetricMatches(left, right, aggregation));
358
+ const best = sorted[0];
359
+ return {
360
+ path: best.observation.path,
361
+ relativePath: best.observation.relativePath,
362
+ key: best.metric.key,
363
+ keyPath: best.metric.keyPath,
364
+ value: best.metric.value,
365
+ parser: best.observation.parser,
366
+ updatedTime: best.observation.updatedTime,
367
+ extractionConfidence: best.metric.confidence,
368
+ candidateScore: best.observation.candidateScore,
369
+ stale: best.observation.stale,
370
+ };
371
+ }
372
+ function matchingMetrics(observations, keys) {
373
+ const wanted = new Set(keys);
374
+ const matches = [];
375
+ for (const observation of observations) {
376
+ for (const metric of observation.metrics) {
377
+ if (wanted.size === 0 || wanted.has(metric.key)) {
378
+ matches.push({ observation, metric });
379
+ }
380
+ }
381
+ }
382
+ return matches;
383
+ }
384
+ function compareMetricMatches(left, right, aggregation) {
385
+ const leftQuality = qualityBucket(left.observation, left.metric);
386
+ const rightQuality = qualityBucket(right.observation, right.metric);
387
+ if (leftQuality !== rightQuality)
388
+ return rightQuality - leftQuality;
389
+ if (left.metric.value !== right.metric.value) {
390
+ return aggregation === "max"
391
+ ? right.metric.value - left.metric.value
392
+ : left.metric.value - right.metric.value;
393
+ }
394
+ if (left.metric.confidence !== right.metric.confidence)
395
+ return right.metric.confidence - left.metric.confidence;
396
+ if (left.observation.candidateScore !== right.observation.candidateScore)
397
+ return right.observation.candidateScore - left.observation.candidateScore;
398
+ return Date.parse(right.observation.updatedTime) - Date.parse(left.observation.updatedTime);
399
+ }
400
+ function qualityBucket(observation, metric) {
401
+ if (observation.stale)
402
+ return 0;
403
+ if (metric.confidence < 0.85)
404
+ return 1;
405
+ return 2;
406
+ }
407
+ function detectMetricConflicts(dimensionName, observations, keys) {
408
+ const grouped = new Map();
409
+ for (const match of matchingMetrics(observations, keys)) {
410
+ const group = grouped.get(match.metric.key) ?? [];
411
+ group.push(match);
412
+ grouped.set(match.metric.key, group);
413
+ }
414
+ const conflicts = [];
415
+ for (const [metricKey, matches] of grouped) {
416
+ const conflict = buildConflict(metricKey, matches);
417
+ if (conflict)
418
+ conflicts.push(conflict);
419
+ }
420
+ if (keys.length > 1) {
421
+ const aliasConflict = buildConflict(`dimension:${dimensionName}`, matchingMetrics(observations, keys));
422
+ if (aliasConflict)
423
+ conflicts.push(aliasConflict);
424
+ }
425
+ return conflicts;
426
+ }
427
+ function buildConflict(metricKey, matches) {
428
+ const values = new Set(matches.map((match) => match.metric.value));
429
+ if (values.size <= 1)
430
+ return null;
431
+ return {
432
+ metricKey,
433
+ candidates: matches
434
+ .sort((left, right) => Date.parse(right.observation.updatedTime) - Date.parse(left.observation.updatedTime))
435
+ .slice(0, MAX_RAW_CANDIDATES)
436
+ .map(({ observation, metric }) => ({
437
+ path: observation.relativePath,
438
+ keyPath: metric.keyPath,
439
+ value: metric.value,
440
+ updatedTime: observation.updatedTime,
441
+ extractionConfidence: metric.confidence,
442
+ stale: observation.stale,
443
+ })),
444
+ };
445
+ }
446
+ function buildEvidenceCandidates(observations, keys, aggregation) {
447
+ return matchingMetrics(observations, keys)
448
+ .sort((left, right) => compareMetricMatches(left, right, aggregation))
449
+ .slice(0, MAX_RAW_CANDIDATES)
450
+ .map(({ observation, metric }) => ({
451
+ path: observation.relativePath,
452
+ metric_key: metric.key,
453
+ metric_key_path: metric.keyPath,
454
+ value: metric.value,
455
+ parser: observation.parser,
456
+ updated_time: observation.updatedTime,
457
+ extraction_confidence: metric.confidence,
458
+ candidate_score: observation.candidateScore,
459
+ stale: observation.stale,
460
+ reasons: observation.reasons,
461
+ strategic_correctness: "not_evaluated",
462
+ }));
463
+ }
464
+ function rawCandidates(candidates) {
465
+ return candidates.slice(0, MAX_RAW_CANDIDATES).map((candidate) => ({
466
+ path: candidate.relativePath,
467
+ updated_time: candidate.updatedTime,
468
+ candidate_score: candidate.candidateScore,
469
+ stale: candidate.stale,
470
+ reasons: candidate.reasons,
471
+ }));
472
+ }
473
+ function staleRaw(observations) {
474
+ return observations
475
+ .filter((observation) => observation.stale)
476
+ .slice(0, MAX_RAW_CANDIDATES)
477
+ .map((observation) => ({
478
+ path: observation.relativePath,
479
+ updated_time: observation.updatedTime,
480
+ extraction_confidence: observation.extractionConfidence,
481
+ }));
482
+ }
483
+ function discoveryRaw(options) {
484
+ return {
485
+ artifact_roots: options.artifactRoots,
486
+ include_paths: options.includePaths,
487
+ metric_file_names: Array.from(options.metricFileNames),
488
+ max_metric_files: options.maxMetricFiles,
489
+ max_candidates: options.maxCandidates,
490
+ parser_hints: Array.from(options.parserHints),
491
+ stale_after_ms: options.staleAfterMs ?? null,
492
+ };
493
+ }
494
+ function compareCandidates(left, right) {
495
+ if (left.candidateScore !== right.candidateScore)
496
+ return right.candidateScore - left.candidateScore;
497
+ return Date.parse(right.updatedTime) - Date.parse(left.updatedTime);
498
+ }
499
+ function resolveAggregation(dimensionName, expression, config) {
500
+ const configured = config.connection.dimension_aggregations?.[dimensionName];
501
+ if (configured)
502
+ return configured;
503
+ if (expression?.startsWith("min:"))
504
+ return "min";
505
+ if (expression?.startsWith("max:"))
506
+ return "max";
507
+ if (expression?.startsWith("count:") || expression === "count_valid_metrics")
508
+ return "count";
509
+ if (expression === "file_count")
510
+ return "file_count";
511
+ if (dimensionName === "durable_artifact_count")
512
+ return "file_count";
513
+ if (dimensionName.endsWith("_count"))
514
+ return "count";
515
+ return prefersLowerMetric(dimensionName) ? "min" : "max";
516
+ }
517
+ function resolveMetricKeys(dimensionName, expression, config) {
518
+ const configured = config.connection.dimension_metrics?.[dimensionName];
519
+ if (configured && configured.length > 0)
520
+ return unique(configured);
521
+ if (expression) {
522
+ const [, rest] = /^(?:min|max|count):(.*)$/.exec(expression) ?? [];
523
+ const raw = rest ?? (expression === "count_valid_metrics" || expression === "file_count" ? "" : expression);
524
+ const keys = raw.split(",").map((item) => item.trim()).filter(Boolean);
525
+ if (keys.length > 0)
526
+ return unique(keys);
527
+ }
528
+ if (dimensionName.endsWith("_count"))
529
+ return [];
530
+ return deriveMetricKeys(dimensionName);
531
+ }
532
+ function deriveMetricKeys(dimensionName) {
533
+ const keys = new Set([dimensionName]);
534
+ const withoutBest = dimensionName.startsWith("best_") ? dimensionName.slice("best_".length) : dimensionName;
535
+ keys.add(withoutBest);
536
+ for (const prefix of ["oof_", "cv_", "mean_", "best_"]) {
537
+ if (withoutBest.startsWith(prefix)) {
538
+ keys.add(withoutBest.slice(prefix.length));
539
+ }
540
+ }
541
+ if (withoutBest.includes("balanced_accuracy")) {
542
+ keys.add("balanced_accuracy");
543
+ keys.add("oof_balanced_accuracy");
544
+ keys.add("cv_balanced_accuracy");
545
+ }
546
+ if (withoutBest.includes("accuracy")) {
547
+ keys.add("accuracy");
548
+ keys.add("oof_accuracy");
549
+ keys.add("cv_accuracy");
550
+ }
551
+ if (withoutBest.includes("score")) {
552
+ keys.add("score");
553
+ keys.add("cv_score");
554
+ }
555
+ return unique(Array.from(keys));
556
+ }
557
+ function isRecognizedBestMetricDimension(dimensionName) {
558
+ return dimensionName.startsWith("best_") && deriveMetricKeys(dimensionName).length > 2;
559
+ }
560
+ function prefersLowerMetric(dimensionName) {
561
+ return /loss|error|rmse|mae|mse/i.test(dimensionName);
562
+ }
563
+ function normalizeRelativePath(value) {
564
+ return value.split(path.sep).join("/").replace(/^\.\//, "");
565
+ }
566
+ function isInsideRoot(root, candidate) {
567
+ const relative = path.relative(root, candidate);
568
+ return relative === "" || (!relative.startsWith("..") && !path.isAbsolute(relative));
569
+ }
570
+ async function isDirectory(filePath) {
571
+ try {
572
+ return (await fs.stat(filePath)).isDirectory();
573
+ }
574
+ catch {
575
+ return false;
576
+ }
577
+ }
578
+ async function isFile(filePath) {
579
+ try {
580
+ return (await fs.stat(filePath)).isFile();
581
+ }
582
+ catch {
583
+ return false;
584
+ }
585
+ }
586
+ function unique(values) {
587
+ return Array.from(new Set(values.filter(Boolean)));
588
+ }
589
+ function isRecord(value) {
590
+ return typeof value === "object" && value !== null && !Array.isArray(value);
591
+ }
592
+ //# sourceMappingURL=artifact-metric-datasource.js.map