@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,501 @@
1
+ import type { NodeId, TreeId } from "../ids.js";
2
+ import type { PrimitiveType } from "../primitive-type.js";
3
+ import type { PrimitiveRole } from "../role.js";
4
+ import { type ComparedAudiences } from "./audiences.js";
5
+ import type { PageReading } from "./parts.js";
6
+ import { type Ratio } from "./ratios.js";
7
+ import { type PacedPart, type PagePace, type PaceStanding } from "./pace.js";
8
+ /**
9
+ * What a change did to whether readers had time to read what a page says.
10
+ *
11
+ * [`pace.ts`](pace.ts) answers *readers had a third of the time this band's
12
+ * words take* — of **one window of one revision**. The sentence a change is
13
+ * judged by is the next one, and on a page that was cut rather than rearranged
14
+ * it is the only one that answers: *the band readers used to skim is read
15
+ * now.* [`change.ts`](change.ts) asks where reading stops, and
16
+ * [`copy-change.ts`](copy-change.ts) asks how many of the page's words got
17
+ * reached. Neither asks whether there was **time** for them, which is the one
18
+ * question a rewrite is usually aimed at.
19
+ *
20
+ * It is the **eleventh** thing taken out of the server-side join of
21
+ * [0212](../../decisions/0212-what-a-reader-signal-means-is-joined-to-the-tree-when-it-is-read.md)
22
+ * rather than collected: nothing was added to a payload, a browser, a column, a
23
+ * store or the vocabulary, and the broadcaster was not touched.
24
+ *
25
+ * ## The division has two sides and a change can move either
26
+ *
27
+ * A pace is `spentMs ÷ needMs` — the time a reader had against the time the
28
+ * words take. So a part that stops being skimmed has moved for one of two
29
+ * reasons, and they are opposite findings:
30
+ *
31
+ * - **readers stayed longer**, which is a fact about the readers; or
32
+ * - **the page asks for less**, which is a fact about the change, and the
33
+ * commonest thing anybody does to a band nobody reads.
34
+ *
35
+ * A single before-and-after figure cannot tell them apart, and the one that
36
+ * reads best is the one that means least: a band halved in length is *paced*
37
+ * with no reader having given it a second more attention. So every compared
38
+ * part carries both factors — {@link ComparedPace.timeRatio} and
39
+ * {@link ComparedPace.needRatio}, whose quotient is
40
+ * {@link ComparedPace.paceRatio} — and the verdict's cause is attributed
41
+ * below.
42
+ *
43
+ * ## The attribution is a counterfactual and needs no threshold
44
+ *
45
+ * *Which of the two moved it* could be asked as *which moved more*, and that
46
+ * needs a threshold on what counts as a move — a dial the framework would be
47
+ * inventing. It is asked instead as **what would have happened if one side had
48
+ * not moved**, which the rows already answer:
49
+ *
50
+ * - {@link ComparedPace.ifWordsHeld} is the later window's time against the
51
+ * earlier revision's words — the pace this part would have had if the change
52
+ * had left its text alone. It isolates the readers.
53
+ * - {@link ComparedPace.ifTimeHeld} is the earlier window's time against the
54
+ * later revision's words — the pace it would have had if no reader had
55
+ * changed their behaviour. It isolates the change.
56
+ *
57
+ * Each is run through the published verdict rule, so {@link PaceCause} says
58
+ * whether the change alone was sufficient, the readers alone were, either was,
59
+ * or only the two together — and no number anywhere decides what *enough* is.
60
+ * A floor on either side's words leaves the counterfactual `unknown` rather
61
+ * than guessed, because the words a counterfactual divides by are the ones
62
+ * nobody counted.
63
+ *
64
+ * ## What is comparable here, and what is not
65
+ *
66
+ * **A pace is**, which is not true of the counts it is made of. `spentMs` is
67
+ * `dwellMs × (1 + inflation) ÷ reached` off **one side's own row**, so the
68
+ * straddle over-count (0147) is in both of its terms and has very nearly
69
+ * divided out before the two sides meet — which is
70
+ * [0221](../../decisions/0221-where-reading-stops-is-a-fall-between-two-siblings-and-a-ratio-of-two-counts-off-one-row-set.md)'s
71
+ * cancellation and
72
+ * [0224](../../decisions/0224-a-before-and-after-reading-compares-two-shares-and-a-pair-the-change-dissolved-is-an-answer.md)'s
73
+ * rule, applied to a part's pace rather than to a fall between siblings.
74
+ * `needMs` has no reader in it at all.
75
+ *
76
+ * **A standing is not, quite**: `skimmed` is a verdict about the mean reader of
77
+ * a window, so a quiet window and a busy one judge the same part on different
78
+ * evidence. That is why {@link PaceMovement} is named for a movement and never
79
+ * for an improvement, and why nothing here divides one side's count by the
80
+ * other's.
81
+ *
82
+ * **A position is not involved.** Nothing here reads a depth, an index or a
83
+ * parent, so a band dragged to the top of the page is compared like any other —
84
+ * `copy-change.ts`'s rule for a passage, for the same reason: a pair of
85
+ * siblings is a position by construction (0224) and a part's pace is not.
86
+ *
87
+ * ## The sums that are therefore missing
88
+ *
89
+ * A part is judged against its **subtree's** words
90
+ * ([0230](../../decisions/0230-a-part-was-read-when-readers-had-time-for-its-words-and-only-the-skim-is-a-safe-claim.md)),
91
+ * so the figures nest: a band and the paragraph inside it are both here and the
92
+ * paragraph's words are in the band's count. **There is no page-wide total of
93
+ * words, time or readers kept**, because one reader who raced past a band
94
+ * raced past everything in it and a sum would charge them once per level. The
95
+ * page's own figure is {@link PaceChange.whole} — the root, whose subtree is
96
+ * the page — and it is a row rather than an addition, exactly as
97
+ * `pace.ts` publishes it apart and as 0242 publishes the root's `engaged`
98
+ * apart.
99
+ *
100
+ * Pure, linear in the parts of the two readings, and reaches no store, clock or
101
+ * DOM. A caller checks `PageReading.orphaned` on both readings before trusting
102
+ * either, as it must before trusting either pace reading.
103
+ */
104
+ /** Why a comparison of two windows' pace answered nothing. */
105
+ export type PaceChangeSilence =
106
+ /**
107
+ * The two readings are of different trees.
108
+ *
109
+ * Nothing is comparable and nothing is countable. Spelled as `ChangeSilence`
110
+ * and `CopyChangeSilence` spell it, because a surface drawing three
111
+ * comparisons of one change should not meet three names for one state
112
+ * (0240).
113
+ */
114
+ "different-trees"
115
+ /**
116
+ * The two readings are of two audiences, and so of two populations.
117
+ *
118
+ * Spelled and refused as the other comparisons spell and refuse it (0240). A
119
+ * page is one base tree plus the deltas an audience earns (0263), so the time
120
+ * the other form asks for would be read as the time this change added, and
121
+ * the two sides' spent time is two populations' reading.
122
+ *
123
+ * Refused only where both sides name an audience and the two differ; a pair
124
+ * spanning the migration that added the column (0284) is in
125
+ * {@link PaceChange.audiences} instead.
126
+ */
127
+ | "different-audiences"
128
+ /**
129
+ * Neither revision says anything that takes time to read.
130
+ *
131
+ * No words on either side and nothing undeclared either, so there is no
132
+ * `needMs` to divide by anywhere on the page.
133
+ */
134
+ | "wordless"
135
+ /**
136
+ * One of the two windows holds two forms of the page and named neither.
137
+ *
138
+ * The state the before-and-after reading and the two deployment orders took
139
+ * the morning before (0301), in one of the three readings that record did not
140
+ * reach. Without it this comparison published `nothing-measured` — *one of the two windows
141
+ * held no page views* — of a window that held plenty: it held two forms of
142
+ * them. A page reading read as neither has a view floor of nought with full
143
+ * counters behind it (`parts.ts`), so the floor alone cannot tell a window
144
+ * nobody read from a window nobody split, and the two sentences send a
145
+ * deployment to opposite places: one to look for a broken sender, the other
146
+ * to split the window and read twice, which is a call away.
147
+ *
148
+ * **The word side still answers**, which is the half `nothing-measured`
149
+ * leaves standing and for its reason: what the change did to the time the
150
+ * page asks for is a fact about the two trees and about no counter. Every
151
+ * figure about readers is withheld, and the two pace readings on the
152
+ * comparison stay honest about the windows they were each handed.
153
+ *
154
+ * **It cannot co-occur with `different-audiences`**, so the order between the
155
+ * two is not observable: `crossesAudiences` needs an audience on both sides
156
+ * and a mixed side has none, while a side that names one and holds two in its
157
+ * census reads as `one`, because an audience asked for always wins (0300).
158
+ * The order that does matter is **after `wordless` and before the view
159
+ * floor**, for the reason the before-and-after gives: a page saying nothing
160
+ * survives the remedy, and the floor is this state's own symptom.
161
+ */
162
+ | "audiences-mixed"
163
+ /**
164
+ * One of the two windows held no page views.
165
+ *
166
+ * Every part on that side is `unreached` (`pace.ts`), so there is no time to
167
+ * compare. **The word side still answers**: what the change did to the time
168
+ * the page asks for is a fact about the two trees, and *this band asks for
169
+ * two hundred words less than it did, and nothing has been measured since* is
170
+ * true and worth saying.
171
+ */
172
+ | "nothing-measured"
173
+ /**
174
+ * No part of the page is in both revisions, so there is nothing to compare.
175
+ *
176
+ * The same state `CopyChangeSilence.dissolved` reports of words, said of
177
+ * parts: a page that carries no part carries no word either, so this is that
178
+ * condition and not a neighbouring one (0240). The census of what was added
179
+ * and removed answers in full and is the whole of what can be said.
180
+ */
181
+ | "dissolved";
182
+ /** The closed set, for a surface that has to account for every absent figure. */
183
+ export declare const PACE_CHANGE_SILENCES: readonly PaceChangeSilence[];
184
+ /** One line per silence, for a surface saying why a figure is not there. */
185
+ export declare const describePaceChangeSilence: (silence: PaceChangeSilence) => string;
186
+ /**
187
+ * What happened to the verdict on one part between two windows.
188
+ *
189
+ * Five states out of two verdicts either side, and the asymmetry of 0230 is why
190
+ * they are not nine: `skimmed` is the claim that survives every bias, and
191
+ * `paced` and `lingered` are the weaker ones. So a part moving between those
192
+ * two has not moved in any way worth a name, and the set is *did it stop being
193
+ * skimmed, did it start, or neither*.
194
+ *
195
+ * Named for a movement rather than for an improvement, because a verdict is
196
+ * about the mean reader of its own window: a part can ease because the page got
197
+ * shorter, because readers slowed down, or because a quieter window had a
198
+ * different set of readers in it. {@link ComparedPace.cause} separates the
199
+ * first two and nothing can separate the third.
200
+ */
201
+ export type PaceMovement =
202
+ /**
203
+ * Skimmed before, and not now — the sentence a rewrite is made for.
204
+ *
205
+ * Check {@link ComparedPace.cause} before reading it as readers having
206
+ * slowed: a band cut in half eases with nobody having given it a moment more.
207
+ */
208
+ "eased"
209
+ /** Read before, and skimmed now. */
210
+ | "rushed"
211
+ /**
212
+ * Skimmed before and skimmed now — the parts a change did not fix.
213
+ *
214
+ * Kept apart from `held` because the two are opposite findings about a page
215
+ * and both are *the verdict did not move*.
216
+ */
217
+ | "still-skimmed"
218
+ /** Read on both sides, whether paced or lingered. */
219
+ | "held"
220
+ /**
221
+ * One side has no verdict, so there is nothing to compare.
222
+ *
223
+ * Nobody reached it in that window, or its words are a floor and the verdict
224
+ * the floor would support is not the safe one (0230). Which it is, is on that
225
+ * side's own `silence`.
226
+ */
227
+ | "unknown";
228
+ /** The closed set, for a surface accounting for every part it was handed. */
229
+ export declare const PACE_MOVEMENTS: readonly PaceMovement[];
230
+ /** One line per movement, for a surface putting a part in front of a person. */
231
+ export declare const describePaceMovement: (movement: PaceMovement) => string;
232
+ /**
233
+ * Which side of the division the verdict moved with.
234
+ *
235
+ * Answered by sufficiency rather than by magnitude: *would this verdict have
236
+ * arrived anyway, if only one of the two had moved*. `null` on a part whose
237
+ * verdict did not move, because there is nothing to attribute.
238
+ */
239
+ export type PaceCause =
240
+ /**
241
+ * The change alone was enough: the words the later revision asks for would
242
+ * have produced today's verdict at the earlier window's reading time.
243
+ *
244
+ * The attribution worth leading with, and the one a single pace figure hides.
245
+ * *This band is paced because it is shorter, and not because anybody is
246
+ * reading it.*
247
+ */
248
+ "words"
249
+ /**
250
+ * The readers alone were enough: the later window's time would have produced
251
+ * today's verdict against the words the page used to say.
252
+ */
253
+ | "time"
254
+ /** Either alone would have been enough, so the move is over-determined. */
255
+ | "either"
256
+ /** Neither alone would have been enough and the two together were. */
257
+ | "together"
258
+ /**
259
+ * A counterfactual has no verdict, so neither question can be answered.
260
+ *
261
+ * One side's words are a floor, which the mixed pace of a counterfactual
262
+ * inherits from both sides: the words it divides by are the ones nobody
263
+ * counted (0122).
264
+ */
265
+ | "unknown";
266
+ /** The closed set, for a surface accounting for every verdict that moved. */
267
+ export declare const PACE_CAUSES: readonly PaceCause[];
268
+ /** One line per cause, for a surface saying what moved a verdict. */
269
+ export declare const describePaceCause: (cause: PaceCause) => string;
270
+ /**
271
+ * A pace neither window reported, and the verdict it would have carried.
272
+ *
273
+ * One side's time against the other side's words. It is not a measurement of
274
+ * anything that happened — it is the measurement of what did not — and it
275
+ * exists so that {@link PaceCause} can be answered without a threshold.
276
+ */
277
+ export type PaceHeld = {
278
+ /** `null` where there is nothing to divide: no reader on the side the time came from, or no words on the side the words came from. */
279
+ readonly pace: number | null;
280
+ /**
281
+ * The verdict that pace carries, under **either** side's floor.
282
+ *
283
+ * A floor is taken from both sides because a counterfactual's two terms come
284
+ * from two revisions, and words nobody counted on either one are words
285
+ * missing from this ratio. The conservative reading, which leaves it
286
+ * `unknown` rather than claiming the weaker verdicts.
287
+ */
288
+ readonly standing: PaceStanding;
289
+ };
290
+ /**
291
+ * One part both revisions have, as two windows paced it.
292
+ *
293
+ * Matched by node, which is what makes the comparison about the part rather
294
+ * than about its position.
295
+ */
296
+ export type ComparedPace = {
297
+ readonly nodeId: NodeId;
298
+ /** The later revision's type, which is the page somebody is looking at. */
299
+ readonly type: PrimitiveType;
300
+ /** The later revision's role (0114), or `null` where its type declared none. */
301
+ readonly role: PrimitiveRole | null;
302
+ /** The whole of what the earlier window said about it. */
303
+ readonly was: PacedPart;
304
+ /** The whole of what the later window said about it. */
305
+ readonly now: PacedPart;
306
+ readonly movement: PaceMovement;
307
+ /**
308
+ * `now.pace ÷ was.pace`, with the reason named where there is no quotient
309
+ * (0306).
310
+ *
311
+ * Exactly {@link timeRatio} ÷ {@link needRatio}, which is the identity this
312
+ * module is built on: a pace moves because readers' time moved, because the
313
+ * words moved, or both. The identity holds over the quotients and not over
314
+ * the absences: a part whose words were wordless then and are not now has no
315
+ * pace to divide and three absences that do not multiply.
316
+ */
317
+ readonly paceRatio: Ratio;
318
+ /**
319
+ * `now.spentMs ÷ was.spentMs` — the readers' side of the division.
320
+ *
321
+ * Each term is a mean off one side's own row, so each side's straddle has
322
+ * very nearly divided out before they meet. `unmeasured` where either side
323
+ * had no reader, and `from-nothing` where the earlier window's readers spent
324
+ * no measurable time at all.
325
+ */
326
+ readonly timeRatio: Ratio;
327
+ /**
328
+ * `now.needMs ÷ was.needMs` — the page's side of the division.
329
+ *
330
+ * Exact and reader-free: it is what the change did to the time this part's
331
+ * words ask for. Below 1 is a part the change shortened, and `from-nothing`
332
+ * is a part the earlier revision left wordless — which is a fact about the
333
+ * change rather than about a window, and the one absence here no reader can
334
+ * cause.
335
+ */
336
+ readonly needRatio: Ratio;
337
+ /** The later window's time against the earlier revision's words — the readers alone. */
338
+ readonly ifWordsHeld: PaceHeld;
339
+ /** The earlier window's time against the later revision's words — the change alone. */
340
+ readonly ifTimeHeld: PaceHeld;
341
+ /** Which side the verdict moved with, and `null` where it did not move. */
342
+ readonly cause: PaceCause | null;
343
+ };
344
+ /** A time total, before and after, with the subtraction done once. */
345
+ export type TimeCount = {
346
+ readonly was: number;
347
+ readonly now: number;
348
+ readonly change: number;
349
+ };
350
+ /**
351
+ * What a change did to the time a page's words ask of its readers, and to
352
+ * whether they had it.
353
+ *
354
+ * Two readings in, one comparison out. The two {@link PagePace}s it derives are
355
+ * returned, so nothing downstream computes them twice and every whole-page
356
+ * figure either side is one field away without a second join.
357
+ */
358
+ export type PaceChange = {
359
+ /** The earlier reading's tree. The two agree unless `silence` is `different-trees`. */
360
+ readonly treeId: TreeId;
361
+ readonly revisions: {
362
+ readonly was: number;
363
+ readonly now: number;
364
+ };
365
+ /**
366
+ * The audience each side was of, where its reading named one.
367
+ *
368
+ * As `ReadingChange.audiences` carries it, and for the same reason: a `null`
369
+ * on either side is why an unprovable pair of populations is compared rather
370
+ * than refused.
371
+ */
372
+ readonly audiences: ComparedAudiences;
373
+ /** The two pace readings this comparison is made of. */
374
+ readonly readings: {
375
+ readonly was: PagePace;
376
+ readonly now: PagePace;
377
+ };
378
+ /**
379
+ * Every part both revisions have that says something on either side, in the
380
+ * **later** reading order.
381
+ *
382
+ * The later order because that is the page somebody is looking at. A part
383
+ * whose subtree says nothing on both sides and hides nothing on either is
384
+ * left out altogether: it has no pace in any window, so a row for it would
385
+ * only ever read `unknown` and would make {@link movements} a count of
386
+ * spacers.
387
+ */
388
+ readonly compared: readonly ComparedPace[];
389
+ /**
390
+ * Parts only the later revision has, as it paced them, in its reading order.
391
+ *
392
+ * A census with readers in it rather than an exact one, unlike the census of
393
+ * the words a change wrote (0239): a part nobody could have read before still
394
+ * has to be read now for anything to be said about it. *The change added a
395
+ * band and readers are skimming it* is the row worth looking at.
396
+ */
397
+ readonly added: readonly PacedPart[];
398
+ /** Parts only the earlier revision had, as it paced them, in its reading order. */
399
+ readonly removed: readonly PacedPart[];
400
+ /** Compared parts by what happened to the verdict. The five add to {@link compared}'s length. */
401
+ readonly movements: Readonly<Record<PaceMovement, number>>;
402
+ /**
403
+ * The parts whose verdict moved, by what moved it. The five add to
404
+ * `movements.eased + movements.rushed`.
405
+ */
406
+ readonly causes: Readonly<Record<PaceCause, number>>;
407
+ /**
408
+ * The root, compared against itself across the two revisions.
409
+ *
410
+ * *Readers had a third of the time this page's words take and now they have
411
+ * half* — the page's one figure, and a row rather than an addition for the
412
+ * reason the module documentation gives. Kept out of the rankings below,
413
+ * because its subtree is every part it would outrank.
414
+ *
415
+ * `null` where either revision's root is not an element, or where the root
416
+ * says nothing on both sides.
417
+ */
418
+ readonly whole: ComparedPace | null;
419
+ /**
420
+ * The part the change made most room to read: `eased`, most words passed
421
+ * now, then first in the later reading order.
422
+ *
423
+ * By words passed — readers times the words they were shown — rather than by
424
+ * the change in pace, which is the ranking rule a fall between two siblings
425
+ * and a skimmed part already use (0221, 0230): a caption two readers now have
426
+ * time for is a better ratio and a smaller gain than a band four hundred of
427
+ * them do.
428
+ */
429
+ readonly mostEased: ComparedPace | null;
430
+ /** The part it cost most, on the same terms. */
431
+ readonly mostRushed: ComparedPace | null;
432
+ /**
433
+ * The parts readers skimmed before and skim now, most words passed first,
434
+ * then in the later reading order.
435
+ *
436
+ * The list a person can act on without reading anything else, and the one
437
+ * ranking here that is about where a change did **not** land. The root is
438
+ * left out, as it is left out of every ranking here, because its subtree is
439
+ * every part it would outrank; {@link whole} carries it. `still-skimmed`
440
+ * only: a part whose verdict is `unknown` on either side is in
441
+ * {@link movements} where it can be seen and not acted on, because putting it
442
+ * here would turn *nothing can be said* into *readers are not reading this*.
443
+ */
444
+ readonly stillSkimmed: readonly ComparedPace[];
445
+ /**
446
+ * What the two revisions ask of a reader who reads every word of them, before
447
+ * and after.
448
+ *
449
+ * The root's `needMs` on each side, which is the page's whole text costed
450
+ * once — not a sum over the parts, which would charge a reader once per level
451
+ * (0230). `null` where there is no {@link whole} to read it off.
452
+ */
453
+ readonly need: TimeCount | null;
454
+ /** Why there is no comparison of the reading, or `null` where there is one. */
455
+ readonly silence: PaceChangeSilence | null;
456
+ /** The costing rate both sides were read at, which is the published default unless one was given. */
457
+ readonly wordsPerMinute: number;
458
+ /** The straddle correction applied to each side; `0` where none was given. */
459
+ readonly inflation: {
460
+ readonly was: number;
461
+ readonly now: number;
462
+ };
463
+ };
464
+ /**
465
+ * How the two sides were read.
466
+ *
467
+ * **One rate and two inflations**, and the asymmetry is the point. A costing
468
+ * rate is a fact about the page's text and its language (0230), so it is the
469
+ * same fact on both sides of a change and a comparison whose two sides were
470
+ * costed differently would be a comparison of the rates. A straddle inflation
471
+ * is a fact about **one window** — `drift ÷ opened` off that window's
472
+ * page-view row (0219) — and the two windows can honestly differ, which is
473
+ * exactly why a rollup window a deployment shortened shows up here as the
474
+ * correction changing and not as readers changing.
475
+ */
476
+ export type PaceChangeOptions = {
477
+ readonly inflation?: {
478
+ readonly was?: number;
479
+ readonly now?: number;
480
+ };
481
+ readonly wordsPerMinute?: number;
482
+ };
483
+ /**
484
+ * What a change did to whether readers had time for what a page says.
485
+ *
486
+ * Handed two `PageReading`s rather than two `PagePace`s, for the reason
487
+ * `copyChangeOf` is handed two: one input per side cannot be a mismatched pair.
488
+ * Here it buys a second guarantee that matters more — **the two sides cannot
489
+ * have been costed at different rates**, which no caller holding two finished
490
+ * pace readings could be stopped from doing and which would make every ratio
491
+ * below a comparison of the rates. The two pace readings it derives are
492
+ * returned.
493
+ *
494
+ * The labels `was` and `now` are the caller's. Nothing here checks which
495
+ * reading is older, so a caller holding them backwards gets a comparison with
496
+ * every movement reversed rather than a refusal — the same bargain 0224 struck,
497
+ * for the same reason: *this week against last week* is the same question with
498
+ * the tree held still, and refusing one order would refuse that too.
499
+ */
500
+ export declare const paceChangeOf: (was: PageReading, now: PageReading, options?: PaceChangeOptions) => PaceChange;
501
+ //# sourceMappingURL=pace-change.d.ts.map