@senpi/runtime 3.0.127 → 3.0.129

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 (267) hide show
  1. package/README.md +4 -12
  2. package/dist/actions/action-events.d.ts +7 -21
  3. package/dist/actions/action-events.d.ts.map +1 -1
  4. package/dist/actions/action-events.js +26 -54
  5. package/dist/actions/action-events.js.map +1 -1
  6. package/dist/actions/action-runtime-module.d.ts.map +1 -1
  7. package/dist/actions/action-runtime-module.js +7 -38
  8. package/dist/actions/action-runtime-module.js.map +1 -1
  9. package/dist/actions/close-position/close-position.action.d.ts.map +1 -1
  10. package/dist/actions/close-position/close-position.action.js +15 -122
  11. package/dist/actions/close-position/close-position.action.js.map +1 -1
  12. package/dist/actions/decision-engine.d.ts.map +1 -1
  13. package/dist/actions/decision-engine.js +2 -15
  14. package/dist/actions/decision-engine.js.map +1 -1
  15. package/dist/actions/event-derivation.d.ts +2 -71
  16. package/dist/actions/event-derivation.d.ts.map +1 -1
  17. package/dist/actions/event-derivation.js +8 -251
  18. package/dist/actions/event-derivation.js.map +1 -1
  19. package/dist/actions/open-position/open-position.action.d.ts +2 -17
  20. package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
  21. package/dist/actions/open-position/open-position.action.js +47 -162
  22. package/dist/actions/open-position/open-position.action.js.map +1 -1
  23. package/dist/actions/position-tracker/position-tracker.action.d.ts +1 -2
  24. package/dist/actions/position-tracker/position-tracker.action.d.ts.map +1 -1
  25. package/dist/actions/position-tracker/position-tracker.action.js +17 -62
  26. package/dist/actions/position-tracker/position-tracker.action.js.map +1 -1
  27. package/dist/actions/store/types.d.ts +2 -9
  28. package/dist/actions/store/types.d.ts.map +1 -1
  29. package/dist/actions/store/types.js.map +1 -1
  30. package/dist/actions/types.d.ts +0 -13
  31. package/dist/actions/types.d.ts.map +1 -1
  32. package/dist/actions/types.js +0 -13
  33. package/dist/actions/types.js.map +1 -1
  34. package/dist/cli/guide-commands.d.ts.map +1 -1
  35. package/dist/cli/guide-commands.js +6 -7
  36. package/dist/cli/guide-commands.js.map +1 -1
  37. package/dist/cli/senpi-commands.d.ts.map +1 -1
  38. package/dist/cli/senpi-commands.js +11 -4
  39. package/dist/cli/senpi-commands.js.map +1 -1
  40. package/dist/dsl/engine-client/event-mapping.d.ts.map +1 -1
  41. package/dist/dsl/engine-client/event-mapping.js +0 -14
  42. package/dist/dsl/engine-client/event-mapping.js.map +1 -1
  43. package/dist/dsl/events/build-closed-event.d.ts +1 -16
  44. package/dist/dsl/events/build-closed-event.d.ts.map +1 -1
  45. package/dist/dsl/events/build-closed-event.js +0 -6
  46. package/dist/dsl/events/build-closed-event.js.map +1 -1
  47. package/dist/dsl/events/handlers.d.ts +0 -7
  48. package/dist/dsl/events/handlers.d.ts.map +1 -1
  49. package/dist/dsl/events/handlers.js +7 -37
  50. package/dist/dsl/events/handlers.js.map +1 -1
  51. package/dist/dsl/monitor/create-monitor.d.ts +2 -6
  52. package/dist/dsl/monitor/create-monitor.d.ts.map +1 -1
  53. package/dist/dsl/monitor/create-monitor.js +9 -15
  54. package/dist/dsl/monitor/create-monitor.js.map +1 -1
  55. package/dist/dsl/monitor/dsl-failure-events.d.ts +0 -2
  56. package/dist/dsl/monitor/dsl-failure-events.d.ts.map +1 -1
  57. package/dist/dsl/monitor/dsl-failure-events.js +1 -2
  58. package/dist/dsl/monitor/dsl-failure-events.js.map +1 -1
  59. package/dist/dsl/monitor/process-one-position.d.ts +0 -1
  60. package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
  61. package/dist/dsl/monitor/process-one-position.js +25 -59
  62. package/dist/dsl/monitor/process-one-position.js.map +1 -1
  63. package/dist/dsl/plugin/index.d.ts +2 -8
  64. package/dist/dsl/plugin/index.d.ts.map +1 -1
  65. package/dist/dsl/plugin/index.js +6 -8
  66. package/dist/dsl/plugin/index.js.map +1 -1
  67. package/dist/health/types.d.ts +0 -13
  68. package/dist/health/types.d.ts.map +1 -1
  69. package/dist/health/types.js +0 -12
  70. package/dist/health/types.js.map +1 -1
  71. package/dist/index.d.ts +4 -27
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +42 -254
  74. package/dist/index.js.map +1 -1
  75. package/dist/runtime/action-registry.d.ts.map +1 -1
  76. package/dist/runtime/action-registry.js +3 -4
  77. package/dist/runtime/action-registry.js.map +1 -1
  78. package/dist/runtime/auto-update/coordinator.d.ts +6 -13
  79. package/dist/runtime/auto-update/coordinator.d.ts.map +1 -1
  80. package/dist/runtime/auto-update/coordinator.js +18 -86
  81. package/dist/runtime/auto-update/coordinator.js.map +1 -1
  82. package/dist/runtime/auto-update/run-update-command.d.ts.map +1 -1
  83. package/dist/runtime/auto-update/run-update-command.js +3 -4
  84. package/dist/runtime/auto-update/run-update-command.js.map +1 -1
  85. package/dist/runtime/auto-update/types.d.ts +5 -11
  86. package/dist/runtime/auto-update/types.d.ts.map +1 -1
  87. package/dist/runtime/auto-update/types.js +0 -11
  88. package/dist/runtime/auto-update/types.js.map +1 -1
  89. package/dist/runtime/domain-events.d.ts.map +1 -1
  90. package/dist/runtime/domain-events.js +0 -7
  91. package/dist/runtime/domain-events.js.map +1 -1
  92. package/dist/runtime/lifecycle-events.d.ts +1 -9
  93. package/dist/runtime/lifecycle-events.d.ts.map +1 -1
  94. package/dist/runtime/lifecycle-events.js +2 -11
  95. package/dist/runtime/lifecycle-events.js.map +1 -1
  96. package/dist/runtime/reconcile-run.d.ts +3 -13
  97. package/dist/runtime/reconcile-run.d.ts.map +1 -1
  98. package/dist/runtime/reconcile-run.js +3 -4
  99. package/dist/runtime/reconcile-run.js.map +1 -1
  100. package/dist/runtime/reconcile-state.d.ts +0 -8
  101. package/dist/runtime/reconcile-state.d.ts.map +1 -1
  102. package/dist/runtime/reconcile-state.js +1 -4
  103. package/dist/runtime/reconcile-state.js.map +1 -1
  104. package/dist/runtime/run.d.ts +0 -1
  105. package/dist/runtime/run.d.ts.map +1 -1
  106. package/dist/runtime/run.js.map +1 -1
  107. package/dist/runtime/runtime-schema.js +3 -3
  108. package/dist/runtime/runtime-schema.js.map +1 -1
  109. package/dist/runtime/runtime.d.ts +0 -1
  110. package/dist/runtime/runtime.d.ts.map +1 -1
  111. package/dist/runtime/runtime.js +3 -27
  112. package/dist/runtime/runtime.js.map +1 -1
  113. package/dist/runtime/supervisor/long-running-supervisor.d.ts +0 -13
  114. package/dist/runtime/supervisor/long-running-supervisor.d.ts.map +1 -1
  115. package/dist/runtime/supervisor/long-running-supervisor.js +0 -1
  116. package/dist/runtime/supervisor/long-running-supervisor.js.map +1 -1
  117. package/dist/runtime/validate-dsl-position-tracking.d.ts.map +1 -1
  118. package/dist/runtime/validate-dsl-position-tracking.js +1 -2
  119. package/dist/runtime/validate-dsl-position-tracking.js.map +1 -1
  120. package/dist/runtime-api/handlers/ingest-signals.d.ts.map +1 -1
  121. package/dist/runtime-api/handlers/ingest-signals.js +0 -1
  122. package/dist/runtime-api/handlers/ingest-signals.js.map +1 -1
  123. package/dist/runtime-api/handlers/types.d.ts +0 -5
  124. package/dist/runtime-api/handlers/types.d.ts.map +1 -1
  125. package/dist/runtime-api/intake/intake-events.d.ts +1 -1
  126. package/dist/runtime-api/intake/intake-events.d.ts.map +1 -1
  127. package/dist/runtime-api/intake/intake-events.js +3 -9
  128. package/dist/runtime-api/intake/intake-events.js.map +1 -1
  129. package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
  130. package/dist/runtime-api/intake/intake-mount.js +19 -4
  131. package/dist/runtime-api/intake/intake-mount.js.map +1 -1
  132. package/dist/runtime-api/intake/process-error-post.d.ts +1 -6
  133. package/dist/runtime-api/intake/process-error-post.d.ts.map +1 -1
  134. package/dist/runtime-api/intake/process-error-post.js +1 -5
  135. package/dist/runtime-api/intake/process-error-post.js.map +1 -1
  136. package/dist/runtime-api/intake/process-signal-post.d.ts +1 -7
  137. package/dist/runtime-api/intake/process-signal-post.d.ts.map +1 -1
  138. package/dist/runtime-api/intake/process-signal-post.js +0 -5
  139. package/dist/runtime-api/intake/process-signal-post.js.map +1 -1
  140. package/dist/runtime-api/intake/scaffold-error-router.js.map +1 -1
  141. package/dist/runtime-api/intake/scanner-launcher.d.ts.map +1 -1
  142. package/dist/runtime-api/intake/scanner-launcher.js +0 -15
  143. package/dist/runtime-api/intake/scanner-launcher.js.map +1 -1
  144. package/dist/runtime-api/intake/types.d.ts +0 -55
  145. package/dist/runtime-api/intake/types.d.ts.map +1 -1
  146. package/dist/runtime-api/routes/signals.d.ts +0 -2
  147. package/dist/runtime-api/routes/signals.d.ts.map +1 -1
  148. package/dist/runtime-api/routes/signals.js +1 -5
  149. package/dist/runtime-api/routes/signals.js.map +1 -1
  150. package/dist/runtime-api/routes/signals.schema.d.ts +0 -43
  151. package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
  152. package/dist/runtime-api/routes/signals.schema.js +0 -43
  153. package/dist/runtime-api/routes/signals.schema.js.map +1 -1
  154. package/dist/runtime-api/server.d.ts +1 -7
  155. package/dist/runtime-api/server.d.ts.map +1 -1
  156. package/dist/runtime-api/server.js +0 -1
  157. package/dist/runtime-api/server.js.map +1 -1
  158. package/dist/scanners/engine/engine.d.ts +1 -22
  159. package/dist/scanners/engine/engine.d.ts.map +1 -1
  160. package/dist/scanners/engine/engine.js +11 -78
  161. package/dist/scanners/engine/engine.js.map +1 -1
  162. package/dist/scanners/engine/lifecycle.d.ts +1 -7
  163. package/dist/scanners/engine/lifecycle.d.ts.map +1 -1
  164. package/dist/scanners/events.d.ts +0 -4
  165. package/dist/scanners/events.d.ts.map +1 -1
  166. package/dist/scanners/events.js +0 -2
  167. package/dist/scanners/events.js.map +1 -1
  168. package/dist/scanners/external/scaffold/delivery.py +25 -194
  169. package/dist/scanners/external/scaffold/scaffold.py +31 -172
  170. package/dist/scanners/external/scaffold/senpi_mcp.py +8 -150
  171. package/dist/scanners/external-scanner-receiver.d.ts +0 -17
  172. package/dist/scanners/external-scanner-receiver.d.ts.map +1 -1
  173. package/dist/scanners/external-scanner-receiver.js +0 -8
  174. package/dist/scanners/external-scanner-receiver.js.map +1 -1
  175. package/dist/scanners/runtime-module.d.ts +0 -1
  176. package/dist/scanners/runtime-module.d.ts.map +1 -1
  177. package/dist/scanners/runtime-module.js +9 -66
  178. package/dist/scanners/runtime-module.js.map +1 -1
  179. package/dist/telemetry/attributes.d.ts +0 -20
  180. package/dist/telemetry/attributes.d.ts.map +1 -1
  181. package/dist/telemetry/attributes.js +0 -24
  182. package/dist/telemetry/attributes.js.map +1 -1
  183. package/dist/telemetry/event-builders.d.ts +6 -81
  184. package/dist/telemetry/event-builders.d.ts.map +1 -1
  185. package/dist/telemetry/event-builders.js +17 -141
  186. package/dist/telemetry/event-builders.js.map +1 -1
  187. package/dist/telemetry/event-store.d.ts +0 -6
  188. package/dist/telemetry/event-store.d.ts.map +1 -1
  189. package/dist/telemetry/event-store.js +8 -12
  190. package/dist/telemetry/event-store.js.map +1 -1
  191. package/dist/telemetry/metrics.d.ts +2 -14
  192. package/dist/telemetry/metrics.d.ts.map +1 -1
  193. package/dist/telemetry/metrics.js +4 -19
  194. package/dist/telemetry/metrics.js.map +1 -1
  195. package/dist/telemetry/spans/redact-pii.d.ts.map +1 -1
  196. package/dist/telemetry/spans/redact-pii.js +2 -18
  197. package/dist/telemetry/spans/redact-pii.js.map +1 -1
  198. package/dist/telemetry/tracing.d.ts +0 -9
  199. package/dist/telemetry/tracing.d.ts.map +1 -1
  200. package/dist/telemetry/tracing.js +0 -36
  201. package/dist/telemetry/tracing.js.map +1 -1
  202. package/dist/types/dsl/index.d.ts +0 -11
  203. package/dist/types/dsl/index.d.ts.map +1 -1
  204. package/dist/types/scanner.d.ts +0 -15
  205. package/dist/types/scanner.d.ts.map +1 -1
  206. package/dist/utils/event-catalog.d.ts +0 -166
  207. package/dist/utils/event-catalog.d.ts.map +1 -1
  208. package/dist/utils/event-catalog.js +0 -18
  209. package/dist/utils/event-catalog.js.map +1 -1
  210. package/dist/utils/logger.d.ts +1 -4
  211. package/dist/utils/logger.d.ts.map +1 -1
  212. package/dist/utils/logger.js.map +1 -1
  213. package/dist/validate/recipe-checks.d.ts.map +1 -1
  214. package/dist/validate/recipe-checks.js +2 -2
  215. package/dist/validate/recipe-checks.js.map +1 -1
  216. package/openclaw.plugin.json +4 -8
  217. package/package.json +1 -1
  218. package/dist/actions/skipped-signal-results.d.ts +0 -25
  219. package/dist/actions/skipped-signal-results.d.ts.map +0 -1
  220. package/dist/actions/skipped-signal-results.js +0 -71
  221. package/dist/actions/skipped-signal-results.js.map +0 -1
  222. package/dist/runtime-api/intake/ingest-request.d.ts +0 -17
  223. package/dist/runtime-api/intake/ingest-request.d.ts.map +0 -1
  224. package/dist/runtime-api/intake/ingest-request.js +0 -34
  225. package/dist/runtime-api/intake/ingest-request.js.map +0 -1
  226. package/dist/runtime-api/intake/scaffold-tick-router.d.ts +0 -39
  227. package/dist/runtime-api/intake/scaffold-tick-router.d.ts.map +0 -1
  228. package/dist/runtime-api/intake/scaffold-tick-router.js +0 -122
  229. package/dist/runtime-api/intake/scaffold-tick-router.js.map +0 -1
  230. package/dist/scanners/external/scaffold/tick_facts.py +0 -130
  231. package/dist/scanners/external/scaffold/ulid.py +0 -58
  232. package/dist/telemetry/live-telemetry.d.ts +0 -238
  233. package/dist/telemetry/live-telemetry.d.ts.map +0 -1
  234. package/dist/telemetry/live-telemetry.js +0 -853
  235. package/dist/telemetry/live-telemetry.js.map +0 -1
  236. package/dist/telemetry/scanner-stats.d.ts +0 -143
  237. package/dist/telemetry/scanner-stats.d.ts.map +0 -1
  238. package/dist/telemetry/scanner-stats.js +0 -426
  239. package/dist/telemetry/scanner-stats.js.map +0 -1
  240. package/dist/telemetry/scanner-tick-feed.d.ts +0 -87
  241. package/dist/telemetry/scanner-tick-feed.d.ts.map +0 -1
  242. package/dist/telemetry/scanner-tick-feed.js +0 -48
  243. package/dist/telemetry/scanner-tick-feed.js.map +0 -1
  244. package/dist/telemetry/strategy-topology.d.ts +0 -99
  245. package/dist/telemetry/strategy-topology.d.ts.map +0 -1
  246. package/dist/telemetry/strategy-topology.js +0 -93
  247. package/dist/telemetry/strategy-topology.js.map +0 -1
  248. package/dist/telemetry/telemetry-publisher.d.ts +0 -63
  249. package/dist/telemetry/telemetry-publisher.d.ts.map +0 -1
  250. package/dist/telemetry/telemetry-publisher.js +0 -229
  251. package/dist/telemetry/telemetry-publisher.js.map +0 -1
  252. package/dist/telemetry/tick-frame.d.ts +0 -212
  253. package/dist/telemetry/tick-frame.d.ts.map +0 -1
  254. package/dist/telemetry/tick-frame.js +0 -421
  255. package/dist/telemetry/tick-frame.js.map +0 -1
  256. package/dist/telemetry/timeline-buffer.d.ts +0 -95
  257. package/dist/telemetry/timeline-buffer.d.ts.map +0 -1
  258. package/dist/telemetry/timeline-buffer.js +0 -237
  259. package/dist/telemetry/timeline-buffer.js.map +0 -1
  260. package/dist/utils/telemetry-required-log.d.ts +0 -60
  261. package/dist/utils/telemetry-required-log.d.ts.map +0 -1
  262. package/dist/utils/telemetry-required-log.js +0 -105
  263. package/dist/utils/telemetry-required-log.js.map +0 -1
  264. package/dist/utils/ulid.d.ts +0 -9
  265. package/dist/utils/ulid.d.ts.map +0 -1
  266. package/dist/utils/ulid.js +0 -43
  267. package/dist/utils/ulid.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"live-telemetry.js","sourceRoot":"","sources":["../../src/telemetry/live-telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAoB,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,sBAAsB,CAAC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G,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,aAAa,EAAE,EAAE,eAAe,CAAC,CAAC;YACtE,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC;YACjE,4DAA4D;YAC3D,UAAqC,CAAC,KAAK,EAAE,EAAE,CAAC;YAChD,WAAsC,CAAC,KAAK,EAAE,EAAE,CAAC;QACpD,CAAC;QAED,IAAI;YACF,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,UAAU,KAAK,SAAS;gBAAE,aAAa,CAAC,UAAU,CAAC,CAAC;YACxD,IAAI,WAAW,KAAK,SAAS;gBAAE,aAAa,CAAC,WAAW,CAAC,CAAC;YAC1D,IAAI,SAAS,KAAK,SAAS;gBAAE,YAAY,CAAC,SAAS,CAAC,CAAC;YACrD,UAAU,GAAG,SAAS,CAAC;YACvB,WAAW,GAAG,SAAS,CAAC;YACxB,SAAS,GAAG,SAAS,CAAC;YACtB,YAAY,GAAG,EAAE,CAAC;YAClB,gBAAgB,GAAG,iBAAiB,CAAC;YACrC,SAAS,GAAG,SAAS,CAAC;YACtB,qBAAqB,GAAG,SAAS,CAAC;YAClC,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC5B,4FAA4F;YAC5F,wBAAwB;YACxB,IAAI,iBAAiB;gBAAE,sBAAsB,EAAE,CAAC;QAClD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,143 +0,0 @@
1
- /**
2
- * The `plugin.senpi.scanner.stats` payload: per-scanner activity counters plus the per-scanner state
3
- * a summary screen needs, built as one pure function of its inputs.
4
- *
5
- * Two halves, from two sources:
6
- * - The **counters** are computed on demand by scanning the recent-window buffer — no second data
7
- * structure, no pre-aggregation on the write path, no retention setting of their own. Records are
8
- * grouped by `(address, scannerId)` and bucketed by timestamp, because `scannerId` alone collides
9
- * across strategies (the engine keys on the same pair).
10
- * - The **state fields** are not derivable from records at all — health, schedule and liveness live in
11
- * the health/system-state providers — so they arrive as {@link ScannerStateSnapshot} inputs and are
12
- * joined on the same key. A scanner known to only one side still gets an entry: counters without
13
- * state read `unknown`, state without counters carries an empty bucket list.
14
- *
15
- * The box never picks the window. It emits fixed-width buckets and the frontend sums however many it
16
- * wants, so one payload serves every client and every window at once. `since` is what makes that sum
17
- * honest: it is the stamp of the oldest record still held, and when nothing is held it is the moment
18
- * this epoch began watching — "I have been watching since X and nothing happened" is a different
19
- * statement from "no data", and only one of them is true.
20
- */
21
- import type { ComponentHealth } from "../health/types.js";
22
- import type { TimelineRecord } from "./timeline-buffer.js";
23
- /**
24
- * Bucket width in ms. It sets two things at once: the payload cost per active scanner, and the finest
25
- * window a frontend can ask for (it can sum buckets, never split one).
26
- *
27
- * 15s divides the windows a summary screen actually shows — 1m is 4 buckets, 5m is 20, 15m is 60 — so
28
- * no rendered window ever needs a partial bucket. It is also about two ticks of the fastest scanner
29
- * the runtime will schedule (built-in cadence is floored at 7s in `runtime-schema.ts`), which keeps a
30
- * bucket from hiding a run while still letting "it went quiet 30 seconds ago" show up. Buckets are
31
- * emitted sparsely, so an idle scanner costs nothing regardless of this value.
32
- *
33
- * This is the number to change once real payload sizes are measured — see also the `bucketMs` input,
34
- * which overrides it per call.
35
- */
36
- export declare const DEFAULT_BUCKET_MS = 15000;
37
- /**
38
- * Ceiling on the buckets one payload may carry, across every scanner and every address.
39
- *
40
- * Buckets are the only part of this payload that grows without a bound of its own. A scanner
41
- * producing one counted record per run fills one bucket per run, so a retention window of N records
42
- * is N buckets on a single scanner, and every address the box runs adds its own series — the state
43
- * rows do not, because there is one per registered scanner. One bucket serialises to about sixty
44
- * bytes, so this budgets them at roughly 60 KiB and leaves the rest of the frame to the rows.
45
- *
46
- * Nothing downstream survives a breach: this payload travels southbound to the bridge, whose
47
- * southbound read limit is 1 MiB unless a deployment sets its own, and a frame past it takes the
48
- * connection down rather than losing the one sample.
49
- *
50
- * The trim cuts at a bucket boundary, so a payload may carry up to one extra bucket per scanner —
51
- * splitting a timestamp across scanners would misalign the series a client sums.
52
- */
53
- export declare const MAX_STATS_BUCKETS = 1000;
54
- /**
55
- * The four counters, which sum to the records counted in the bucket — each counted record
56
- * increments exactly one of them, and one position transition is counted once however many records
57
- * describe it (see {@link classify}). `closes` is its own field because an accepted close is none of
58
- * the other three: it opened nothing, it was not declined, and nothing failed — folding it into any
59
- * of them replaces one wrong number with another.
60
- */
61
- export interface ScannerStatsBucket {
62
- /** Bucket start, epoch ms, aligned to a `bucketMs` grid so buckets line up across scanners. */
63
- readonly t: number;
64
- readonly opens: number;
65
- readonly closes: number;
66
- readonly skips: number;
67
- readonly errors: number;
68
- }
69
- /**
70
- * One scanner's state as the health/system-state providers report it. These fields have no
71
- * representation in the buffer, so the builder takes them rather than reaching into the runtime.
72
- *
73
- * `inFlightSince` is a timestamp, not a boolean: a scan running for 200ms is normal and one running
74
- * for four minutes on a 15s interval is hung, and a boolean cannot tell those apart.
75
- */
76
- export interface ScannerStateSnapshot {
77
- readonly address: string;
78
- readonly scannerId: string;
79
- readonly health: ComponentHealth;
80
- readonly degradedReason?: string | null;
81
- readonly enabled: boolean;
82
- readonly inFlightSince: number | null;
83
- readonly lastRunStartedAt: number | null;
84
- readonly lastRunFinishedAt: number | null;
85
- readonly lastRunStatus: string | null;
86
- readonly lastRunReason: string | null;
87
- readonly nextRunAt: number | null;
88
- readonly lastAliveAt: number | null;
89
- /** Null when no supervision row covers this scanner — a known zero is a different statement. */
90
- readonly restartCount: number | null;
91
- }
92
- /**
93
- * One scanner on the wire. `scannerId` is absent — not null — when the records could not be
94
- * attributed to a scanner; the client buckets those separately rather than seeing them folded into a
95
- * named scanner's numbers. Every state field is `null` when no snapshot covers this scanner, which is
96
- * a different statement from a known `false` or a known `0`.
97
- *
98
- * `degradedReason`, `lastRunStatus` and `lastRunReason` are copied from the snapshot as they were
99
- * given. They are free text captured from a scanner process, so the publisher scrubs and caps them
100
- * on the way out — this builder stays pure and holds no redactor.
101
- */
102
- export interface ScannerStatsEntry {
103
- readonly address: string;
104
- readonly scannerId?: string;
105
- readonly health: ComponentHealth;
106
- readonly degradedReason: string | null;
107
- readonly enabled: boolean | null;
108
- readonly inFlightSince: number | null;
109
- readonly lastRunStartedAt: number | null;
110
- readonly lastRunFinishedAt: number | null;
111
- readonly lastRunStatus: string | null;
112
- readonly lastRunReason: string | null;
113
- readonly nextRunAt: number | null;
114
- readonly lastAliveAt: number | null;
115
- readonly restartCount: number | null;
116
- /** Only buckets with activity, ascending by `t`. A gap means zero, not missing. */
117
- readonly buckets: ScannerStatsBucket[];
118
- }
119
- export interface ScannerStatsPayload {
120
- readonly v: 1;
121
- readonly epoch: string;
122
- readonly sampledAt: number;
123
- /** Oldest record still held, or the buffer's start time when nothing is held. Never absent. */
124
- readonly since: number;
125
- readonly bucketMs: number;
126
- readonly scanners: ScannerStatsEntry[];
127
- }
128
- export interface BuildScannerStatsInput {
129
- /** The buffer's epoch ULID. A change means the box restarted. */
130
- readonly epoch: string;
131
- /** Every record the counters are derived from — the buffer's full held window. */
132
- readonly records: readonly TimelineRecord[];
133
- /** Per-scanner state from the health/system-state providers. */
134
- readonly scannerState: readonly ScannerStateSnapshot[];
135
- /** When this epoch began watching. Used as `since` only while the buffer holds nothing. */
136
- readonly bufferStartedAt: number;
137
- readonly sampledAt: number;
138
- /** Overrides {@link DEFAULT_BUCKET_MS}. Ignored unless it is a finite width of at least 1ms. */
139
- readonly bucketMs?: number;
140
- }
141
- /** Build one `plugin.senpi.scanner.stats` payload. Pure: no timers, no clocks, no runtime reads. */
142
- export declare function buildScannerStats(input: BuildScannerStatsInput): ScannerStatsPayload;
143
- //# sourceMappingURL=scanner-stats.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scanner-stats.d.ts","sourceRoot":"","sources":["../../src/telemetry/scanner-stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,C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AQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvD,2FAA2F;IAC3F,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAqRD,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,mBAAmB,CAuDpF"}
@@ -1,426 +0,0 @@
1
- /**
2
- * The `plugin.senpi.scanner.stats` payload: per-scanner activity counters plus the per-scanner state
3
- * a summary screen needs, built as one pure function of its inputs.
4
- *
5
- * Two halves, from two sources:
6
- * - The **counters** are computed on demand by scanning the recent-window buffer — no second data
7
- * structure, no pre-aggregation on the write path, no retention setting of their own. Records are
8
- * grouped by `(address, scannerId)` and bucketed by timestamp, because `scannerId` alone collides
9
- * across strategies (the engine keys on the same pair).
10
- * - The **state fields** are not derivable from records at all — health, schedule and liveness live in
11
- * the health/system-state providers — so they arrive as {@link ScannerStateSnapshot} inputs and are
12
- * joined on the same key. A scanner known to only one side still gets an entry: counters without
13
- * state read `unknown`, state without counters carries an empty bucket list.
14
- *
15
- * The box never picks the window. It emits fixed-width buckets and the frontend sums however many it
16
- * wants, so one payload serves every client and every window at once. `since` is what makes that sum
17
- * honest: it is the stamp of the oldest record still held, and when nothing is held it is the moment
18
- * this epoch began watching — "I have been watching since X and nothing happened" is a different
19
- * statement from "no data", and only one of them is true.
20
- */
21
- import { normalizeStrategyAddress } from "./event-store.js";
22
- import { createLogger } from "../utils/logger.js";
23
- const logger = createLogger("[senpi-core][scanner-stats]");
24
- /**
25
- * Bucket width in ms. It sets two things at once: the payload cost per active scanner, and the finest
26
- * window a frontend can ask for (it can sum buckets, never split one).
27
- *
28
- * 15s divides the windows a summary screen actually shows — 1m is 4 buckets, 5m is 20, 15m is 60 — so
29
- * no rendered window ever needs a partial bucket. It is also about two ticks of the fastest scanner
30
- * the runtime will schedule (built-in cadence is floored at 7s in `runtime-schema.ts`), which keeps a
31
- * bucket from hiding a run while still letting "it went quiet 30 seconds ago" show up. Buckets are
32
- * emitted sparsely, so an idle scanner costs nothing regardless of this value.
33
- *
34
- * This is the number to change once real payload sizes are measured — see also the `bucketMs` input,
35
- * which overrides it per call.
36
- */
37
- export const DEFAULT_BUCKET_MS = 15_000;
38
- /**
39
- * Ceiling on the buckets one payload may carry, across every scanner and every address.
40
- *
41
- * Buckets are the only part of this payload that grows without a bound of its own. A scanner
42
- * producing one counted record per run fills one bucket per run, so a retention window of N records
43
- * is N buckets on a single scanner, and every address the box runs adds its own series — the state
44
- * rows do not, because there is one per registered scanner. One bucket serialises to about sixty
45
- * bytes, so this budgets them at roughly 60 KiB and leaves the rest of the frame to the rows.
46
- *
47
- * Nothing downstream survives a breach: this payload travels southbound to the bridge, whose
48
- * southbound read limit is 1 MiB unless a deployment sets its own, and a frame past it takes the
49
- * connection down rather than losing the one sample.
50
- *
51
- * The trim cuts at a bucket boundary, so a payload may carry up to one extra bucket per scanner —
52
- * splitting a timestamp across scanners would misalign the series a client sums.
53
- */
54
- export const MAX_STATS_BUCKETS = 1_000;
55
- /**
56
- * The one event carrying an action outcome, one record per evaluation. It carries two kinds of fact:
57
- * a **decision** the runtime made, and a **lifecycle observation** — the runtime noticing a position
58
- * transition that already happened. See {@link classify}.
59
- */
60
- const OUTCOME_EVENT = "signal.outcome";
61
- /** Scanner-side tick failures: the scanner produced nothing, and that is not a decision. */
62
- const ERROR_EVENTS = new Set(["scaffold.tick_error", "scaffold.tick_timeout"]);
63
- const ATTR_OUTCOME_RESULT = "senpi.outcome.result";
64
- const ATTR_ACTION_TYPE = "senpi.action.type";
65
- const ATTR_SIGNAL_TYPE = "senpi.signal.type";
66
- const ATTR_SIGNAL_ASSET = "senpi.signal.asset";
67
- const ATTR_SCANNER_NAME = "senpi.scanner.name";
68
- const ATTR_SCANNER_ID = "senpi.scanner.id";
69
- /** The only disposition meaning an order was actually placed — of either kind. */
70
- const RESULT_ACCEPTED = "accepted";
71
- /** The disposition meaning the attempt itself failed. */
72
- const RESULT_ERROR = "error";
73
- /** The producer's closed disposition set; anything outside it is drift worth a warning. */
74
- const KNOWN_RESULTS = new Set([RESULT_ACCEPTED, "rejected", "blocked", RESULT_ERROR]);
75
- /** The `ActionType` values that tell an accepted decision which bucket it belongs in. */
76
- const ACTION_OPEN = "OPEN_POSITION";
77
- const ACTION_CLOSE = "CLOSE_POSITION";
78
- /**
79
- * The action that reports what it saw rather than what it chose. Its accepted outcomes are lifecycle
80
- * observations, and the transition rides {@link ATTR_SIGNAL_TYPE} — `senpi.action.type` is the same
81
- * value for an opening and a closing, so it cannot tell them apart.
82
- */
83
- const ACTION_TRACKER = "POSITION_TRACKER";
84
- /** The two lifecycle transitions that are an open and a close. */
85
- const SIGNAL_OPENED = "POSITION_OPENED";
86
- const SIGNAL_CLOSED = "POSITION_CLOSED";
87
- /**
88
- * Transitions the tracker reports that are neither an open nor a close. A size change or a flip
89
- * moves no position across the boundary the four buckets count, so they are knowingly counted
90
- * nowhere — listed rather than defaulted, so a sixth transition still warns.
91
- */
92
- const UNCOUNTED_SIGNALS = new Set(["POSITION_INCREASED", "POSITION_DECREASED", "POSITION_FLIPPED"]);
93
- /** Separates the two halves of a group key. Never appears in a wallet or a scanner id. */
94
- const KEY_SEP = "\u0000";
95
- /**
96
- * Distinct unrecognised dispositions already warned about, process-wide. Keyed by value rather than
97
- * one-shot so a second kind of drift is still reported, and never per record — the flush tick can
98
- * carry thousands of them.
99
- */
100
- const warnedResults = new Set();
101
- /** The same, for action types. The empty string keys an outcome that carried none. */
102
- const warnedActionTypes = new Set();
103
- /** The same, for the lifecycle transitions on a tracker row. */
104
- const warnedSignalTypes = new Set();
105
- /**
106
- * The worst overflow warned about so far. A box permanently over the cap would otherwise warn on
107
- * every sample tick, and one that is getting worse would otherwise say so only once.
108
- */
109
- let warnedBucketOverflow = 0;
110
- function key(address, scannerId) {
111
- return `${address}${KEY_SEP}${scannerId ?? ""}`;
112
- }
113
- /**
114
- * Rule 1: `senpi.scanner.id` carries the stable id on `signal.outcome` but the ephemeral, per-spawn id
115
- * on the scaffold tick events, where the stable value rides `senpi.scanner.name`. Reading the id
116
- * unqualified splits one scanner into two on every restart. The tap resolves this; the fallback here
117
- * keeps a record whose tap did not from landing in the unattributed bucket.
118
- */
119
- function resolveScannerId(record) {
120
- if (typeof record.scannerId === "string" && record.scannerId !== "")
121
- return record.scannerId;
122
- const name = record.attrs?.[ATTR_SCANNER_NAME];
123
- if (typeof name === "string" && name !== "")
124
- return name;
125
- const id = record.attrs?.[ATTR_SCANNER_ID];
126
- if (typeof id === "string" && id !== "")
127
- return id;
128
- return undefined;
129
- }
130
- function warnUnknownResult(result) {
131
- if (warnedResults.has(result))
132
- return;
133
- warnedResults.add(result);
134
- logger.warn("signal.outcome carried an unrecognised disposition; counting it as a skip", {
135
- [ATTR_OUTCOME_RESULT]: result,
136
- });
137
- }
138
- function warnUnknownActionType(actionType) {
139
- if (warnedActionTypes.has(actionType))
140
- return;
141
- warnedActionTypes.add(actionType);
142
- logger.warn("an accepted signal.outcome named no action type this counter knows; counting it in no bucket", {
143
- [ATTR_ACTION_TYPE]: actionType === "" ? "(absent)" : actionType,
144
- });
145
- }
146
- function warnUnknownSignalType(signalType) {
147
- if (warnedSignalTypes.has(signalType))
148
- return;
149
- warnedSignalTypes.add(signalType);
150
- logger.warn("a lifecycle observation named a transition this counter knows nothing about; counting it in no bucket", {
151
- [ATTR_SIGNAL_TYPE]: signalType === "" ? "(absent)" : signalType,
152
- });
153
- }
154
- /** One attribute as a string, with an absent or non-string value read as the empty string. */
155
- function attr(record, name) {
156
- const raw = record.attrs?.[name];
157
- return typeof raw === "string" ? raw : "";
158
- }
159
- /**
160
- * Decided transitions a lifecycle observation may still be folded into, as a multiset keyed by
161
- * `(counter, address, asset)`.
162
- *
163
- * A multiset rather than a set because both halves repeat: a strategy that opens, closes and reopens
164
- * the same asset inside one window produces two decided opens and two observed ones, and each
165
- * observation must be absorbed by its own decision. Keyed on the asset rather than
166
- * `senpi.position.id` because the id is systematically absent on an observed close — the tracker
167
- * clears the registry entry before the outcome record is built — so it would join opens only.
168
- */
169
- class DecidedTransitions {
170
- counts = new Map();
171
- static key(counter, address, asset) {
172
- return `${counter}${KEY_SEP}${address}${KEY_SEP}${asset}`;
173
- }
174
- add(counter, address, asset) {
175
- const k = DecidedTransitions.key(counter, address, asset);
176
- this.counts.set(k, (this.counts.get(k) ?? 0) + 1);
177
- }
178
- /** Consume one decision covering this transition; false when none is left to absorb it. */
179
- take(counter, address, asset) {
180
- const k = DecidedTransitions.key(counter, address, asset);
181
- const remaining = this.counts.get(k);
182
- if (remaining === undefined || remaining === 0)
183
- return false;
184
- this.counts.set(k, remaining - 1);
185
- return true;
186
- }
187
- }
188
- /**
189
- * Which of the two order buckets an accepted **decision** feeds.
190
- *
191
- * `closes` is asserted positively — a close is the case that has to be proven. An action type that
192
- * is unrecognised, or absent (the producer omits the attribute rather than stamping a placeholder
193
- * that would poison a counter), feeds no bucket at all: guessing one is what let a third action type
194
- * double every open, and a number that silently absorbs the unclassifiable is worse than a number
195
- * that is one short and a warning that says so. Warned once per distinct value.
196
- */
197
- function decidedCounter(actionType) {
198
- if (actionType === ACTION_CLOSE)
199
- return "closes";
200
- if (actionType === ACTION_OPEN)
201
- return "opens";
202
- warnUnknownActionType(actionType);
203
- return null;
204
- }
205
- /**
206
- * Which bucket an accepted **lifecycle observation** feeds, given the decisions still unabsorbed.
207
- *
208
- * The transition rides `senpi.signal.type`; an opening and a closing share the tracker's action
209
- * type. An observation counts only when no decision already counted the same transition — the
210
- * decision is the better record (it carries the scanner that made the call), so it is the one kept,
211
- * and the observation is folded into it. What is left over is real and otherwise unrecorded: an
212
- * externally-opened position nothing decided, and — the dominant case — a DSL exit, which closes
213
- * through the MCP client without ever routing through `ClosePositionAction` and so emits no
214
- * `CLOSE_POSITION` outcome to be counted.
215
- */
216
- function observedCounter(record, decided) {
217
- const signalType = attr(record, ATTR_SIGNAL_TYPE);
218
- let counter;
219
- if (signalType === SIGNAL_OPENED)
220
- counter = "opens";
221
- else if (signalType === SIGNAL_CLOSED)
222
- counter = "closes";
223
- else {
224
- if (!UNCOUNTED_SIGNALS.has(signalType))
225
- warnUnknownSignalType(signalType);
226
- return null;
227
- }
228
- const address = normalizeStrategyAddress(record.address);
229
- return decided.take(counter, address, attr(record, ATTR_SIGNAL_ASSET)) ? null : counter;
230
- }
231
- /**
232
- * Which counter a record feeds, or `null` when it feeds none.
233
- *
234
- * **The invariant:** `opens + closes + skips + errors` equals the number of records this counter
235
- * accepted, each contributing exactly one, and one position transition is counted once however many
236
- * records describe it. A record is counted nowhere — and warned about — when it cannot be placed:
237
- * an unrecognised or absent action type, a lifecycle transition this counter does not model, and an
238
- * observation of a transition a decision has already counted.
239
- *
240
- * An order leaving the box is asserted positively: `accepted` is the single disposition that means
241
- * one did (`disposition()` in `event-builders.ts` maps the executed result to it). What the action
242
- * type then settles is not only which bucket but which *kind of fact* the record is — a decision the
243
- * runtime made, or an observation of a transition that already happened. Everything else that
244
- * reached a decision placed no order, so `rejected` (actively gated) and `blocked` (not attempted)
245
- * both read as a skip, and so does any value the producer adds later — an unrecognised disposition
246
- * is warned about rather than silently dropped.
247
- *
248
- * A failed attempt is an `error`, not an open or a close (nothing was placed) and not a skip (it was
249
- * not declined) — which is as true of a close as of an open, and of a lifecycle event the tracker
250
- * failed to record, so the action type splits the accepted case only. The scaffold tick failures
251
- * land in the same counter: from the summary screen both mean the scanner lost work to a fault.
252
- */
253
- function classify(record, decided) {
254
- if (ERROR_EVENTS.has(record.name))
255
- return "errors";
256
- if (record.name !== OUTCOME_EVENT)
257
- return null;
258
- const result = attr(record, ATTR_OUTCOME_RESULT);
259
- if (result === RESULT_ACCEPTED) {
260
- const actionType = attr(record, ATTR_ACTION_TYPE);
261
- return actionType === ACTION_TRACKER ? observedCounter(record, decided) : decidedCounter(actionType);
262
- }
263
- if (result === RESULT_ERROR)
264
- return "errors";
265
- if (!KNOWN_RESULTS.has(result))
266
- warnUnknownResult(result);
267
- return "skips";
268
- }
269
- /**
270
- * The decided transitions the observations in this window may be folded into: one entry per accepted
271
- * `OPEN_POSITION` / `CLOSE_POSITION`.
272
- *
273
- * A whole pass ahead of the counting loop, because the observation trails its decision by up to one
274
- * tracker poll and can land in a later bucket — a running tally would fold only the ones that happen
275
- * to arrive first. Scoped to the window: a decision evicted from the buffer no longer absorbs
276
- * anything, so its observation reads as an open nothing decided, which is exactly what the records
277
- * still held say.
278
- */
279
- function collectDecidedTransitions(records) {
280
- const decided = new DecidedTransitions();
281
- for (const record of records) {
282
- if (!Number.isFinite(record.ts) || record.name !== OUTCOME_EVENT)
283
- continue;
284
- if (attr(record, ATTR_OUTCOME_RESULT) !== RESULT_ACCEPTED)
285
- continue;
286
- const actionType = attr(record, ATTR_ACTION_TYPE);
287
- if (actionType !== ACTION_OPEN && actionType !== ACTION_CLOSE)
288
- continue;
289
- decided.add(actionType === ACTION_OPEN ? "opens" : "closes", normalizeStrategyAddress(record.address), attr(record, ATTR_SIGNAL_ASSET));
290
- }
291
- return decided;
292
- }
293
- /**
294
- * The oldest bucket start the payload may keep, or undefined when everything fits. Chosen so the
295
- * kept buckets number at most {@link MAX_STATS_BUCKETS}, cut on a timestamp so every scanner's
296
- * series starts at the same place.
297
- */
298
- function trimCutoff(groups) {
299
- const starts = [];
300
- for (const group of groups)
301
- for (const t of group.buckets.keys())
302
- starts.push(t);
303
- if (starts.length <= MAX_STATS_BUCKETS)
304
- return undefined;
305
- starts.sort((a, b) => b - a);
306
- const cutoff = starts[MAX_STATS_BUCKETS - 1];
307
- const dropped = starts.filter((t) => t < cutoff).length;
308
- if (dropped > warnedBucketOverflow) {
309
- warnedBucketOverflow = dropped;
310
- logger.warn("scanner stats dropped its oldest buckets to keep the payload inside one frame", {
311
- "senpi.telemetry.buckets_dropped": dropped,
312
- "senpi.telemetry.buckets_kept": starts.length - dropped,
313
- "senpi.telemetry.bucket_limit": MAX_STATS_BUCKETS,
314
- });
315
- }
316
- return cutoff;
317
- }
318
- function resolveBucketMs(requested) {
319
- if (requested === undefined)
320
- return DEFAULT_BUCKET_MS;
321
- // A zero or negative width makes every bucket key Infinity or NaN, which would collapse the whole
322
- // series into one unreadable bucket rather than fail loudly.
323
- return Number.isFinite(requested) && requested >= 1 ? Math.floor(requested) : DEFAULT_BUCKET_MS;
324
- }
325
- function groupFor(groups, address, scannerId) {
326
- const k = key(address, scannerId);
327
- let group = groups.get(k);
328
- if (group === undefined) {
329
- group = { address, ...(scannerId !== undefined ? { scannerId } : {}), buckets: new Map() };
330
- groups.set(k, group);
331
- }
332
- return group;
333
- }
334
- /** Address, then scanner id, with the unattributed entry last so it reads as a footnote. */
335
- function compareEntries(a, b) {
336
- if (a.address !== b.address)
337
- return a.address < b.address ? -1 : 1;
338
- if (a.scannerId === b.scannerId)
339
- return 0;
340
- if (a.scannerId === undefined)
341
- return 1;
342
- if (b.scannerId === undefined)
343
- return -1;
344
- return a.scannerId < b.scannerId ? -1 : 1;
345
- }
346
- function toEntry(group, snapshot, cutoff) {
347
- const buckets = [...group.buckets.entries()]
348
- .filter(([t]) => cutoff === undefined || t >= cutoff)
349
- .sort(([a], [b]) => a - b)
350
- .map(([t, counts]) => ({
351
- t,
352
- opens: counts.opens,
353
- closes: counts.closes,
354
- skips: counts.skips,
355
- errors: counts.errors,
356
- }));
357
- return {
358
- address: group.address,
359
- ...(group.scannerId !== undefined ? { scannerId: group.scannerId } : {}),
360
- health: snapshot?.health ?? "unknown",
361
- degradedReason: snapshot?.degradedReason ?? null,
362
- enabled: snapshot?.enabled ?? null,
363
- inFlightSince: snapshot?.inFlightSince ?? null,
364
- lastRunStartedAt: snapshot?.lastRunStartedAt ?? null,
365
- lastRunFinishedAt: snapshot?.lastRunFinishedAt ?? null,
366
- lastRunStatus: snapshot?.lastRunStatus ?? null,
367
- lastRunReason: snapshot?.lastRunReason ?? null,
368
- nextRunAt: snapshot?.nextRunAt ?? null,
369
- lastAliveAt: snapshot?.lastAliveAt ?? null,
370
- restartCount: snapshot?.restartCount ?? null,
371
- buckets,
372
- };
373
- }
374
- /** Build one `plugin.senpi.scanner.stats` payload. Pure: no timers, no clocks, no runtime reads. */
375
- export function buildScannerStats(input) {
376
- const bucketMs = resolveBucketMs(input.bucketMs);
377
- const groups = new Map();
378
- const snapshots = new Map();
379
- // Seeded first so a scanner the providers know about still gets an entry when it has produced
380
- // nothing — a silent scanner is a fact the summary screen must be able to show.
381
- for (const snapshot of input.scannerState) {
382
- const address = normalizeStrategyAddress(snapshot.address);
383
- snapshots.set(key(address, snapshot.scannerId), snapshot);
384
- groupFor(groups, address, snapshot.scannerId);
385
- }
386
- const decided = collectDecidedTransitions(input.records);
387
- let oldest;
388
- for (const record of input.records) {
389
- const ts = record.ts;
390
- if (!Number.isFinite(ts))
391
- continue;
392
- // `since` tracks every held record, not only the counted ones: it describes the window the client
393
- // is reading, which is the whole buffer.
394
- if (oldest === undefined || ts < oldest)
395
- oldest = ts;
396
- const counter = classify(record, decided);
397
- if (counter === null)
398
- continue;
399
- const group = groupFor(groups, normalizeStrategyAddress(record.address), resolveScannerId(record));
400
- const t = Math.floor(ts / bucketMs) * bucketMs;
401
- let counts = group.buckets.get(t);
402
- if (counts === undefined) {
403
- counts = { opens: 0, closes: 0, skips: 0, errors: 0 };
404
- group.buckets.set(t, counts);
405
- }
406
- counts[counter] += 1;
407
- }
408
- const cutoff = trimCutoff(groups.values());
409
- const scanners = [...groups.entries()]
410
- .map(([k, group]) => toEntry(group, snapshots.get(k), cutoff))
411
- .sort(compareEntries);
412
- // A broken start time must not put a non-finite `since` on the wire — it serialises to null and
413
- // the client's truncation check silently stops working.
414
- const held = oldest ?? (Number.isFinite(input.bufferStartedAt) ? input.bufferStartedAt : input.sampledAt);
415
- return {
416
- v: 1,
417
- epoch: input.epoch,
418
- sampledAt: input.sampledAt,
419
- // `since` labels the counters, so a trim moves it: the buckets no longer reach back to the
420
- // oldest record held, and a client summing them from an older mark would read the gap as zeros.
421
- since: cutoff !== undefined && cutoff > held ? cutoff : held,
422
- bucketMs,
423
- scanners,
424
- };
425
- }
426
- //# sourceMappingURL=scanner-stats.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scanner-stats.js","sourceRoot":"","sources":["../../src/telemetry/scanner-stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC;;;;GAIG;AACH,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC,4FAA4F;AAC5F,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAE/E,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C,kFAAkF;AAClF,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,yDAAyD;AACzD,MAAM,YAAY,GAAG,OAAO,CAAC;AAC7B,2FAA2F;AAC3F,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,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