@jam-overture/loom 0.1.0 → 0.3.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 (414) hide show
  1. package/README.md +3 -1
  2. package/dist/application/application.d.ts +109 -0
  3. package/dist/application/application.js +97 -0
  4. package/dist/application/memory.d.ts +20 -0
  5. package/dist/application/memory.js +79 -0
  6. package/dist/application/store.d.ts +101 -0
  7. package/dist/application/store.js +25 -0
  8. package/dist/audience/audience.d.ts +36 -0
  9. package/dist/audience/audience.js +41 -0
  10. package/dist/audience/compose.d.ts +112 -0
  11. package/dist/audience/compose.js +134 -0
  12. package/dist/audience/memory.d.ts +14 -0
  13. package/dist/audience/memory.js +71 -0
  14. package/dist/audience/overlay-store.d.ts +343 -0
  15. package/dist/audience/overlay-store.js +217 -0
  16. package/dist/audience/rule.d.ts +121 -0
  17. package/dist/audience/rule.js +78 -0
  18. package/dist/cli/index.d.ts +3 -4
  19. package/dist/cli/index.js +3 -4
  20. package/dist/cli/templates.js +19 -0
  21. package/dist/data/adapter.d.ts +9 -1
  22. package/dist/data/adapter.js +2 -0
  23. package/dist/data/plan.js +0 -0
  24. package/dist/data/resolution.d.ts +23 -1
  25. package/dist/data/resolve.d.ts +31 -4
  26. package/dist/data/resolve.js +11 -3
  27. package/dist/ids.d.ts +10 -0
  28. package/dist/ids.js +11 -1
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +1 -0
  31. package/dist/interpretation/anthropic.d.ts +1 -1
  32. package/dist/interpretation/anthropic.js +2 -22
  33. package/dist/interpretation/client.d.ts +1 -1
  34. package/dist/interpretation/materialize.js +67 -22
  35. package/dist/interpretation/openai-compatible.d.ts +36 -0
  36. package/dist/interpretation/openai-compatible.js +79 -0
  37. package/dist/interpretation/status.d.ts +19 -0
  38. package/dist/interpretation/status.js +26 -0
  39. package/dist/live/index.d.ts +73 -0
  40. package/dist/live/index.js +73 -0
  41. package/dist/live/pages.d.ts +187 -0
  42. package/dist/live/pages.js +161 -0
  43. package/dist/live/pull.d.ts +147 -0
  44. package/dist/live/pull.js +398 -0
  45. package/dist/live/pulling.d.ts +79 -0
  46. package/dist/live/pulling.js +117 -0
  47. package/dist/live/window.d.ts +129 -0
  48. package/dist/live/window.js +132 -0
  49. package/dist/patch.d.ts +54 -0
  50. package/dist/patch.js +44 -0
  51. package/dist/project/closing.d.ts +51 -0
  52. package/dist/project/closing.js +53 -0
  53. package/dist/project/memory.d.ts +20 -0
  54. package/dist/project/memory.js +97 -0
  55. package/dist/project/project.d.ts +90 -0
  56. package/dist/project/project.js +91 -0
  57. package/dist/project/store.d.ts +135 -0
  58. package/dist/project/store.js +41 -0
  59. package/dist/registered.d.ts +64 -0
  60. package/dist/registered.js +118 -0
  61. package/dist/render/addressed.d.ts +35 -0
  62. package/dist/render/addressed.js +79 -0
  63. package/dist/render/behaviour-adjust.d.ts +11 -19
  64. package/dist/render/behaviour-adjust.js +75 -21
  65. package/dist/render/behaviour-present.d.ts +8 -0
  66. package/dist/render/behaviour-present.js +57 -6
  67. package/dist/render/behaviour.d.ts +98 -17
  68. package/dist/render/behaviour.js +91 -26
  69. package/dist/render/control-name.d.ts +68 -0
  70. package/dist/render/control-name.js +37 -0
  71. package/dist/render/diagnostics.d.ts +72 -0
  72. package/dist/render/diagnostics.js +7 -0
  73. package/dist/render/document-theme.d.ts +70 -0
  74. package/dist/render/document-theme.js +139 -0
  75. package/dist/render/editable.d.ts +15 -1
  76. package/dist/render/editable.js +13 -1
  77. package/dist/render/expected.d.ts +98 -0
  78. package/dist/render/expected.js +88 -0
  79. package/dist/render/index.d.ts +4 -0
  80. package/dist/render/index.js +4 -0
  81. package/dist/render/reads.d.ts +11 -0
  82. package/dist/render/reads.js +12 -1
  83. package/dist/render/render.d.ts +11 -0
  84. package/dist/render/render.js +294 -53
  85. package/dist/render/request.d.ts +8 -1
  86. package/dist/render/request.js +1 -0
  87. package/dist/render/slots.d.ts +52 -0
  88. package/dist/render/slots.js +24 -0
  89. package/dist/render/theme.d.ts +54 -1
  90. package/dist/render/theme.js +23 -1
  91. package/dist/render/unshown.d.ts +152 -0
  92. package/dist/render/unshown.js +80 -0
  93. package/dist/runtime/analysis.d.ts +94 -9
  94. package/dist/runtime/analysis.js +54 -9
  95. package/dist/runtime/assessment.d.ts +36 -2
  96. package/dist/runtime/assessment.js +27 -2
  97. package/dist/runtime/auto-apply-ceiling.d.ts +54 -0
  98. package/dist/runtime/auto-apply-ceiling.js +66 -0
  99. package/dist/runtime/checks.d.ts +148 -0
  100. package/dist/runtime/checks.js +112 -0
  101. package/dist/runtime/disposition.d.ts +96 -0
  102. package/dist/runtime/disposition.js +46 -0
  103. package/dist/runtime/gate.js +91 -10
  104. package/dist/runtime/index.d.ts +4 -0
  105. package/dist/runtime/index.js +4 -0
  106. package/dist/runtime/irreversibility.d.ts +64 -0
  107. package/dist/runtime/irreversibility.js +45 -0
  108. package/dist/runtime/nesting.d.ts +13 -1
  109. package/dist/runtime/nesting.js +41 -24
  110. package/dist/runtime/pipeline.d.ts +43 -0
  111. package/dist/runtime/pipeline.js +10 -2
  112. package/dist/runtime/policy-change.d.ts +93 -0
  113. package/dist/runtime/policy-change.js +305 -0
  114. package/dist/runtime/policy-log.d.ts +406 -0
  115. package/dist/runtime/policy-log.js +285 -0
  116. package/dist/runtime/policy.d.ts +8 -6
  117. package/dist/runtime/policy.js +5 -2
  118. package/dist/runtime/repointing.js +0 -0
  119. package/dist/runtime/reversibility.d.ts +11 -9
  120. package/dist/runtime/stakes.d.ts +129 -1
  121. package/dist/runtime/stakes.js +240 -26
  122. package/dist/runtime/vocabulary.d.ts +164 -7
  123. package/dist/runtime/vocabulary.js +181 -8
  124. package/dist/sdk/audit.d.ts +174 -3
  125. package/dist/sdk/audit.js +176 -17
  126. package/dist/sdk/catalogue.d.ts +9 -1
  127. package/dist/sdk/conformance.d.ts +37 -3
  128. package/dist/sdk/conformance.js +25 -4
  129. package/dist/sdk/definition.d.ts +129 -5
  130. package/dist/sdk/definition.js +66 -0
  131. package/dist/sdk/registry.d.ts +45 -2
  132. package/dist/sdk/registry.js +102 -1
  133. package/dist/signals/acted.contract.d.ts +21 -0
  134. package/dist/signals/acted.contract.js +236 -0
  135. package/dist/signals/acted.d.ts +359 -0
  136. package/dist/signals/acted.js +135 -0
  137. package/dist/signals/action-change.d.ts +507 -0
  138. package/dist/signals/action-change.js +265 -0
  139. package/dist/signals/action.d.ts +331 -0
  140. package/dist/signals/action.js +182 -0
  141. package/dist/signals/agenda.d.ts +585 -0
  142. package/dist/signals/agenda.js +295 -0
  143. package/dist/signals/applied-window.contract.d.ts +23 -0
  144. package/dist/signals/applied-window.contract.js +160 -0
  145. package/dist/signals/arrivals.contract.d.ts +21 -0
  146. package/dist/signals/arrivals.contract.js +180 -0
  147. package/dist/signals/arrivals.d.ts +375 -0
  148. package/dist/signals/arrivals.js +254 -0
  149. package/dist/signals/arriving.d.ts +210 -0
  150. package/dist/signals/arriving.js +133 -0
  151. package/dist/signals/audiences.d.ts +528 -0
  152. package/dist/signals/audiences.js +255 -0
  153. package/dist/signals/broadcast.d.ts +33 -17
  154. package/dist/signals/broadcast.js +255 -32
  155. package/dist/signals/change.d.ts +378 -0
  156. package/dist/signals/change.js +327 -0
  157. package/dist/signals/collect.d.ts +169 -34
  158. package/dist/signals/collect.js +186 -38
  159. package/dist/signals/conversion.d.ts +348 -0
  160. package/dist/signals/conversion.js +235 -0
  161. package/dist/signals/copy-change.d.ts +553 -0
  162. package/dist/signals/copy-change.js +377 -0
  163. package/dist/signals/copy.d.ts +337 -0
  164. package/dist/signals/copy.js +211 -0
  165. package/dist/signals/correlated.contract.d.ts +24 -0
  166. package/dist/signals/correlated.contract.js +94 -0
  167. package/dist/signals/counters.d.ts +97 -0
  168. package/dist/signals/counters.js +160 -0
  169. package/dist/signals/deliver.d.ts +23 -4
  170. package/dist/signals/deliver.js +34 -6
  171. package/dist/signals/deployment-change.d.ts +395 -0
  172. package/dist/signals/deployment-change.js +309 -0
  173. package/dist/signals/deployment.d.ts +278 -0
  174. package/dist/signals/deployment.js +178 -0
  175. package/dist/signals/door.d.ts +114 -0
  176. package/dist/signals/door.js +77 -0
  177. package/dist/signals/expire.d.ts +192 -0
  178. package/dist/signals/expire.js +213 -0
  179. package/dist/signals/fold.d.ts +10 -0
  180. package/dist/signals/fold.js +5 -1
  181. package/dist/signals/form-action.d.ts +302 -0
  182. package/dist/signals/form-action.js +169 -0
  183. package/dist/signals/form-copy.d.ts +523 -0
  184. package/dist/signals/form-copy.js +346 -0
  185. package/dist/signals/forms.d.ts +247 -0
  186. package/dist/signals/forms.js +147 -0
  187. package/dist/signals/frontier.d.ts +268 -0
  188. package/dist/signals/frontier.js +145 -0
  189. package/dist/signals/funnel-change.d.ts +548 -0
  190. package/dist/signals/funnel-change.js +361 -0
  191. package/dist/signals/funnel-hours.contract.d.ts +21 -0
  192. package/dist/signals/funnel-hours.contract.js +221 -0
  193. package/dist/signals/funnel-hours.d.ts +293 -0
  194. package/dist/signals/funnel-hours.js +99 -0
  195. package/dist/signals/funnel.d.ts +592 -0
  196. package/dist/signals/funnel.js +231 -0
  197. package/dist/signals/health.d.ts +694 -0
  198. package/dist/signals/health.js +573 -0
  199. package/dist/signals/index.d.ts +60 -0
  200. package/dist/signals/index.js +60 -0
  201. package/dist/signals/ingest.d.ts +56 -1
  202. package/dist/signals/ingest.js +91 -1
  203. package/dist/signals/inside.d.ts +190 -0
  204. package/dist/signals/inside.js +263 -0
  205. package/dist/signals/join.d.ts +56 -0
  206. package/dist/signals/join.js +60 -0
  207. package/dist/signals/journal.d.ts +123 -9
  208. package/dist/signals/kept.contract.d.ts +22 -0
  209. package/dist/signals/kept.contract.js +111 -0
  210. package/dist/signals/kinds.d.ts +8 -6
  211. package/dist/signals/kinds.js +14 -6
  212. package/dist/signals/library-action.d.ts +430 -0
  213. package/dist/signals/library-action.js +336 -0
  214. package/dist/signals/library-agenda-change.d.ts +324 -0
  215. package/dist/signals/library-agenda-change.js +199 -0
  216. package/dist/signals/library-agenda.d.ts +258 -0
  217. package/dist/signals/library-agenda.js +167 -0
  218. package/dist/signals/library-change.d.ts +477 -0
  219. package/dist/signals/library-change.js +335 -0
  220. package/dist/signals/library-copy-change.d.ts +498 -0
  221. package/dist/signals/library-copy-change.js +476 -0
  222. package/dist/signals/library-pace.d.ts +319 -0
  223. package/dist/signals/library-pace.js +305 -0
  224. package/dist/signals/library-reach-change.d.ts +646 -0
  225. package/dist/signals/library-reach-change.js +542 -0
  226. package/dist/signals/library-reach.d.ts +377 -0
  227. package/dist/signals/library-reach.js +227 -0
  228. package/dist/signals/library-senders-change.d.ts +457 -0
  229. package/dist/signals/library-senders-change.js +367 -0
  230. package/dist/signals/library-senders-reach-change.d.ts +486 -0
  231. package/dist/signals/library-senders-reach-change.js +538 -0
  232. package/dist/signals/library-senders-reach.d.ts +340 -0
  233. package/dist/signals/library-senders-reach.js +252 -0
  234. package/dist/signals/library-senders.d.ts +271 -0
  235. package/dist/signals/library-senders.js +180 -0
  236. package/dist/signals/library-word-reach-change.d.ts +567 -0
  237. package/dist/signals/library-word-reach-change.js +564 -0
  238. package/dist/signals/library.d.ts +306 -0
  239. package/dist/signals/library.js +178 -0
  240. package/dist/signals/memory.d.ts +9 -0
  241. package/dist/signals/memory.js +246 -14
  242. package/dist/signals/migrate.d.ts +20 -4
  243. package/dist/signals/migrate.js +269 -8
  244. package/dist/signals/notice.d.ts +389 -0
  245. package/dist/signals/notice.js +250 -0
  246. package/dist/signals/pace-change.d.ts +501 -0
  247. package/dist/signals/pace-change.js +310 -0
  248. package/dist/signals/pace.d.ts +296 -0
  249. package/dist/signals/pace.js +291 -0
  250. package/dist/signals/page-views.d.ts +365 -0
  251. package/dist/signals/page-views.js +218 -0
  252. package/dist/signals/part-pace.d.ts +378 -0
  253. package/dist/signals/part-pace.js +333 -0
  254. package/dist/signals/parts.d.ts +354 -0
  255. package/dist/signals/parts.js +232 -0
  256. package/dist/signals/postgres.d.ts +16 -2
  257. package/dist/signals/postgres.js +753 -76
  258. package/dist/signals/progress.d.ts +212 -0
  259. package/dist/signals/progress.js +150 -0
  260. package/dist/signals/ratios.d.ts +108 -0
  261. package/dist/signals/ratios.js +40 -0
  262. package/dist/signals/reach.d.ts +309 -0
  263. package/dist/signals/reach.js +93 -0
  264. package/dist/signals/readable.d.ts +34 -0
  265. package/dist/signals/readable.js +34 -0
  266. package/dist/signals/readership.d.ts +381 -0
  267. package/dist/signals/readership.js +308 -0
  268. package/dist/signals/region-pages.d.ts +173 -0
  269. package/dist/signals/region-pages.js +62 -0
  270. package/dist/signals/region.d.ts +287 -0
  271. package/dist/signals/region.js +198 -0
  272. package/dist/signals/retention.d.ts +163 -0
  273. package/dist/signals/retention.js +75 -0
  274. package/dist/signals/rhythm.d.ts +302 -0
  275. package/dist/signals/rhythm.js +262 -0
  276. package/dist/signals/rollup.d.ts +194 -4
  277. package/dist/signals/rollup.js +0 -0
  278. package/dist/signals/schema.d.ts +1069 -1
  279. package/dist/signals/schema.js +393 -3
  280. package/dist/signals/signal.d.ts +237 -11
  281. package/dist/signals/signal.js +70 -10
  282. package/dist/signals/silence-census.d.ts +205 -0
  283. package/dist/signals/silence-census.js +87 -0
  284. package/dist/signals/silences.d.ts +1147 -0
  285. package/dist/signals/silences.js +996 -0
  286. package/dist/signals/subtrees.d.ts +123 -0
  287. package/dist/signals/subtrees.js +102 -0
  288. package/dist/signals/tally.d.ts +262 -12
  289. package/dist/signals/unread.d.ts +292 -0
  290. package/dist/signals/unread.js +137 -0
  291. package/dist/signals/window-agenda.d.ts +276 -0
  292. package/dist/signals/window-agenda.js +83 -0
  293. package/dist/signals/window-figures.d.ts +148 -0
  294. package/dist/signals/window-figures.js +42 -0
  295. package/dist/signals/window-funnels.d.ts +88 -0
  296. package/dist/signals/window-funnels.js +47 -0
  297. package/dist/signals/window.d.ts +866 -0
  298. package/dist/signals/window.js +693 -0
  299. package/dist/signals/words.d.ts +24 -0
  300. package/dist/signals/words.js +24 -0
  301. package/dist/store/cache.d.ts +101 -0
  302. package/dist/store/cache.js +149 -0
  303. package/dist/store/history.d.ts +82 -0
  304. package/dist/store/history.js +36 -0
  305. package/dist/store/index.d.ts +30 -0
  306. package/dist/store/index.js +30 -0
  307. package/dist/store/memory.d.ts +2 -1
  308. package/dist/store/memory.js +48 -12
  309. package/dist/store/migrate.d.ts +106 -0
  310. package/dist/store/migrate.js +323 -7
  311. package/dist/store/postgres-applications.d.ts +4 -0
  312. package/dist/store/postgres-applications.js +197 -0
  313. package/dist/store/postgres-audience.d.ts +14 -0
  314. package/dist/store/postgres-audience.js +272 -0
  315. package/dist/store/postgres-holds.d.ts +10 -1
  316. package/dist/store/postgres-holds.js +116 -101
  317. package/dist/store/postgres-policy-log.d.ts +14 -0
  318. package/dist/store/postgres-policy-log.js +240 -0
  319. package/dist/store/postgres-projects.d.ts +4 -0
  320. package/dist/store/postgres-projects.js +217 -0
  321. package/dist/store/postgres.d.ts +17 -1
  322. package/dist/store/postgres.js +60 -9
  323. package/dist/store/replay.d.ts +102 -1
  324. package/dist/store/replay.js +190 -19
  325. package/dist/store/reseed.d.ts +238 -0
  326. package/dist/store/reseed.js +308 -0
  327. package/dist/store/schema.d.ts +762 -2
  328. package/dist/store/schema.js +218 -5
  329. package/dist/store/source.d.ts +57 -1
  330. package/dist/store/source.js +65 -1
  331. package/dist/store/store.d.ts +29 -6
  332. package/dist/submit/resolve.d.ts +1 -1
  333. package/dist/submit/resolve.js +2 -1
  334. package/dist/telemetry/calibration.d.ts +25 -0
  335. package/dist/telemetry/calibration.js +27 -1
  336. package/dist/telemetry/event.d.ts +391 -33
  337. package/dist/telemetry/event.js +84 -20
  338. package/dist/telemetry/index.d.ts +2 -0
  339. package/dist/telemetry/index.js +2 -0
  340. package/dist/telemetry/journal.d.ts +104 -3
  341. package/dist/telemetry/journal.js +9 -0
  342. package/dist/telemetry/lookup.d.ts +27 -0
  343. package/dist/telemetry/lookup.js +18 -0
  344. package/dist/telemetry/memory.js +33 -1
  345. package/dist/telemetry/migrate.js +22 -1
  346. package/dist/telemetry/postgres.d.ts +10 -1
  347. package/dist/telemetry/postgres.js +188 -90
  348. package/dist/telemetry/remeasure.d.ts +78 -0
  349. package/dist/telemetry/remeasure.js +83 -0
  350. package/dist/telemetry/retention.d.ts +2 -2
  351. package/dist/telemetry/schema.d.ts +17 -0
  352. package/dist/telemetry/schema.js +27 -1
  353. package/dist/telemetry/sink.d.ts +2 -2
  354. package/dist/telemetry/window.d.ts +135 -0
  355. package/dist/telemetry/window.js +101 -0
  356. package/dist/testing/application-contract.d.ts +14 -0
  357. package/dist/testing/application-contract.js +270 -0
  358. package/dist/testing/audience-overlay-contract.d.ts +31 -0
  359. package/dist/testing/audience-overlay-contract.js +354 -0
  360. package/dist/testing/contracts.d.ts +13 -7
  361. package/dist/testing/contracts.js +13 -7
  362. package/dist/testing/definitions.d.ts +78 -0
  363. package/dist/testing/definitions.js +134 -9
  364. package/dist/testing/doubles.d.ts +103 -0
  365. package/dist/testing/doubles.js +143 -0
  366. package/dist/testing/index.d.ts +2 -2
  367. package/dist/testing/index.js +2 -2
  368. package/dist/testing/journal-contract.js +297 -6
  369. package/dist/testing/model-contract.d.ts +110 -0
  370. package/dist/testing/model-contract.js +150 -0
  371. package/dist/testing/policy-log-contract.d.ts +26 -0
  372. package/dist/testing/policy-log-contract.js +344 -0
  373. package/dist/testing/project-contract.d.ts +14 -0
  374. package/dist/testing/project-contract.js +266 -0
  375. package/dist/testing/reader-signal-contract.d.ts +27 -2
  376. package/dist/testing/reader-signal-contract.js +475 -5
  377. package/dist/testing/store-contract.d.ts +7 -1
  378. package/dist/testing/store-contract.js +84 -3
  379. package/dist/theme/apply.d.ts +20 -1
  380. package/dist/theme/apply.js +5 -3
  381. package/dist/theme/contrast.d.ts +19 -14
  382. package/dist/theme/contrast.js +181 -17
  383. package/dist/theme/derive.d.ts +22 -0
  384. package/dist/theme/derive.js +54 -1
  385. package/dist/theme/library.js +1 -1
  386. package/dist/theme/measure.d.ts +34 -0
  387. package/dist/theme/measure.js +30 -1
  388. package/dist/theme/palettes.js +7 -7
  389. package/dist/theme/ramp.d.ts +64 -0
  390. package/dist/theme/ramp.js +114 -0
  391. package/dist/theme/registry.d.ts +9 -0
  392. package/dist/theme/registry.js +11 -1
  393. package/dist/theme/separation.d.ts +97 -3
  394. package/dist/theme/separation.js +75 -0
  395. package/dist/tree/apply.js +13 -0
  396. package/dist/tree/compare.d.ts +9 -0
  397. package/dist/tree/compare.js +18 -0
  398. package/dist/tree/mutation.d.ts +18 -0
  399. package/dist/tree/mutation.js +24 -12
  400. package/dist/tree/navigation.d.ts +5 -0
  401. package/dist/tree/navigation.js +32 -10
  402. package/dist/tree/outline.d.ts +7 -0
  403. package/dist/tree/outline.js +9 -5
  404. package/dist/write/computed.d.ts +60 -0
  405. package/dist/write/computed.js +61 -0
  406. package/dist/write/held.d.ts +59 -0
  407. package/dist/write/index.d.ts +5 -2
  408. package/dist/write/index.js +5 -2
  409. package/dist/write/reseed.d.ts +151 -0
  410. package/dist/write/reseed.js +184 -0
  411. package/dist/write/revert.js +2 -16
  412. package/package.json +25 -3
  413. package/dist/runtime/inverse-interpreter.d.ts +0 -90
  414. package/dist/runtime/inverse-interpreter.js +0 -56
