@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,694 @@
1
+ import type { AudienceId } from "../audience/audience.js";
2
+ import type { TreeId } from "../ids.js";
3
+ import { type StoredPageViews } from "./page-views.js";
4
+ import type { PageReading } from "./parts.js";
5
+ /**
6
+ * Whether what a deployment collected can be trusted, and which of its pages
7
+ * cannot.
8
+ *
9
+ * Every reading in this subsystem answers a question about readers and, beside
10
+ * the answer, names the reasons the answer may be absent: a part with no
11
+ * denominator, a window with no page views, a sender that is not marking its
12
+ * openings. Twelve vocabularies of them
13
+ * ([0240](../../decisions/0240-a-silence-is-a-condition-and-a-subject-and-the-two-names-for-one-state-were-not-synonyms.md)),
14
+ * each published beside the figure it withholds.
15
+ *
16
+ * **So a deployment could only discover that its measurement was broken by
17
+ * asking a question about reading and noticing the answer was missing.** Three
18
+ * of those reasons are faults rather than quiet windows — senders that never
19
+ * mark an opening, so every rate on the page has no exact denominator (0229);
20
+ * senders that credit no action to any reader, so every band reads *untouched*
21
+ * while the counters look healthy
22
+ * ([0242](../../decisions/0242-what-readers-did-is-a-share-off-one-row-and-a-leaf-has-no-inside.md));
23
+ * a rollup window shorter than a visit, so every count against the revision is
24
+ * half again the truth
25
+ * ([0219](../../decisions/0219-a-page-view-is-counted-once-at-the-door-and-the-over-count-in-the-node-counters-is-a-measurement.md)).
26
+ * Each of them is page by page, one card at a time, and a deployment with
27
+ * forty pages and one broken sender had no way to be told.
28
+ *
29
+ * This is that answer, taken off the readings and the door rows a deployment
30
+ * already has and nothing else: no payload, no browser change, no counter that
31
+ * does not exist, no column and no byte on any wire.
32
+ *
33
+ * ## A fault is named by what it costs, and the remedy is named only where the
34
+ * rows determine one
35
+ *
36
+ * The eight faults here are not eight shapes of missing data; they are eight
37
+ * different things to go and do, and the reason to report them together is that
38
+ * a person looking at a reader screen cannot tell them apart from the figures.
39
+ * {@link remedyOf} publishes which of four hands each one falls to — the pages,
40
+ * the configuration, the caller — and `undetermined` where the rows genuinely do
41
+ * not say, which is one fault out of eight and is better than inventing one of
42
+ * three causes.
43
+ *
44
+ * ## What a fault costs is the page's arrivals, and a page is counted once
45
+ *
46
+ * The readers a fault affects are the readers of the page it is on: a sender not
47
+ * marking its openings spoils every rate on that revision, not some share of
48
+ * them. So the cost is the page's own `opened` — exact, counted once at the
49
+ * door, and addable for the reason no other counter here is (0219).
50
+ *
51
+ * **Which makes the only double-count available to this reading the one it
52
+ * guards: a page counted once per fault it has.** A revision with three faults
53
+ * is one revision and its readers are added once, because counting a window and
54
+ * forgetting it are one operation
55
+ * ([0158](../../decisions/0158-counting-a-window-of-reader-signals-and-forgetting-it-are-one-operation.md)).
56
+ * {@link CollectionHealth.faults} counts revisions per fault and so deliberately
57
+ * does not add to the number of faulted pages, which is said on the field.
58
+ *
59
+ * ## A page the door cannot price is not ranked against one it can
60
+ *
61
+ * A revision whose counters hold readers and whose door row is missing is the
62
+ * first fault in the list, and it is also the one page whose cost cannot be
63
+ * stated: there is no exact arrival count to rank it by. Ranking it by its view
64
+ * floor would put it in the order at a height taken off a different scale, which
65
+ * is the mixing
66
+ * [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)
67
+ * refuses one unit across and
68
+ * [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)
69
+ * refuses for an order of pages. So it is published apart, in
70
+ * {@link CollectionHealth.unpriced}, with its floor on the row and never in the
71
+ * ranking.
72
+ *
73
+ * ## What is published as a figure rather than judged
74
+ *
75
+ * **Openings no rollup has folded, where nothing says when a fold last was.**
76
+ * `pending` is *the other sign of the same subtraction* (0219) and is what a
77
+ * stalled collection looks like — and it is also what a revision published two
78
+ * minutes ago looks like, because the ordinary lag of the tallies behind the
79
+ * buffer is one window
80
+ * ([0158](../../decisions/0158-counting-a-window-of-reader-signals-and-forgetting-it-are-one-operation.md)).
81
+ * `updatedAt` cannot tell those apart, because the door writes it on every
82
+ * delivery: a busy page whose rollup has stopped keeps a fresh timestamp while
83
+ * its appearances never move.
84
+ *
85
+ * A page-view row now carries `foldedAt`, written by the fold and by nothing
86
+ * else ([0274](../../decisions/0274-a-page-view-row-says-when-the-fold-last-touched-it-and-a-stall-is-judged-against-a-schedule-the-deployment-hands-in.md)),
87
+ * so the lag is readable — against a schedule the caller hands in, because how
88
+ * long a fold may honestly be behind is the deployment's own cron interval and
89
+ * rollup window and is not the framework's to assume. Hand one in and
90
+ * `collection-stalled` is raised on the pages whose openings have waited longer
91
+ * than that. Hand none in, or read a row no fold has ever touched, and nothing
92
+ * is claimed: `pending` is published per page and added across the deployment,
93
+ * {@link CollectionHealth.unattested} counts the revisions whose lag could not
94
+ * be read at all, and no fault is raised from either.
95
+ *
96
+ * Pure, linear in the readings times the rows, and reaches no store, clock or
97
+ * DOM.
98
+ */
99
+ /**
100
+ * How generous a revision's distinct counts may be before its absolute figures
101
+ * are not worth printing.
102
+ *
103
+ * `drift ÷ opened` above a half means the appearances are more than one and a
104
+ * half times the openings — so the typical page view is being folded into more
105
+ * than one and a half rollup windows, which is a window shorter than the reading
106
+ * it measures. Every **ratio** in this subsystem survives that, because both of
107
+ * its counts come off the same rows and the inflation very nearly divides out
108
+ * (0221, 0229, 0242); every **count** on a card is half again what it should be.
109
+ *
110
+ * Published and not overridable, which is
111
+ * [0218](../../decisions/0218-what-a-counter-means-is-published-and-the-browser-pays-for-the-number-and-not-its-name.md)'s
112
+ * rule at the one remove where it still holds: how much error makes a figure
113
+ * unfit to print is the framework's statement about its own numbers, where the
114
+ * remedy — a longer window — is the deployment's own configuration.
115
+ */
116
+ export declare const COUNTS_INFLATED_ABOVE = 0.5;
117
+ /**
118
+ * What a deployment expects of its own collection, which is the one fact here
119
+ * that no row can supply.
120
+ *
121
+ * Nothing in this subsystem schedules a fold: a host calls
122
+ * {@link collectReaderSignals} from a cron, a deploy hook or by hand, and the
123
+ * ripeness window it folds behind is its own configuration (0146, 0158). So
124
+ * *how late is late* is two numbers only the deployment knows, and a framework
125
+ * that guessed would fault a deployment that folds hourly for not folding in
126
+ * ten minutes.
127
+ *
128
+ * Handed in rather than assumed, which is the shape the straddle correction
129
+ * already takes
130
+ * ([0230](../../decisions/0230-a-part-was-read-when-readers-had-time-for-its-words-and-only-the-skim-is-a-safe-claim.md)),
131
+ * and optional, because a caller with no schedule to state should get a reading
132
+ * that judges nothing rather than one that judges against a default.
133
+ */
134
+ export type CollectionSchedule = {
135
+ /**
136
+ * The instant the reading is taken, as an ISO 8601 timestamp.
137
+ *
138
+ * A parameter and never a clock read inside, for the reason every other
139
+ * instant in this subsystem is handed in: a reading that read the wall clock
140
+ * would answer differently on two calls over one set of rows.
141
+ */
142
+ readonly at: string;
143
+ /**
144
+ * The longest a fold may honestly be behind, in milliseconds.
145
+ *
146
+ * The deployment's collection interval **plus** its ripeness window, not the
147
+ * window alone: a batch is not folded until it ripens, and then not until the
148
+ * next run, so the two add. A deployment that folds every hour behind a
149
+ * ten-minute window expects a fold within seventy minutes, and anything
150
+ * shorter handed in here is a fault on a healthy collection.
151
+ *
152
+ * Nothing is judged where this is not a positive, finite number of
153
+ * milliseconds — a nought would call the lag the design *requires* a fault,
154
+ * which is the one way this reading could be made to cry wolf on every page
155
+ * of a healthy deployment.
156
+ */
157
+ readonly foldsWithinMs: number;
158
+ };
159
+ /** Something wrong with what a deployment is collecting, rather than a quiet window. */
160
+ export type CollectionFault =
161
+ /**
162
+ * The window's counters hold readers of this revision and there is no
163
+ * page-view row at the door for it.
164
+ *
165
+ * Every rate on the page is left with the view floor for a denominator, which
166
+ * is short of the page views there were (0212), and nothing on the page can be
167
+ * put on the same scale as another page's (0250).
168
+ *
169
+ * **Three causes and the rows cannot tell them apart:** the revision was
170
+ * served by senders older than the opening marker, the door row has passed out
171
+ * of the deployment's retention window while the counters it describes have
172
+ * not, or the counters were assembled by something that is not a sender. So
173
+ * the remedy is `undetermined` rather than one of the three guessed.
174
+ */
175
+ "door-unscaled"
176
+ /**
177
+ * The door row is there, something counted readers of this revision — a
178
+ * rollup's appearances, or the counters themselves — and nothing has ever
179
+ * said a page view *began*.
180
+ *
181
+ * An honest sender marks at most one batch of each page view as the one that
182
+ * opened it (0214), and a deployment whose senders do not is the deployment a
183
+ * share-of-readers reading calls `unopened` (0229): every rate
184
+ * denominator-less while the counters look perfectly healthy. It is the one
185
+ * fault here whose symptom is invisible on every screen that does not divide
186
+ * by the door.
187
+ */
188
+ | "openings-unmarked"
189
+ /**
190
+ * The revision's distinct counts are inflated past
191
+ * {@link COUNTS_INFLATED_ABOVE}.
192
+ *
193
+ * Not a broken sender and not a broken rollup: a rollup window shorter than
194
+ * the visits being measured, which is the one control a deployment has over
195
+ * this error (0219). The shares stay sound and the counts do not.
196
+ */
197
+ | "counts-inflated"
198
+ /**
199
+ * Page views of this revision are waiting to be folded and the last fold of
200
+ * it was longer ago than the deployment said its collection takes.
201
+ *
202
+ * `pending` openings are the ordinary state of a live page — the lag of the
203
+ * tallies behind the buffer is one window by design (0158) — so the fault is
204
+ * never the pending count itself. It is the **age** of the fold that should
205
+ * have cleared it, read off `foldedAt` and judged against the
206
+ * {@link CollectionSchedule} the caller handed in. Nothing is raised without
207
+ * one, and nothing is raised on a row no fold has ever touched, which is
208
+ * every row of a deployment upgraded past this column until its next run.
209
+ *
210
+ * What it costs is every count on the page: a fold that never comes is
211
+ * counters frozen where they were while the door goes on counting arrivals,
212
+ * so each rate reads lower than the truth by however much reading has
213
+ * happened since. It falls to the same hand as a window that is too short —
214
+ * the deployment's own configuration — because what has stopped is the thing
215
+ * it schedules.
216
+ *
217
+ * **It can hide behind `openings-unmarked`.** A deployment whose senders
218
+ * never mark an opening has nothing pending by construction, so a stall there
219
+ * is invisible until the door is counting again — which is why the marker is
220
+ * the first fault to fix and is published first.
221
+ *
222
+ * **It cannot be true at the same time as `counts-inflated`**, and the reason
223
+ * is arithmetic rather than policy: `drift` and `pending` are the two signs of
224
+ * one subtraction (0219), so a revision whose appearances have outrun its
225
+ * openings has nothing pending to be late. The two faults the same hand
226
+ * answers for are therefore alternatives, which is why they are adjacent in
227
+ * {@link COLLECTION_FAULTS} rather than additive.
228
+ */
229
+ | "collection-stalled"
230
+ /**
231
+ * The window holds uses of this page and credits none of them to a reader.
232
+ *
233
+ * A press is filed against the control and credited to the addressed ancestors
234
+ * the signal carries (0167), so a sender whose delegated signals have no
235
+ * `within` adds occurrences and no `engaged` at all. Taken from
236
+ * {@link pageActionOf} rather than spelled a second time, so the two readings
237
+ * cannot come to disagree about what it looks like (0242).
238
+ */
239
+ | "actions-uncredited"
240
+ /**
241
+ * A part of this page reported nothing while a part **inside it** reported
242
+ * being reached.
243
+ *
244
+ * A reader was demonstrably below it, so it was on a screen and did not say
245
+ * so. The usual cause is a primitive that does not spread the identity
246
+ * attributes a broadcaster reads — the failure `sdk/conformance.ts` exists to
247
+ * catch — and a sender switched on part-way through a release is the other.
248
+ * Taken from {@link pageFrontierOf} rather than spelled a second time, on the
249
+ * rule `actions-uncredited` is here under (0242).
250
+ *
251
+ * **It is a fault about a *primitive* and not about a page**, which is what
252
+ * makes it worth a member of its own rather than a line on a page reading. A
253
+ * part that is never reached is a page to rewrite; a part that is reached and
254
+ * silent is a component to fix, and every placement of that component in the
255
+ * deployment is wrong in the same way while reading as a page readers skip.
256
+ *
257
+ * **What is detectable is a fraction of what is wrong.** A silent part is
258
+ * only visible here when something *inside* it reported, so a silent leaf —
259
+ * a heading, a price, a control with nothing under it — is indistinguishable
260
+ * from a part nobody reached. The fault therefore says *this page has senders
261
+ * that do not report*, which is a statement about every figure on it, and not
262
+ * *these are the parts that went missing*.
263
+ */
264
+ | "parts-unreporting"
265
+ /**
266
+ * Counters filed under this tree and revision that name nodes the tree does
267
+ * not contain, or the same row handed in twice.
268
+ *
269
+ * The two faults a **caller** can have rather than a deployment: a tree and a
270
+ * window that do not belong together, which leaves most parts reading
271
+ * `skipped` while the numbers stay plausible (0212), and two reads
272
+ * concatenated instead of one, which neither sums nor overwrites honestly
273
+ * (0147). Published as one fault because the hand it falls to is one hand and
274
+ * the fix is one fix, with both counts on the row.
275
+ */
276
+ | "rows-mishandled"
277
+ /**
278
+ * The window holds two audiences' counters for this page and the reading was
279
+ * taken of neither.
280
+ *
281
+ * A page is one base tree and the deltas an audience earns (0263), so two
282
+ * forms of it produce two sets of counters over one tree at one revision,
283
+ * told apart by one column (0284) and by nothing else. A reading handed
284
+ * both without being told which was wanted has two answers and no way to
285
+ * choose: summing them is one number about two populations — *the portal
286
+ * gains a dimension it must not silently collapse* — and picking one is
287
+ * picking by row order.
288
+ *
289
+ * **It is the caller's, like `rows-mishandled`, and it is not that fault.**
290
+ * Nothing is wrong with the rows, nothing was handed in twice and nothing is
291
+ * unaccounted for; the window is simply of more than the reading is. The fix
292
+ * is `byAudience` and one reading per form, and the remedy says so rather
293
+ * than sending anybody looking for a bad row.
294
+ */
295
+ | "audiences-mixed";
296
+ export declare const COLLECTION_FAULTS: readonly CollectionFault[];
297
+ /** One line per fault, for a surface naming what is wrong. */
298
+ export declare const describeCollectionFault: (fault: CollectionFault) => string;
299
+ /** Whose hand a fault falls to. */
300
+ export type FaultRemedy =
301
+ /** The pages: a newer broadcaster, or one whose delegation walks the ancestry. */
302
+ "senders"
303
+ /** The deployment's own configuration: the rollup window. */
304
+ | "configuration"
305
+ /** The surface that asked: it handed in a tree and a window that do not match, or two reads. */
306
+ | "caller"
307
+ /**
308
+ * Nothing the rows can name.
309
+ *
310
+ * One fault out of eight, and it is the honest answer rather than a gap: a
311
+ * missing door row is an old sender, an expired row or a hand-built counter,
312
+ * and inventing one of the three is worse than naming none.
313
+ */
314
+ | "undetermined";
315
+ export declare const FAULT_REMEDIES: readonly FaultRemedy[];
316
+ /** Whose hand this fault falls to, which is the half of a fault a person acts on. */
317
+ export declare const remedyOf: (fault: CollectionFault) => FaultRemedy;
318
+ /**
319
+ * Whether a fault reaches the figure an order of a deployment's pages is ranked
320
+ * on, which is readers lost at the sharpest fall, deflated to the door's scale
321
+ * (0250).
322
+ *
323
+ * The order is
324
+ * [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)
325
+ * and the join that reads this is
326
+ * [`agenda.ts`](agenda.ts).
327
+ *
328
+ * The second half of a fault, beside {@link remedyOf}'s first: that one says
329
+ * whose hand the fault falls to, and this says whether the fall a deployment
330
+ * was about to act on is evidence of anything. It is **here rather than beside
331
+ * the order** because it is a statement about a fault, and a fault vocabulary
332
+ * written in two places is this subsystem's own commonest defect.
333
+ *
334
+ * ## Why it is not simply *every fault*
335
+ *
336
+ * A fault spoils every **rate** on its page, which is what makes the health
337
+ * reading worth ranking by headcount. It does not follow that it spoils *this*
338
+ * figure, and two of the eight plainly do not:
339
+ *
340
+ * - **`counts-inflated` is already corrected for.** The key the order is on is
341
+ * `lost ÷ (1 + inflation)`, and the inflation comes off the door row, where
342
+ * an opening is counted once and exactly (0219). The fault says the page's
343
+ * absolute counts are not worth printing; the ranking key is not one of them.
344
+ * - **`actions-uncredited` is about a different counter.** A fall is between two
345
+ * siblings on `reached`, and an uncredited sender spends its `engaged`
346
+ * (0242). Every band on the page reads *untouched* and not one fall moves.
347
+ *
348
+ * Taking a page out of the order for either of those would send an operator to
349
+ * repair a sender when what the rows said was *four hundred readers stop here*,
350
+ * and it would be the over-caution that makes a verdict worth ignoring.
351
+ *
352
+ * ## Why three of the six cannot be seen today
353
+ *
354
+ * `door-unscaled`, `openings-unmarked` and `audiences-mixed` are `true` here and
355
+ * **cannot co-occur with a rank**, because the order already refuses those
356
+ * pages as `unscaled`, `unopened` and `unsplit`. They are answered anyway: this
357
+ * says what the fault does to the figure, not what today's standings happen to
358
+ * let through, so the day a standing changes the two readings do not silently
359
+ * come apart.
360
+ *
361
+ * ## Its sibling answers the same question about the other order
362
+ *
363
+ * {@link spoilsTheConversion} is this for the order of a deployment's
364
+ * conversions (0333), and it is **not this function with a word changed**: a
365
+ * short window is corrected for here and manufactures the loss there. Neither
366
+ * answer may be read off the other.
367
+ *
368
+ * The three that can be seen are the three worth seeing. `rows-mishandled` is a
369
+ * tree and a window that do not belong together, which leaves most of the page
370
+ * reading `skipped` — so it manufactures the steepest fall in the deployment and
371
+ * puts the page at the head of the order (0212). `collection-stalled` reads a
372
+ * fall off counters the fold has not caught up to and scales it by a door that
373
+ * has, so the loss is of one window and the scale is of another; it understates
374
+ * rather than overstates, which makes a stalled page's rank a floor on its
375
+ * trouble rather than a measure of it.
376
+ *
377
+ * `parts-unreporting` is `rows-mishandled`'s shape arrived at from the other
378
+ * direction, and it is **not** read off the analogy. A fall is between two
379
+ * siblings on `reached`, and a part that never reports has a `reached` of
380
+ * nought while readers were demonstrably below it — so the fall into it is
381
+ * total, and a total fall is the sharpest fall a page can have. The ranking key
382
+ * is the deployment's sharpest fall, so one silent part is enough to put a page
383
+ * the readers were perfectly happy with at the head of the order. The wider
384
+ * reason is the one on the member itself: the parts this fault can see are the
385
+ * containers, a silent leaf is indistinguishable from a part nobody reached,
386
+ * and *this page's senders do not report everything they are on* is a statement
387
+ * about every `reached` count on it.
388
+ */
389
+ export declare const spoilsTheLoss: (fault: CollectionFault) => boolean;
390
+ /**
391
+ * Whether a fault reaches the figure an order of a deployment's conversions is
392
+ * ranked on, which is readers lost **between** the two ends of a question,
393
+ * deflated to the door's scale.
394
+ *
395
+ * The order is
396
+ * [0333](../../decisions/0333-a-deployments-conversions-are-a-third-order-ranked-on-the-loss-between-the-two-ends.md)
397
+ * and the join that reads this is [`agenda.ts`](agenda.ts).
398
+ *
399
+ * The sibling of {@link spoilsTheLoss}, and it is here for the same reason that
400
+ * one is: the question is about a fault, and a fault vocabulary written in two
401
+ * places is this subsystem's commonest defect.
402
+ *
403
+ * ## It is not {@link spoilsTheLoss} with the word changed
404
+ *
405
+ * The two answers differ on one fault and agree on another for a different
406
+ * reason, and both of those were found by arguing from what the counters are
407
+ * made of rather than by analogy — which is the way a fault vocabulary comes to
408
+ * be right in one of its two places and wrong in the other.
409
+ *
410
+ * - **`counts-inflated` is `false` for a fall and `true` here.** A fall is a
411
+ * difference of two independent distinct-view counts, so a short window
412
+ * inflates both ends of the subtraction and `lost ÷ (1 + inflation)` puts the
413
+ * difference back on the door's scale (0219, 0250). A conversion is **not** a
414
+ * difference of two independent counts: `converted` is a *conjunction inside
415
+ * one rollup window*, so a page view that satisfied the first end in one
416
+ * window and the second in the next contributes `reached 1, converted 0` and
417
+ * its conversion is lost rather than double-counted (0147). A window shorter
418
+ * than the visits being measured therefore **manufactures the very loss this
419
+ * order ranks**, and dividing by the straddle corrects the scale of the count
420
+ * and not the count. `PairReach.rateAtMost` bounds that error for the rate;
421
+ * nothing bounds it for the key, which is why the page leaves the order.
422
+ * - **`actions-uncredited` is `false` in both places and not for the same
423
+ * reason.** A fall survives it because a fall is made of `reached` and an
424
+ * uncredited sender spends `engaged` (0242). A conversion survives it because
425
+ * **no funnel figure is made of `engaged` at all**: an end is satisfied by the
426
+ * node a signal names and the kind it is, and the ancestry a signal carries
427
+ * feeds exactly one counter, which is `engaged` (0167). A question whose
428
+ * second end asks for `activated` on a control is answered from the control's
429
+ * own signal, so the fault cannot touch it.
430
+ *
431
+ * ## The five that transfer, and why
432
+ *
433
+ * `door-unscaled` leaves the loss with no scale to be comparable on;
434
+ * `openings-unmarked` leaves it with no denominator; `audiences-mixed` reads one
435
+ * question of two populations (0300). All three are `true` and, exactly as in
436
+ * {@link spoilsTheLoss}, **none of them can co-occur with a conversion rank
437
+ * today**, because the order already refuses those pages as `unscaled`,
438
+ * `unopened` and `unsplit`. They are answered anyway, so that the day a
439
+ * standing changes the two readings do not silently come apart.
440
+ *
441
+ * `rows-mishandled` is `true` for both halves of what it names. A tree and a
442
+ * window that do not belong together answers this revision's questions with
443
+ * another revision's counters (0212), and a row handed in twice doubles
444
+ * `reached` and `converted` together, which doubles the loss while leaving the
445
+ * rate intact — so the ranking key moves and the figure beside it does not say
446
+ * so (0147).
447
+ *
448
+ * `collection-stalled` is `true` for the reason it is for a fall: the counts are
449
+ * of one window and the scale is of another, because a fold that has stopped
450
+ * freezes the funnel rows while the door goes on counting arrivals. It
451
+ * understates, so a stalled page's place is a floor on its trouble rather than a
452
+ * measure of it.
453
+ *
454
+ * `parts-unreporting` is `true`, and the argument is **weaker here than it is
455
+ * for a fall** — which is why it is written down rather than carried over. A
456
+ * funnel end is satisfied by the node a signal names and the kind it is, so a
457
+ * silent end makes `converted` nought and manufactures a total loss exactly as
458
+ * it manufactures a total fall. But what this fault can actually see is a part
459
+ * with something reported *inside* it, and a funnel's ends are usually controls
460
+ * with nothing inside them, so the end itself is rarely the part that is named.
461
+ * It is `true` on the member's own wider claim instead: a page with one
462
+ * container that does not report has senders that do not report, every silent
463
+ * leaf on it is invisible, and an end that never fired is indistinguishable
464
+ * from an end nobody reached.
465
+ *
466
+ * ## Which can be seen on a ranked page
467
+ *
468
+ * Four, where a fall has three: `counts-inflated`, `collection-stalled`,
469
+ * `rows-mishandled` and `parts-unreporting`. The extra one is the fault a fall
470
+ * is explicitly safe from, which is the whole reason this answer could not be
471
+ * transferred.
472
+ */
473
+ export declare const spoilsTheConversion: (fault: CollectionFault) => boolean;
474
+ /** Where one revision of one page stands. */
475
+ export type HealthStanding =
476
+ /** Measured, with nothing wrong that these rows can see. */
477
+ "sound"
478
+ /** At least one fault, named on the row. */
479
+ | "faulted"
480
+ /**
481
+ * Nothing was collected about this revision at all.
482
+ *
483
+ * No counters and no page views at the door, which is a page nobody opened in
484
+ * the window rather than anything wrong. Checked before the door is, so a page
485
+ * nobody read is never reported as a page the door could not price (0250).
486
+ */
487
+ | "unmeasured"
488
+ /**
489
+ * The door counted page views of this revision and no rollup has folded any of
490
+ * them.
491
+ *
492
+ * A revision published minutes ago and a collection that has stopped look
493
+ * alike in the counts, because the lag of the tallies behind the buffer is one
494
+ * window by design (0158). Where the row attests a fold and a caller handed in
495
+ * a schedule, the two are told apart and a stalled one is `faulted` instead
496
+ * (0274); where either is missing, this names the state and claims nothing
497
+ * about which it is.
498
+ */
499
+ | "unfolded";
500
+ export declare const HEALTH_STANDINGS: readonly HealthStanding[];
501
+ /** One line per standing, for a surface saying why a page is where it is. */
502
+ export declare const describeHealthStanding: (standing: HealthStanding) => string;
503
+ /** One revision of one page, and what is wrong with what was collected about it. */
504
+ export type PageHealth = {
505
+ readonly treeId: TreeId;
506
+ readonly revision: number;
507
+ /**
508
+ * The audience this row is about, or `null` where the reading named none.
509
+ *
510
+ * Two forms of one page are two rows here and not one page counted twice
511
+ * (`readingKeyOf`), for the reason two revisions of one tree are two rows: a
512
+ * deployment serving both is running both, and a health screen that showed
513
+ * one of them would be hiding a live form of a live page.
514
+ */
515
+ readonly audienceId: AudienceId | null;
516
+ readonly standing: HealthStanding;
517
+ /**
518
+ * Every fault, in the order {@link COLLECTION_FAULTS} publishes them, which is
519
+ * the order they are worth reading in: the one that costs the denominator
520
+ * first, the four that are the deployment's, then the caller's.
521
+ *
522
+ * Empty on every standing but `faulted`.
523
+ */
524
+ readonly faults: readonly CollectionFault[];
525
+ /**
526
+ * The window's view floor, carried through from the reading unchanged.
527
+ *
528
+ * A floor and not a count (0212), which is why it is never ranked and never
529
+ * added to an arrival count here.
530
+ */
531
+ readonly views: number;
532
+ /**
533
+ * Page views counted at the door, exact, or `null` where this revision has no
534
+ * row.
535
+ *
536
+ * On a faulted page these are the readers whose measurement its faults
537
+ * affect, which is what makes one faulted page worse than another.
538
+ */
539
+ readonly arrivals: number | null;
540
+ /** The same page views as the rollups saw them, or `null` with no row. */
541
+ readonly appearances: number | null;
542
+ /** This revision's own straddle rate, or `null` where nothing has opened. */
543
+ readonly inflation: number | null;
544
+ /**
545
+ * Openings no rollup has folded yet, which is a figure and never a fault here.
546
+ *
547
+ * Zero where there is no door row, because an absent row reports no openings
548
+ * rather than none pending.
549
+ */
550
+ readonly pending: number;
551
+ /**
552
+ * When a rollup last folded a window holding page views of this revision, or
553
+ * `null` where nothing attests one — including every revision with no door
554
+ * row at all.
555
+ *
556
+ * Published whether or not a schedule was handed in, because *the last fold
557
+ * of this page was at nine this morning* is the sentence an operator reads
558
+ * before any verdict about it (0274). `null` is not *never folded*: a row
559
+ * written before the column existed says the same thing, and the first fold
560
+ * after an upgrade fills it in.
561
+ */
562
+ readonly foldedAt: string | null;
563
+ /** Counters naming nodes this revision does not contain. */
564
+ readonly orphaned: number;
565
+ /** Node counters and door rows handed in more than once, added. */
566
+ readonly doubled: number;
567
+ /**
568
+ * Parts that reported nothing while a part inside them reported being
569
+ * reached, which is what `parts-unreporting` is raised on.
570
+ *
571
+ * A count of **parts of the tree** and never of readers, so it is never
572
+ * ranked and never added to an arrival count — the figure that says how bad
573
+ * a faulted page is stays {@link PageHealth.arrivals}, here as everywhere
574
+ * else. It is published beside the fault for the reason `orphaned` and
575
+ * `doubled` are: *your senders are not reporting* is a verdict, and *on one
576
+ * part of this page* and *on nineteen* are two different mornings.
577
+ *
578
+ * **It is a floor on the defect and not a measure of it.** Only a part with
579
+ * something reported inside it can be seen from the counters, so a silent
580
+ * leaf is counted nowhere here and reads as a part nobody reached.
581
+ */
582
+ readonly unreporting: number;
583
+ };
584
+ /** What a deployment is collecting, and what is wrong with it. */
585
+ export type CollectionHealth = {
586
+ /** Every revision read, by tree id and newest revision first. */
587
+ readonly pages: readonly PageHealth[];
588
+ /**
589
+ * Faulted revisions the door can price, worst first.
590
+ *
591
+ * Most arrivals, then the larger view floor, then tree id and newest revision
592
+ * first — so two pages costing the same do not reorder on a refresh. By
593
+ * headcount and never by a count of faults: one fault on a page nine thousand
594
+ * people read is worse than four on a page three did (0221).
595
+ */
596
+ readonly faulted: readonly PageHealth[];
597
+ /**
598
+ * Faulted revisions with no exact arrival count, by tree id and newest
599
+ * revision first.
600
+ *
601
+ * Out of the ranking rather than in it at a guessed height, which is the
602
+ * refusal an order of pages makes about a page the door cannot scale (0250),
603
+ * said about an order of faults.
604
+ */
605
+ readonly unpriced: readonly PageHealth[];
606
+ /** The faulted page costing the most readers, which is the one to look at first. */
607
+ readonly worst: PageHealth | null;
608
+ readonly standings: Readonly<Record<HealthStanding, number>>;
609
+ /**
610
+ * How many revisions carry each fault.
611
+ *
612
+ * A count of pages and never of readers, and it does **not** add to
613
+ * {@link standings}' `faulted`: a revision with three faults is one faulted
614
+ * page and is in three of these rows.
615
+ */
616
+ readonly faults: Readonly<Record<CollectionFault, number>>;
617
+ /**
618
+ * Page views at the door of every faulted revision the door can price, added
619
+ * — each revision once however many faults it has.
620
+ *
621
+ * The headline figure: *the measurement of eleven hundred of your readers is
622
+ * wrong in some way*. Exact and addable because a page view began on one
623
+ * revision of one tree and was counted once (0219).
624
+ */
625
+ readonly readersAffected: number;
626
+ /**
627
+ * Page views at the door across every revision read, added.
628
+ *
629
+ * The weight behind `readersAffected` — a share of readers rather than a share
630
+ * of pages is what says whether a fault is marginal. This sees the pages its
631
+ * caller read and not the deployment's.
632
+ */
633
+ readonly arrivals: number;
634
+ /**
635
+ * Openings no rollup has folded, added across the revisions read.
636
+ *
637
+ * A figure and not a verdict: most of it is the ordinary one-window lag of
638
+ * the tallies behind the buffer (0158). Whether any of it is late is
639
+ * `collection-stalled`, which needs the fold's own timestamp and a schedule
640
+ * (0274) — so this number is published the same whether one was handed in or
641
+ * not.
642
+ */
643
+ readonly pending: number;
644
+ /**
645
+ * Revisions with openings waiting and no fold timestamp to judge the wait by.
646
+ *
647
+ * The honest companion to `pending`, and the state a deployment is in for one
648
+ * run after it upgrades past the `folded_at` column: the openings are real,
649
+ * the lag may be a minute or a fortnight, and the rows do not say. A surface
650
+ * showing `pending` without this would let a reader take *no fault* for
651
+ * *nothing is late*.
652
+ *
653
+ * It counts rows rather than readers, and it is **not** a fault: nothing is
654
+ * wrong with a row that cannot answer a question nobody could ask of it
655
+ * before today.
656
+ */
657
+ readonly unattested: number;
658
+ /**
659
+ * Distinct trees across the revisions read, which is not the number of pages.
660
+ *
661
+ * Two revisions of one tree are two live versions of one page and both stand
662
+ * here, as they do in an order of pages (0250) and a census of a library
663
+ * (0257).
664
+ */
665
+ readonly trees: number;
666
+ /**
667
+ * Readings of a revision beyond the first, which were dropped.
668
+ *
669
+ * The one lie this reading can be told: a caller holding one page twice would
670
+ * have its readers counted twice in `readersAffected`, and a count that has
671
+ * been added cannot be unadded (0158).
672
+ */
673
+ readonly duplicated: number;
674
+ };
675
+ /**
676
+ * What a deployment is collecting, read off the page readings and the door rows
677
+ * it already has.
678
+ *
679
+ * Takes the readings rather than the counters, as every derived reading here
680
+ * does: the join to the tree is what makes an orphaned counter and an uncredited
681
+ * action visible at all, and deriving it twice is how two screens come to
682
+ * disagree. A caller with counters and trees reads the parts, then this.
683
+ *
684
+ * The rows are the whole window of door rows a deployment holds, not one page's
685
+ * — each revision's own row is picked out of them by the published rule (0219),
686
+ * so no caller writes the matching itself.
687
+ *
688
+ * The schedule is optional and is the only argument here that is not a row: a
689
+ * caller that states what its collection promises gets `collection-stalled`
690
+ * judged for it, and one that does not gets every other fault and `pending`
691
+ * published unjudged (0274).
692
+ */
693
+ export declare const collectionHealthOf: (readings: readonly PageReading[], rows: readonly StoredPageViews[], schedule?: CollectionSchedule) => CollectionHealth;
694
+ //# sourceMappingURL=health.d.ts.map