@@ -0,0 +1,178 @@
1
+ import { everyMemberOf } from "../closed-set.js";
2
+ import { audienceScopeRead, readingKeyOf } from "./audiences.js";
3
+ import { atDoorScale, doorOf } from "./door.js";
4
+ import { pageViewsFor } from "./page-views.js";
5
+ export const DEPLOYMENT_SILENCES = everyMemberOf()([
6
+ "unread",
7
+ "unsplit",
8
+ "unscaled",
9
+ "unopened",
10
+ "inconsistent",
11
+ ]);
12
+ /**
13
+ * One line per silence, for a surface saying why a page is not in the order.
14
+ *
15
+ * **The sentences are the order's own, moved here rather than written again.**
16
+ * Every member of this set is also a {@link RankStanding}, and
17
+ * {@link describeRankStanding} has had a line for each since the order was
18
+ * built — so writing a second spelling of *nothing reported a view of this
19
+ * version* would be the overlap the census of silences exists to resolve, one
20
+ * module in. The standing defers to this for the five they share and the text
21
+ * is unchanged from what it returned.
22
+ */
23
+ export const describeDeploymentSilence = (silence) => {
24
+ switch (silence) {
25
+ case "unread":
26
+ return "nothing reported a view of this version in the window";
27
+ case "unsplit":
28
+ return "one window holds two forms of the page and says which readers neither";
29
+ case "unscaled":
30
+ return "no page views counted at the door, so its loss is not comparable with another page's";
31
+ case "unopened":
32
+ return "the page-view row is there and nothing has said a page view began";
33
+ case "inconsistent":
34
+ return "it loses more readers at one fall than have ever appeared";
35
+ }
36
+ };
37
+ export const RANK_STANDINGS = everyMemberOf()([
38
+ "ranked",
39
+ "unbroken",
40
+ "unread",
41
+ "unsplit",
42
+ "unscaled",
43
+ "unopened",
44
+ "inconsistent",
45
+ ]);
46
+ /** One line per standing, for a surface naming why a page is where it is. */
47
+ export const describeRankStanding = (standing) => {
48
+ switch (standing) {
49
+ case "ranked":
50
+ return "in the order, by the readers it loses at its sharpest fall";
51
+ case "unbroken":
52
+ return "read, and losing nobody anywhere on the page";
53
+ default:
54
+ return describeDeploymentSilence(standing);
55
+ }
56
+ };
57
+ const EMPTY_STANDINGS = Object.freeze(Object.fromEntries(RANK_STANDINGS.map((standing) => [standing, 0])));
58
+ /**
59
+ * One page's row, with the four reasons tried in the order they have to be
60
+ * tried in.
61
+ *
62
+ * `views` before the door, because *nobody read it* is a better answer than
63
+ * *its readers could not be scaled*. The door before the fall, because a page
64
+ * with no scale has nothing to put its fall on. And the disagreement last,
65
+ * because it is a statement about a fall and a row together.
66
+ */
67
+ const rowOf = (page, door) => {
68
+ const where = {
69
+ treeId: page.treeId,
70
+ revision: page.revision,
71
+ audienceId: page.audienceId,
72
+ views: page.views,
73
+ opened: door?.opened ?? null,
74
+ inflation: door?.inflation ?? null,
75
+ };
76
+ const nothing = { at: null, lost: null, readers: null, share: null };
77
+ /**
78
+ * Before the view floor, because a reading read as neither population
79
+ * publishes that floor as nought with full counters behind it, and *nobody
80
+ * read this page* is then a false sentence over a door row that sums both
81
+ * forms' arrivals (0301).
82
+ */
83
+ if (audienceScopeRead(page).reading === "mixed") {
84
+ return { ...where, ...nothing, standing: "unsplit" };
85
+ }
86
+ if (page.views === 0)
87
+ return { ...where, ...nothing, standing: "unread" };
88
+ if (door === null)
89
+ return { ...where, ...nothing, standing: "unscaled" };
90
+ /**
91
+ * A null inflation is exactly an opened of nought — the page-view reading
92
+ * withholds the fraction rather than dividing by nothing — so the check is
93
+ * written on the figure the scale needs and not on the count behind it.
94
+ */
95
+ if (door.inflation === null)
96
+ return { ...where, ...nothing, standing: "unopened" };
97
+ const at = page.steepest;
98
+ if (at === null)
99
+ return { ...where, ...nothing, standing: "unbroken" };
100
+ if (at.lost > door.appearances) {
101
+ return { ...where, standing: "inconsistent", at, lost: at.lost, readers: null, share: at.share };
102
+ }
103
+ /**
104
+ * The scale is read off the rule published beside the counter rather than
105
+ * spelled a second time here (0346). It was `at.lost ÷ (1 + door.inflation)`,
106
+ * which is the same rule arrived at by a different route — and the two routes
107
+ * do not agree in the last place, so the key moves there on a page with drift.
108
+ * Nothing orders on a sixteenth decimal and the published spelling is the
109
+ * closer of the two to the exact value, never the further.
110
+ */
111
+ return {
112
+ ...where,
113
+ standing: "ranked",
114
+ at,
115
+ lost: at.lost,
116
+ readers: atDoorScale(at.lost, doorOf(door)),
117
+ share: at.share,
118
+ };
119
+ };
120
+ /**
121
+ * The worse of two, which is the ranking rule spelled once.
122
+ *
123
+ * By readers lost before share, for the reason a single page ranks its own falls
124
+ * that way: a page two readers out of three abandoned is a worse rate and a
125
+ * smaller problem than one four hundred out of a thousand left.
126
+ */
127
+ const worseOf = (one, other) => (other.readers ?? 0) - (one.readers ?? 0) ||
128
+ (other.share ?? 0) - (one.share ?? 0) ||
129
+ one.treeId.localeCompare(other.treeId) ||
130
+ other.revision - one.revision;
131
+ /** Tree id, then newest revision first, which is the order the page-view rows are read in. */
132
+ const byPage = (one, other) => one.treeId.localeCompare(other.treeId) ||
133
+ other.revision - one.revision ||
134
+ (one.audienceId ?? "").localeCompare(other.audienceId ?? "");
135
+ /**
136
+ * A deployment's pages, in the order they should be looked at.
137
+ *
138
+ * Takes the readings rather than the counters, for the reason every derived
139
+ * reading in this subsystem does: the falls and the standings are what this is
140
+ * made of, and deriving them twice is how two screens come to disagree. A
141
+ * caller with counters and trees reads the parts, then the progress, then this.
142
+ *
143
+ * The rows are the whole window of page-view rows a deployment holds, not one
144
+ * page's — each page's own row is picked out of them by the published rule, so
145
+ * no caller writes the matching itself.
146
+ */
147
+ export const deploymentReadingOf = (pages, rows) => {
148
+ const seen = new Set();
149
+ const read = [];
150
+ let duplicated = 0;
151
+ let duplicatedRows = 0;
152
+ for (const page of pages) {
153
+ const key = readingKeyOf(page);
154
+ if (seen.has(key)) {
155
+ duplicated += 1;
156
+ continue;
157
+ }
158
+ seen.add(key);
159
+ const door = pageViewsFor(page, rows);
160
+ duplicatedRows += door.duplicated;
161
+ read.push(rowOf(page, door.measured));
162
+ }
163
+ const ranked = read.filter((row) => row.standing === "ranked").sort(worseOf);
164
+ const standings = { ...EMPTY_STANDINGS };
165
+ for (const row of read)
166
+ standings[row.standing] += 1;
167
+ return {
168
+ ranked,
169
+ unranked: read.filter((row) => row.standing !== "ranked").sort(byPage),
170
+ worst: ranked[0] ?? null,
171
+ standings,
172
+ trees: new Set(read.map((row) => row.treeId)).size,
173
+ arrivals: read.reduce((sum, row) => sum + (row.opened ?? 0), 0),
174
+ duplicated,
175
+ duplicatedRows,
176
+ };
177
+ };
178
+ //# sourceMappingURL=deployment.js.map
@@ -0,0 +1,114 @@
1
+ import type { RevisionPageViews } from "./page-views.js";
2
+ import type { ReachSilence } from "./reach.js";
3
+ /**
4
+ * The scale a page's door counts in, which three readings of a library share.
5
+ *
6
+ * A share of the readers who met something is a weighted mean of per-page
7
+ * shares, and every term of it has to be put on the scale the door counts in
8
+ * before two pages can be added together
9
+ * ([0250](../../decisions/0250-a-deployment-is-ordered-by-readers-lost-at-the-doors-scale-and-a-page-the-door-cannot-scale-is-out-of-the-order.md),
10
+ * [0256](../../decisions/0256-a-kinds-share-of-the-readers-who-met-it-is-a-weighted-mean-of-sound-shares-at-the-doors-scale.md)).
11
+ * That scaling is one rule, and until a third reading needed it, it was **two
12
+ * hand-written copies of one rule**: a kind's share of the readers who met it
13
+ * and a census of what readers do inside a kind of part
14
+ * ([0265](../../decisions/0265-what-readers-do-inside-a-kind-of-part-is-a-share-of-the-readers-who-met-it-and-the-door-is-only-a-weight.md))
15
+ * each carried their own, and a comparison of two windows of the first would
16
+ * have carried a third.
17
+ *
18
+ * Two spellings of one rule that agree today are a thing this subsystem has
19
+ * been bitten by before — the upsert keys of the four counter tables, moved
20
+ * into `counters.ts` so that two stores could not drift about what one row is
21
+ * — so the rule is written once here and the readings import it.
22
+ *
23
+ * The numbers are the page's rather than any part's, so a reading works one of
24
+ * these out per page and not per placement: a library of forty pages is tens of
25
+ * thousands of placements, and the row lookup is a filter over the rows.
26
+ *
27
+ * Pure, and the arithmetic is a minimum of two whole numbers. It reaches no
28
+ * store, no clock and no DOM, and nothing in it survives into a browser bundle.
29
+ */
30
+ /** What one page's door contributes to every figure taken against its readers. */
31
+ export type PageDoor = {
32
+ /**
33
+ * `min(appearances, opened)`: the page views a rollup folded, at the door's
34
+ * scale.
35
+ *
36
+ * It is `appearances ÷ (1 + inflation)` and is **taken as that minimum of two
37
+ * whole numbers**, because the division of three floats agrees with it to
38
+ * fifteen places and not to sixteen — which a share of readers has already
39
+ * been bitten by (0229).
40
+ */
41
+ readonly counted: number;
42
+ /**
43
+ * The row's openings, whatever the silence.
44
+ *
45
+ * Carried even where this page cannot be scaled, because a reading's own
46
+ * count of arrivals is a count of page views the door made and not a count of
47
+ * the ones a share could be taken of.
48
+ */
49
+ readonly opened: number;
50
+ readonly appearances: number;
51
+ readonly drift: number;
52
+ readonly pending: number;
53
+ /** Set where this page cannot be scaled, in the page's own vocabulary. */
54
+ readonly silence: ReachSilence | null;
55
+ };
56
+ /**
57
+ * The page's door, with the three reasons tried in the order a page's own
58
+ * reading tries them in.
59
+ *
60
+ * No row before nothing opened, because *there is no row* is the state a
61
+ * deployment can be in without its senders being at fault.
62
+ */
63
+ export declare const doorOf: (row: RevisionPageViews | null) => PageDoor;
64
+ /**
65
+ * A count taken against one page, put on the scale its door counts in.
66
+ *
67
+ * `count × counted ÷ appearances`: the count's own sound share of that page's
68
+ * appearances (0229), weighted by the page views a rollup actually folded
69
+ * (0250). It is the expression every reader-weighted figure over a library is
70
+ * built out of, and it was **five hand-written copies of it** — one in a kind's
71
+ * share of readers, two in what readers do inside a kind, two in a comparison of
72
+ * the first — which is the state this module was created to end and did not
73
+ * quite reach: {@link PageDoor} held the per-page half of the rule and the
74
+ * per-placement half stayed at each call site.
75
+ *
76
+ * Three **ranking keys** then turned out to be the same rule written a sixth,
77
+ * seventh and eighth time as `count ÷ (1 + inflation)` — the order of
78
+ * conversions (0333), of falls (0250) and of movements (0291). All three read
79
+ * this one now (0346).
80
+ *
81
+ * `scaledBy` is a **second** door, for the one caller that needs one: a
82
+ * comparison asks what one side's reading would have come to with the other
83
+ * side's traffic behind it, so the share is of the door the count came from and
84
+ * the weight is the other's. It defaults to the door the count came from, which
85
+ * is every other caller.
86
+ *
87
+ * **Total, and the two short-circuits are the reason three ranking keys can
88
+ * share it** (0346). It was documented as *only ever called for a door with no
89
+ * silence, where `appearances` is positive*, and that precondition is what kept
90
+ * the orders of falls and of movements writing the rule a second time by hand as
91
+ * `count ÷ (1 + inflation)` — a division-first spelling that is total where this
92
+ * one divided by nothing. Both cases are now answered here:
93
+ *
94
+ * - **A door that folded nothing has nothing to divide out.** With no
95
+ * appearances there is no scale to put the count on and no straddle in it to
96
+ * remove, so the count is its own figure. The alternative is a `NaN` in a
97
+ * ranking key, which sorts wherever the comparator leaves it.
98
+ * - **A scale that is the identity is taken exactly.** Where the weight equals
99
+ * the appearances it divides — every page with no drift, which is most of
100
+ * them — `count × n ÷ n` is the count mathematically and **not** in floats:
101
+ * `0.1 × 3 ÷ 3` is `0.10000000000000002`. A movement of a share is not a whole
102
+ * number, so a page the door has nothing to correct would have had its
103
+ * published figure moved by the correction. Returning the count says the same
104
+ * thing and says it in the last place too.
105
+ *
106
+ * **The multiplication comes before the division** otherwise, which is not a
107
+ * style: the three floats agree to fifteen places in either order and not to
108
+ * sixteen, and 0229 has already been bitten by exactly that. Over 22,100 integer
109
+ * triples where the scale is not the identity, this spelling is never further
110
+ * from the exact value than the division-first one and is strictly closer in
111
+ * 4,963 of them.
112
+ */
113
+ export declare const atDoorScale: (count: number, of: PageDoor, scaledBy?: PageDoor) => number;
114
+ //# sourceMappingURL=door.d.ts.map
@@ -0,0 +1,77 @@
1
+ /**
2
+ * The page's door, with the three reasons tried in the order a page's own
3
+ * reading tries them in.
4
+ *
5
+ * No row before nothing opened, because *there is no row* is the state a
6
+ * deployment can be in without its senders being at fault.
7
+ */
8
+ export const doorOf = (row) => {
9
+ if (row === null) {
10
+ return { counted: 0, opened: 0, appearances: 0, drift: 0, pending: 0, silence: "unmeasured" };
11
+ }
12
+ const of = {
13
+ counted: Math.min(row.appearances, row.opened),
14
+ opened: row.opened,
15
+ appearances: row.appearances,
16
+ drift: row.drift,
17
+ pending: row.pending,
18
+ };
19
+ if (row.opened === 0)
20
+ return { ...of, silence: "unopened" };
21
+ if (row.appearances === 0)
22
+ return { ...of, silence: "uncounted" };
23
+ return { ...of, silence: null };
24
+ };
25
+ /**
26
+ * A count taken against one page, put on the scale its door counts in.
27
+ *
28
+ * `count × counted ÷ appearances`: the count's own sound share of that page's
29
+ * appearances (0229), weighted by the page views a rollup actually folded
30
+ * (0250). It is the expression every reader-weighted figure over a library is
31
+ * built out of, and it was **five hand-written copies of it** — one in a kind's
32
+ * share of readers, two in what readers do inside a kind, two in a comparison of
33
+ * the first — which is the state this module was created to end and did not
34
+ * quite reach: {@link PageDoor} held the per-page half of the rule and the
35
+ * per-placement half stayed at each call site.
36
+ *
37
+ * Three **ranking keys** then turned out to be the same rule written a sixth,
38
+ * seventh and eighth time as `count ÷ (1 + inflation)` — the order of
39
+ * conversions (0333), of falls (0250) and of movements (0291). All three read
40
+ * this one now (0346).
41
+ *
42
+ * `scaledBy` is a **second** door, for the one caller that needs one: a
43
+ * comparison asks what one side's reading would have come to with the other
44
+ * side's traffic behind it, so the share is of the door the count came from and
45
+ * the weight is the other's. It defaults to the door the count came from, which
46
+ * is every other caller.
47
+ *
48
+ * **Total, and the two short-circuits are the reason three ranking keys can
49
+ * share it** (0346). It was documented as *only ever called for a door with no
50
+ * silence, where `appearances` is positive*, and that precondition is what kept
51
+ * the orders of falls and of movements writing the rule a second time by hand as
52
+ * `count ÷ (1 + inflation)` — a division-first spelling that is total where this
53
+ * one divided by nothing. Both cases are now answered here:
54
+ *
55
+ * - **A door that folded nothing has nothing to divide out.** With no
56
+ * appearances there is no scale to put the count on and no straddle in it to
57
+ * remove, so the count is its own figure. The alternative is a `NaN` in a
58
+ * ranking key, which sorts wherever the comparator leaves it.
59
+ * - **A scale that is the identity is taken exactly.** Where the weight equals
60
+ * the appearances it divides — every page with no drift, which is most of
61
+ * them — `count × n ÷ n` is the count mathematically and **not** in floats:
62
+ * `0.1 × 3 ÷ 3` is `0.10000000000000002`. A movement of a share is not a whole
63
+ * number, so a page the door has nothing to correct would have had its
64
+ * published figure moved by the correction. Returning the count says the same
65
+ * thing and says it in the last place too.
66
+ *
67
+ * **The multiplication comes before the division** otherwise, which is not a
68
+ * style: the three floats agree to fifteen places in either order and not to
69
+ * sixteen, and 0229 has already been bitten by exactly that. Over 22,100 integer
70
+ * triples where the scale is not the identity, this spelling is never further
71
+ * from the exact value than the division-first one and is strictly closer in
72
+ * 4,963 of them.
73
+ */
74
+ export const atDoorScale = (count, of, scaledBy = of) => of.appearances === 0 || scaledBy.counted === of.appearances
75
+ ? count
76
+ : (count * scaledBy.counted) / of.appearances;
77
+ //# sourceMappingURL=door.js.map
@@ -0,0 +1,192 @@
1
+ import { z } from "zod";
2
+ import { type Clock } from "../runtime/events.js";
3
+ import type { ReaderSignalJournal, ReaderSignalStoreError, ReceivedBatch } from "./journal.js";
4
+ /**
5
+ * The one operation that deletes a delivery.
6
+ *
7
+ * `collect.ts` used to be this as well: counting a ripe prefix and deleting it
8
+ * were one call, because a delivery existed for as long as it took rollup to
9
+ * read it and no longer (0146). On 5 November the maintainer settled that
10
+ * individual reader events are **kept for thirty days by default**, so that an
11
+ * operator can look at the deliveries behind a counter rather than only at the
12
+ * counter ([0349](../../decisions/0349-a-projects-reader-events-are-kept-thirty-days-by-default-and-the-tallies-stay-the-durable-record.md)),
13
+ * and the two halves of that one call became two operations with two windows
14
+ * ([0351](../../decisions/0351-a-counted-delivery-is-kept-for-a-stated-window-rather-than-deleted-by-the-fold.md)).
15
+ *
16
+ * This is the second half. It deletes and counts nothing, exactly as
17
+ * `collect.ts` counts and deletes nothing.
18
+ *
19
+ * ## The one rule, and it is not negotiable
20
+ *
21
+ * **Nothing is deleted that no fold has counted.** A delivery deleted before it
22
+ * was counted is gone from the counters too, and the counters are the durable
23
+ * record (0349) — a day of readers that nothing can reconstruct, because the
24
+ * rows that would say what they did are the rows that were deleted. So the cut
25
+ * is the lesser of two positions: the age the deployment keeps events for, and
26
+ * the oldest delivery the fold has not stamped.
27
+ *
28
+ * That means a deployment whose collection cron has stopped **stops expiring**
29
+ * rather than deleting uncounted deliveries, and says so
30
+ * ({@link ExpiryStop}). It is the same sentence the fix-list makes one level
31
+ * up — *while nothing is arriving, no reading is evidence* (0347) — about this
32
+ * table: while nothing is counting, nothing may be deleted.
33
+ *
34
+ * ## What it is not
35
+ *
36
+ * Not a scheduler, for the reason `collect.ts` is not one: when a deployment
37
+ * deletes is an operational choice, and a framework that quietly swept a host's
38
+ * data on a timer it chose would be making it. A host calls this beside
39
+ * {@link collectReaderSignals} from a cron route, a deploy hook or by hand —
40
+ * **counting first**, so that one run's fold makes its own window expirable
41
+ * rather than waiting for the next.
42
+ *
43
+ * Not idempotence-sensitive, which is the one way it is easier than collection.
44
+ * Deleting a prefix twice removes it once; there is no additive counter behind
45
+ * it and no `redelivered` to report. A run that deletes nothing is the ordinary
46
+ * answer on a deployment inside its window.
47
+ */
48
+ /**
49
+ * Thirty days, the maintainer's number, and the default of a setting rather
50
+ * than a constant (0349). Rule 5 of `docs/signals.md` is what makes it one.
51
+ *
52
+ * **It is longer than anything in this subsystem has been, and the cost is
53
+ * stated rather than buried.** A delivery carries an opaque `view` key, which
54
+ * is what correlates one page view's signals with each other and with nothing
55
+ * else (0146). While a counted delivery was deleted within the hour, the
56
+ * argument for that key rested partly on how briefly it lived; it now lives for
57
+ * as long as this window. What has not changed is what the key *is* — random
58
+ * per page view, derived from nothing about the reader, never sent back to a
59
+ * browser, and correlating nothing across two page views — so a row thirty days
60
+ * old identifies exactly nobody, which is the property the rule actually
61
+ * depends on. What has changed is that the window in which one page view's
62
+ * signals can be read together is thirty days rather than an hour, and 0349
63
+ * decided it knowing that.
64
+ *
65
+ * Shorter is cheaper and keeps less: a deployment with heavy traffic states a
66
+ * week and loses only the ability to inspect deliveries older than a week,
67
+ * because the counters keep answering over all time. Longer is what rule 5 made
68
+ * configurable in the first place.
69
+ */
70
+ export declare const DEFAULT_READER_EVENT_RETENTION_MS: number;
71
+ /**
72
+ * A minute, which is the collection window's floor and is the same mistake.
73
+ *
74
+ * It is not that a shorter window is unsafe — the rule above makes any window
75
+ * safe, because an uncounted delivery is never deleted whatever this says. It
76
+ * is that the ordinary way a window is written wrongly is a units mistake:
77
+ * `keptMs: 30` reads as thirty days and means thirty milliseconds, and a
78
+ * deployment that typed it would publish *a delivery is gone within a second*
79
+ * to every reader of its privacy page.
80
+ */
81
+ export declare const MIN_READER_EVENT_RETENTION_MS: number;
82
+ export declare const readerEventRetentionSchema: z.ZodObject<{
83
+ keptMs: z.ZodNumber;
84
+ }, "strip", z.ZodTypeAny, {
85
+ keptMs: number;
86
+ }, {
87
+ keptMs: number;
88
+ }>;
89
+ export type ReaderEventRetention = z.infer<typeof readerEventRetentionSchema>;
90
+ /** How much of the oldest end one run will look at, as collection bounds its own scan. */
91
+ export declare const DEFAULT_EXPIRY_SCAN = 5000;
92
+ export declare const MAX_EXPIRY_SCAN = 50000;
93
+ /**
94
+ * Why the cut stopped where it did, which is the one fact an operator cannot
95
+ * infer from a count of deleted rows.
96
+ *
97
+ * `uncounted` is the state worth a line in a log: nothing is wrong with this
98
+ * table, the deployment's collection has stopped, and the reason deliveries are
99
+ * piling up past the window its readers are told is that deleting them would
100
+ * lose them from the counters. The remedy is the fold's, not retention's.
101
+ */
102
+ export type ExpiryStop =
103
+ /** The oldest delivery left is inside the kept window, which is the ordinary answer. */
104
+ "young"
105
+ /** The oldest delivery left is past the window and no fold has counted it. */
106
+ | "uncounted"
107
+ /** The scan reached the end of what it read with everything expirable. */
108
+ | "end";
109
+ /**
110
+ * What one run may delete, as a pure function of rows and an instant.
111
+ *
112
+ * The cut is the **first** row that may not go, not every row that may: the
113
+ * table forgets a prefix or nothing, exactly as the journals do, because a hole
114
+ * would make `seq` — an opaque increasing position — start meaning something a
115
+ * reader could misread.
116
+ *
117
+ * **Stopping at the first is also what makes an out-of-order arrival safe.**
118
+ * `received_at` is a transaction's instant and `seq` is its position, so two
119
+ * overlapping inserts can land with the pair inverted by milliseconds. A rule
120
+ * that deleted every old row below the newest old row could then take a
121
+ * delivery younger than the window; a rule that stops at the first row it may
122
+ * not delete leaves that one and the rest of the prefix for the next run, which
123
+ * costs one interval and cannot be wrong.
124
+ */
125
+ export type ExpiryPlan = {
126
+ /** The position to delete below. `null` where nothing may go. */
127
+ readonly before: number | null;
128
+ /** Rows the scan read and left. A floor rather than a total — the scan stops at the first. */
129
+ readonly waiting: number;
130
+ readonly stopped: ExpiryStop;
131
+ };
132
+ export declare const expiryPlanOf: (scanned: readonly ReceivedBatch[], horizon: string) => ExpiryPlan;
133
+ /** The instant a delivery is old enough to go. `null` where the clock could not be read. */
134
+ export declare const keptHorizonOf: (configured: ReaderEventRetention, now: string) => string | null;
135
+ export type ExpiryOutcome = {
136
+ readonly outcome: "expired";
137
+ readonly removed: number;
138
+ /**
139
+ * How old the oldest delivery the scan read was, before anything was
140
+ * deleted, in milliseconds at this run's instant.
141
+ *
142
+ * The evidence the published retention ceiling is judged against
143
+ * ({@link retentionPromiseOf}) and the reason this figure is on the run
144
+ * rather than left to a caller's clock: a surface that read the age
145
+ * against its own `now` would publish a number nothing had measured.
146
+ *
147
+ * It is the oldest delivery **this run found**, including the ones it then
148
+ * deleted, which is what the comparison wants. A healthy run finds a row
149
+ * just past the kept window and the ceiling is that window plus one sweep,
150
+ * so it reads as kept; a run on a deployment that has not swept for a week
151
+ * finds a week.
152
+ */
153
+ readonly oldestMs: number;
154
+ readonly stopped: ExpiryStop;
155
+ /** The scan filled its limit with expirable rows, so another run has work now. */
156
+ readonly more: boolean;
157
+ }
158
+ /** Nothing in the table may go yet, which is the ordinary answer inside the window. */
159
+ | {
160
+ readonly outcome: "nothing-expired";
161
+ readonly waiting: number;
162
+ /** `null` where the scan read no row at all — a table with nothing in it. */
163
+ readonly oldestMs: number | null;
164
+ readonly stopped: ExpiryStop;
165
+ }
166
+ /** The window was not usable. Nothing was read or deleted. */
167
+ | {
168
+ readonly outcome: "refused";
169
+ readonly reason: string;
170
+ }
171
+ /** Read or delete failed. Where it was the delete, the prefix is still there. */
172
+ | {
173
+ readonly outcome: "unavailable";
174
+ readonly error: ReaderSignalStoreError;
175
+ };
176
+ export type ExpiryRequest = {
177
+ readonly keptMs?: number;
178
+ readonly clock?: Clock;
179
+ readonly scanLimit?: number;
180
+ };
181
+ /**
182
+ * Delete the deliveries this deployment no longer keeps.
183
+ *
184
+ * Called beside {@link collectReaderSignals} and after it, so that a run's own
185
+ * fold makes its own window expirable. Nothing here counts, writes a counter or
186
+ * reads a tally: the counters already hold everything these rows said, which is
187
+ * what makes deleting them safe and is the whole of 0349's second clause.
188
+ */
189
+ export declare const expireReaderEvents: (journal: ReaderSignalJournal, request?: ExpiryRequest) => Promise<ExpiryOutcome>;
190
+ /** One line for an operator, because an outcome nobody can read is one nobody acts on. */
191
+ export declare const describeExpiry: (outcome: ExpiryOutcome) => string;
192
+ //# sourceMappingURL=expire.d.ts.map