@jam-overture/loom 0.2.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 (194) hide show
  1. package/dist/audience/compose.d.ts +112 -0
  2. package/dist/audience/compose.js +134 -0
  3. package/dist/audience/memory.d.ts +14 -0
  4. package/dist/audience/memory.js +71 -0
  5. package/dist/audience/overlay-store.d.ts +343 -0
  6. package/dist/audience/overlay-store.js +217 -0
  7. package/dist/audience/rule.d.ts +121 -0
  8. package/dist/audience/rule.js +78 -0
  9. package/dist/cli/index.d.ts +3 -4
  10. package/dist/cli/index.js +3 -4
  11. package/dist/data/adapter.d.ts +9 -1
  12. package/dist/data/adapter.js +2 -0
  13. package/dist/data/resolve.d.ts +1 -1
  14. package/dist/interpretation/anthropic.d.ts +1 -1
  15. package/dist/interpretation/anthropic.js +2 -22
  16. package/dist/interpretation/client.d.ts +1 -1
  17. package/dist/interpretation/materialize.js +67 -22
  18. package/dist/interpretation/openai-compatible.d.ts +36 -0
  19. package/dist/interpretation/openai-compatible.js +79 -0
  20. package/dist/interpretation/status.d.ts +19 -0
  21. package/dist/interpretation/status.js +26 -0
  22. package/dist/live/index.d.ts +73 -0
  23. package/dist/live/index.js +73 -0
  24. package/dist/live/pages.d.ts +187 -0
  25. package/dist/live/pages.js +161 -0
  26. package/dist/live/pull.d.ts +147 -0
  27. package/dist/live/pull.js +398 -0
  28. package/dist/live/pulling.d.ts +79 -0
  29. package/dist/live/pulling.js +117 -0
  30. package/dist/live/window.d.ts +129 -0
  31. package/dist/live/window.js +132 -0
  32. package/dist/render/addressed.d.ts +35 -0
  33. package/dist/render/addressed.js +79 -0
  34. package/dist/render/document-theme.d.ts +70 -0
  35. package/dist/render/document-theme.js +139 -0
  36. package/dist/render/editable.d.ts +15 -1
  37. package/dist/render/editable.js +13 -1
  38. package/dist/render/expected.d.ts +98 -0
  39. package/dist/render/expected.js +88 -0
  40. package/dist/render/index.d.ts +2 -0
  41. package/dist/render/index.js +2 -0
  42. package/dist/render/render.d.ts +11 -0
  43. package/dist/render/render.js +192 -46
  44. package/dist/render/request.d.ts +8 -1
  45. package/dist/render/request.js +1 -0
  46. package/dist/runtime/auto-apply-ceiling.d.ts +54 -0
  47. package/dist/runtime/auto-apply-ceiling.js +66 -0
  48. package/dist/runtime/gate.js +69 -10
  49. package/dist/runtime/index.d.ts +1 -0
  50. package/dist/runtime/index.js +1 -0
  51. package/dist/runtime/nesting.d.ts +13 -1
  52. package/dist/runtime/nesting.js +41 -24
  53. package/dist/runtime/policy-change.js +8 -2
  54. package/dist/runtime/policy-log.d.ts +5 -5
  55. package/dist/runtime/policy.d.ts +8 -6
  56. package/dist/runtime/policy.js +5 -2
  57. package/dist/runtime/repointing.js +0 -0
  58. package/dist/sdk/definition.d.ts +65 -6
  59. package/dist/sdk/definition.js +44 -0
  60. package/dist/sdk/registry.d.ts +17 -1
  61. package/dist/sdk/registry.js +39 -0
  62. package/dist/signals/acted.contract.d.ts +21 -0
  63. package/dist/signals/acted.contract.js +236 -0
  64. package/dist/signals/acted.d.ts +359 -0
  65. package/dist/signals/acted.js +135 -0
  66. package/dist/signals/agenda.d.ts +585 -0
  67. package/dist/signals/agenda.js +295 -0
  68. package/dist/signals/arrivals.contract.d.ts +21 -0
  69. package/dist/signals/arrivals.contract.js +180 -0
  70. package/dist/signals/arrivals.d.ts +375 -0
  71. package/dist/signals/arrivals.js +254 -0
  72. package/dist/signals/broadcast.d.ts +25 -15
  73. package/dist/signals/broadcast.js +209 -36
  74. package/dist/signals/collect.d.ts +137 -43
  75. package/dist/signals/collect.js +103 -36
  76. package/dist/signals/conversion.d.ts +348 -0
  77. package/dist/signals/conversion.js +235 -0
  78. package/dist/signals/correlated.contract.d.ts +24 -0
  79. package/dist/signals/correlated.contract.js +94 -0
  80. package/dist/signals/counters.d.ts +51 -0
  81. package/dist/signals/counters.js +58 -0
  82. package/dist/signals/deployment-change.d.ts +28 -4
  83. package/dist/signals/deployment-change.js +57 -16
  84. package/dist/signals/deployment.d.ts +18 -5
  85. package/dist/signals/deployment.js +37 -11
  86. package/dist/signals/door.d.ts +34 -12
  87. package/dist/signals/door.js +37 -13
  88. package/dist/signals/expire.d.ts +192 -0
  89. package/dist/signals/expire.js +213 -0
  90. package/dist/signals/frontier.d.ts +268 -0
  91. package/dist/signals/frontier.js +145 -0
  92. package/dist/signals/funnel-hours.contract.d.ts +21 -0
  93. package/dist/signals/funnel-hours.contract.js +221 -0
  94. package/dist/signals/funnel-hours.d.ts +293 -0
  95. package/dist/signals/funnel-hours.js +99 -0
  96. package/dist/signals/funnel.d.ts +60 -0
  97. package/dist/signals/funnel.js +35 -20
  98. package/dist/signals/health.d.ts +201 -4
  99. package/dist/signals/health.js +214 -2
  100. package/dist/signals/index.d.ts +19 -0
  101. package/dist/signals/index.js +19 -0
  102. package/dist/signals/inside.d.ts +190 -0
  103. package/dist/signals/inside.js +263 -0
  104. package/dist/signals/join.d.ts +56 -0
  105. package/dist/signals/join.js +60 -0
  106. package/dist/signals/journal.d.ts +112 -9
  107. package/dist/signals/kept.contract.d.ts +22 -0
  108. package/dist/signals/kept.contract.js +111 -0
  109. package/dist/signals/library-agenda-change.d.ts +324 -0
  110. package/dist/signals/library-agenda-change.js +199 -0
  111. package/dist/signals/library-agenda.d.ts +258 -0
  112. package/dist/signals/library-agenda.js +167 -0
  113. package/dist/signals/library-reach-change.d.ts +10 -0
  114. package/dist/signals/library-reach-change.js +11 -3
  115. package/dist/signals/library-senders-change.d.ts +457 -0
  116. package/dist/signals/library-senders-change.js +367 -0
  117. package/dist/signals/library-senders-reach-change.d.ts +486 -0
  118. package/dist/signals/library-senders-reach-change.js +538 -0
  119. package/dist/signals/library-senders-reach.d.ts +340 -0
  120. package/dist/signals/library-senders-reach.js +252 -0
  121. package/dist/signals/library-senders.d.ts +271 -0
  122. package/dist/signals/library-senders.js +180 -0
  123. package/dist/signals/library-word-reach-change.js +2 -6
  124. package/dist/signals/memory.js +142 -1
  125. package/dist/signals/migrate.d.ts +6 -5
  126. package/dist/signals/migrate.js +150 -6
  127. package/dist/signals/notice.d.ts +88 -33
  128. package/dist/signals/notice.js +38 -16
  129. package/dist/signals/part-pace.d.ts +378 -0
  130. package/dist/signals/part-pace.js +333 -0
  131. package/dist/signals/parts.d.ts +25 -15
  132. package/dist/signals/parts.js +32 -73
  133. package/dist/signals/postgres.js +400 -26
  134. package/dist/signals/region.d.ts +1 -1
  135. package/dist/signals/retention.d.ts +43 -21
  136. package/dist/signals/retention.js +25 -8
  137. package/dist/signals/rhythm.d.ts +302 -0
  138. package/dist/signals/rhythm.js +262 -0
  139. package/dist/signals/rollup.d.ts +127 -1
  140. package/dist/signals/rollup.js +211 -24
  141. package/dist/signals/schema.d.ts +640 -3
  142. package/dist/signals/schema.js +239 -3
  143. package/dist/signals/silences.d.ts +310 -11
  144. package/dist/signals/silences.js +243 -0
  145. package/dist/signals/subtrees.d.ts +123 -0
  146. package/dist/signals/subtrees.js +102 -0
  147. package/dist/signals/tally.d.ts +125 -4
  148. package/dist/signals/unread.d.ts +292 -0
  149. package/dist/signals/unread.js +137 -0
  150. package/dist/signals/window-agenda.d.ts +276 -0
  151. package/dist/signals/window-agenda.js +83 -0
  152. package/dist/signals/window-funnels.d.ts +88 -0
  153. package/dist/signals/window-funnels.js +47 -0
  154. package/dist/store/cache.d.ts +101 -0
  155. package/dist/store/cache.js +149 -0
  156. package/dist/store/history.d.ts +82 -0
  157. package/dist/store/history.js +36 -0
  158. package/dist/store/index.d.ts +11 -0
  159. package/dist/store/index.js +11 -0
  160. package/dist/store/migrate.d.ts +26 -0
  161. package/dist/store/migrate.js +64 -0
  162. package/dist/store/postgres-audience.d.ts +14 -0
  163. package/dist/store/postgres-audience.js +272 -0
  164. package/dist/store/postgres.d.ts +1 -0
  165. package/dist/store/postgres.js +1 -0
  166. package/dist/store/schema.d.ts +312 -0
  167. package/dist/store/schema.js +77 -0
  168. package/dist/store/source.d.ts +57 -1
  169. package/dist/store/source.js +65 -1
  170. package/dist/submit/resolve.d.ts +1 -1
  171. package/dist/telemetry/index.d.ts +1 -0
  172. package/dist/telemetry/index.js +1 -0
  173. package/dist/telemetry/journal.d.ts +32 -0
  174. package/dist/telemetry/memory.js +10 -1
  175. package/dist/telemetry/postgres.js +18 -2
  176. package/dist/telemetry/window.d.ts +135 -0
  177. package/dist/telemetry/window.js +101 -0
  178. package/dist/testing/audience-overlay-contract.d.ts +31 -0
  179. package/dist/testing/audience-overlay-contract.js +354 -0
  180. package/dist/testing/contracts.d.ts +1 -0
  181. package/dist/testing/contracts.js +1 -0
  182. package/dist/testing/journal-contract.js +158 -5
  183. package/dist/theme/contrast.d.ts +19 -14
  184. package/dist/theme/contrast.js +181 -17
  185. package/dist/tree/apply.js +13 -0
  186. package/dist/tree/mutation.d.ts +18 -0
  187. package/dist/tree/mutation.js +24 -12
  188. package/dist/tree/navigation.d.ts +5 -0
  189. package/dist/tree/navigation.js +32 -10
  190. package/dist/tree/outline.d.ts +7 -0
  191. package/dist/tree/outline.js +9 -5
  192. package/package.json +39 -96
  193. package/dist/runtime/inverse-interpreter.d.ts +0 -90
  194. package/dist/runtime/inverse-interpreter.js +0 -56
@@ -0,0 +1,585 @@
1
+ import type { AudienceId } from "../audience/audience.js";
2
+ import type { TreeId } from "../ids.js";
3
+ import type { ArrivalStanding } from "./arriving.js";
4
+ import type { DeploymentConversion, LeakingPage } from "./conversion.js";
5
+ import type { DeploymentReading, RankedPage } from "./deployment.js";
6
+ import { type CollectionHealth, type PageHealth } from "./health.js";
7
+ import type { DeploymentUnread, PageUnread } from "./unread.js";
8
+ /**
9
+ * Whether the page at the head of a deployment's fix-list is a page to rewrite
10
+ * or a measurement to repair.
11
+ *
12
+ * Three readings answer *what should this deployment do next* and they have
13
+ * never met. An order of pages ranks every page by the readers it loses at its
14
+ * sharpest fall
15
+ * ([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)),
16
+ * and the head of it is *the page to fix first*. A second order ranks every page
17
+ * by the readers it loses between the two ends of its sharpest question
18
+ * ([0333](../../decisions/0333-a-deployments-conversions-are-a-third-order-ranked-on-the-loss-between-the-two-ends.md)),
19
+ * and the head of it is *the funnel to fix first*. A health reading names the
20
+ * faults in the deployment's own collection and ranks them by the readers each
21
+ * costs
22
+ * ([0271](../../decisions/0271-a-fault-in-a-deployments-collection-is-named-by-what-it-costs-and-a-pages-readers-are-counted-once.md)).
23
+ * All three are over the same pages, all three are at the door's scale, and
24
+ * **nothing joins them** — so an operator holds three lists and has to find the
25
+ * overlap by eye.
26
+ *
27
+ * The overlap is the dangerous part, and it is dangerous in one direction. A
28
+ * page whose counters name nodes its tree does not contain reads mostly
29
+ * `skipped` (0212), which **manufactures the steepest fall in the deployment**
30
+ * and puts it at the head of the order. The instruction an operator takes from
31
+ * that is *go and rewrite this page*, the page is fine, and the figure that sent
32
+ * them there was the fault. A fix-list whose first row is an artefact is worse
33
+ * than no fix-list, because it spends the one thing a reader screen is for.
34
+ *
35
+ * So this publishes **three orders and the overlaps between them**, taken off
36
+ * the three readings and nothing else: no payload field, no counter, no column,
37
+ * no byte on any wire and no figure any reading does not already publish.
38
+ *
39
+ * ## Two kinds of page work, in two units, never merged
40
+ *
41
+ * A fall and a leak are both the page writer's to fix, and the readers they
42
+ * cost are **two quantities**: readers lost at one fall, and readers lost
43
+ * between the two ends of one question. So they are published as two orders in
44
+ * two keys — {@link DeploymentAgenda.page} and
45
+ * {@link DeploymentAgenda.converting} — and never ranked against each other,
46
+ * which is the refusal 0327 makes about adding figures in different units and
47
+ * 0333 makes about ranking one event in two orders.
48
+ *
49
+ * {@link AgendaWork} does not gain a member for it, and that is the one
50
+ * judgement in this file worth stating out loud. The vocabulary answers *whose
51
+ * hand*, not *which part of the page*: a leak is the page writer's work exactly
52
+ * as a fall is, so `page` covers both and the row says which evidence it has.
53
+ * Widening the set to a third dimension would give eight combinations over a
54
+ * flat set of four and would rename `both`, which is a change to an accepted
55
+ * vocabulary rather than an addition to it (0330, 0336).
56
+ *
57
+ * ## Which page to rewrite, and where on it
58
+ *
59
+ * A row said *rewrite the page* and named no part of it. The location an
60
+ * operator needs was one join away and has been since 0377: the order of places
61
+ * ranks every page by what one fix recovers, in parts of a page rather than in
62
+ * readers. So a fourth reading is handed in and **read onto the rows**, and
63
+ * {@link AgendaRow.unread} carries it whole (0378).
64
+ *
65
+ * It changes nothing else, which is the whole of its design. The key is parts
66
+ * and the three orders are readers, so there is nothing to compare: no list
67
+ * gains or loses a row, {@link AgendaWork} does not gain a member — an unread
68
+ * band is the page writer's work exactly as a fall is — and
69
+ * {@link DeploymentAgenda.first} is untouched, because whether *go and look at
70
+ * this band* may ever be the one thing to do first is a judgement about a
71
+ * screen and not a coding decision (0377 left it open deliberately).
72
+ *
73
+ * **Nor is anything summed.** `DeploymentUnread` already publishes the
74
+ * deployment's parts and places, and a second total here would be a second
75
+ * answer to one question — the refusal 0327 makes, and the one this file
76
+ * already keeps about every reader figure on a row.
77
+ *
78
+ * ## It publishes no reader count, and that is the rule rather than an omission
79
+ *
80
+ * The three orders are ranked in **three different units.** 0250's key is
81
+ * *readers lost at one fall*, a part of a page's readership. 0333's is *readers
82
+ * lost between one question's two ends*, a part of the readers who reached it.
83
+ * 0271's is *the page's whole readership*, because a fault spoils every rate on
84
+ * the page rather than some share of them. All three are headcounts at the
85
+ * door's scale and no two are the same quantity, so a sum over them would be a
86
+ * figure in none — the refusal
87
+ * [0327](../../decisions/0327-the-figures-a-window-holds-about-itself-are-a-second-rung-and-a-region-row-set-is-deduplicated-once.md)
88
+ * makes about a withheld bucket, a kind with no pace and a silent reading.
89
+ *
90
+ * Every figure here is therefore a count of **pages**, and every reader figure
91
+ * on a row is the source reading's own, carried on the source reading's own row
92
+ * rather than re-spelled (0265's rule applied to a join rather than to a scale).
93
+ *
94
+ * ## Which faults take a page out of the order, and which do not
95
+ *
96
+ * {@link spoilsTheLoss} and {@link spoilsTheConversion}, published beside the
97
+ * fault vocabulary they are about. Two of the seven faults do not reach the
98
+ * **fall's** ranking key — a window shorter than a visit is already divided out
99
+ * of it, and an uncredited sender spends a counter no fall is made of — so a
100
+ * page carrying either keeps its place in the order of falls with the fault
101
+ * named beside it. That is {@link AgendaWork} `both`, and it is the member that
102
+ * stops this reading from being the over-caution that sends an operator to
103
+ * repair a sender while four hundred readers a day stop at a band.
104
+ *
105
+ * **The two answers are not interchangeable and this reading asks each
106
+ * separately**, which is the defect 0336 was written to make impossible. Only
107
+ * one of the seven survives the conversion key, and it is not the same one: a
108
+ * rollup window shorter than the visits being measured *manufactures* a
109
+ * conversion loss, because `converted` is a conjunction inside one window and a
110
+ * conversion split across two is lost rather than double-counted (0147). So a
111
+ * page that keeps its place in the order of falls with `counts-inflated` on it
112
+ * loses its place in the order of conversions, and one row can be sound
113
+ * evidence in one order and an artefact in the other.
114
+ *
115
+ * ## A contested page leaves the order and says so
116
+ *
117
+ * A page an order ranked and a fault spoiled is collection work: its place was
118
+ * computed from counters the fault produced, so *rewrite this* is not a safe
119
+ * instruction. It is published in {@link DeploymentAgenda.collection} **and**
120
+ * named in {@link DeploymentAgenda.contested}, carrying the whole row the order
121
+ * gave it — never dropped quietly, which is the rule this subsystem keeps about
122
+ * every refusal it makes (0301, 0326): a page taken out of an order has to be
123
+ * findable in the place it was taken to, with the figure it was taken for.
124
+ *
125
+ * Per order, because a fault reaches one key and not the other.
126
+ * {@link AgendaRow.spoiled} is about the fall and
127
+ * {@link AgendaRow.spoiledConversion} about the leak, and the row stands in
128
+ * whichever page order its evidence survives — so a page with `counts-inflated`
129
+ * on it is in {@link DeploymentAgenda.page}, out of
130
+ * {@link DeploymentAgenda.converting}, and in
131
+ * {@link DeploymentAgenda.contested} saying which half was withdrawn.
132
+ *
133
+ * ## A page is counted once, however many lists name it
134
+ *
135
+ * The one permanent mistake available to a join of three orders is a page
136
+ * counted twice (0158), and there are two ways in. A caller that concatenated
137
+ * two reads holds one page twice on one side: deduplicated on `readingKeyOf` and
138
+ * counted in {@link DeploymentAgenda.duplicated}. And `contested` is a **slice**
139
+ * of `collection` rather than a list beside it, so the work counts add to the
140
+ * pages read and not to more than there are. A page in both page orders is one
141
+ * row object in both lists and one entry in {@link DeploymentAgenda.work}.
142
+ *
143
+ * ## Two windows handed in as one
144
+ *
145
+ * All three inputs are over *the pages their caller read*, and a caller holding
146
+ * an order of one window and a health reading of another gets a join that is
147
+ * silently of the intersection. A row some side does not name is in no list and
148
+ * is counted in {@link DeploymentAgenda.unpaired}, which is nought for every
149
+ * caller that read one window and is the alarm for the one that did not.
150
+ *
151
+ * **The fourth reading is the one exception and it is deliberate.** A places
152
+ * reading of another window cannot take a row out of the fix-list: it is read
153
+ * onto rows the three above already made, so a page it does not name keeps its
154
+ * row with `null` where the place would be, and the pages it names that no row
155
+ * carries are counted in `unpaired.unread`. The asymmetry is the point — losing
156
+ * a row of the fix-list because a fourth reading was short would be the worst
157
+ * failure available to this join, and the place is an addition to a row rather
158
+ * than a condition of one (0378).
159
+ *
160
+ * **The conversion order is taken rather than defaulted**, which costs every
161
+ * caller a line and is the point. The three readings come off one window in
162
+ * three lines (0327, 0333), and an argument a caller may omit is a fix-list
163
+ * that type-checks, runs, and says `none` about the half of the product that
164
+ * pays — which is the hazard this subsystem has now recorded in four places. A
165
+ * deployment that asks nothing of its readers hands in the order it gets, in
166
+ * which every page is `unasked`, and reads exactly as it did before 0336.
167
+ *
168
+ * ## Nothing to fix and nothing to fix it with are two answers
169
+ *
170
+ * {@link DeploymentAgenda.first} is `null` where the three readings ask for
171
+ * nothing, and that was **two opposite sentences in one value.** A deployment
172
+ * whose pages are read, answered and soundly collected has nothing to do. A
173
+ * deployment whose door turns every delivery away has no counters, so no
174
+ * readings, so no rows, so no first row either — and the fix-list told an
175
+ * operator *nothing to do* about the one state it was built to catch
176
+ * ([0326](../../decisions/0326-a-quiet-window-and-a-refusing-door-are-two-states-and-a-refusal-names-no-page.md)).
177
+ *
178
+ * So {@link DeploymentAgenda.subject} says **what this fix-list is about**
179
+ * before any row of it is read: the pages, or the intake that would have to
180
+ * work before any page could be judged. It is the generalisation of the rule
181
+ * this reading already keeps about a contested page — *while one exists, an
182
+ * order is not evidence* — one level up: **while nothing is arriving, no
183
+ * reading is evidence**, and the absence of rows is not the absence of work.
184
+ *
185
+ * **It is a claim about the rows and takes each half from the reading that owns
186
+ * it.** Whether anything was collected is the health reading's pages, which is
187
+ * what the rows are joined from and the same number
188
+ * {@link ArrivalStanding.collected} is computed from (0326). Whether anything
189
+ * was turned away is the arrival standing's, and only that — so what is taken
190
+ * in is {@link ArrivalStanding.standing} and nothing else. A second copy of the
191
+ * collected count, read off the standing handed in, is how a caller holding two
192
+ * windows gets a verdict about one of them and rows from the other, and the
193
+ * count that is right about *these rows* is the one beside them.
194
+ *
195
+ * Nothing about a refusal is re-spelled here either: the standing is handed in,
196
+ * so the caller already holds `refused`, `newest` and the origin to print, and
197
+ * carrying a copy of them is how two figures come to disagree (0327).
198
+ *
199
+ * **A refusal is still not a row and still not a fault.** It names no page
200
+ * (0326), so it is not an {@link AgendaRow}, not a fifth
201
+ * {@link AgendaWork} and not an eighth `CollectionFault`. It is one word about
202
+ * the whole list, which is the only shape a deployment-wide subject can take
203
+ * beside a per-page vocabulary (0240).
204
+ *
205
+ * Pure, linear in the three readings, and reaches no store, clock or DOM.
206
+ */
207
+ /**
208
+ * What the next thing to do about one page is.
209
+ *
210
+ * Four members over *whose hand the work falls to*, which is deliberately not
211
+ * the same axis as *which part of the page*. A page that loses readers while
212
+ * they read and a page that loses them at an ask are both `page`; the row's own
213
+ * {@link AgendaRow.order} and {@link AgendaRow.conversion} say which, and they
214
+ * say it in the two readings' own figures (0336).
215
+ */
216
+ export type AgendaWork =
217
+ /**
218
+ * Rewrite the page: an order ranked it, and nothing in its collection reaches
219
+ * the figure that put it there.
220
+ *
221
+ * Either order — readers stopping where they read, readers stopping at an ask,
222
+ * or both. The sentence an operator acts on is the same one and the part of
223
+ * the page is on the row.
224
+ */
225
+ "page"
226
+ /**
227
+ * Repair the measurement: it is faulted, and either no order ranked it or a
228
+ * fault reaches every loss it was ranked by.
229
+ */
230
+ | "collection"
231
+ /**
232
+ * Both, and in that order.
233
+ *
234
+ * At least one order ranked the page, that rank is evidence —
235
+ * {@link spoilsTheLoss} or {@link spoilsTheConversion} says no fault on the
236
+ * row reaches the key it was ranked by — and there is also a fault. A surface
237
+ * may draw it in either list; it is one page and is counted once.
238
+ */
239
+ | "both"
240
+ /**
241
+ * Nothing any of the three readings asks for.
242
+ *
243
+ * Sound collection, no fall and no leak — or none anybody could read, which
244
+ * is the same row in this reading and several different sentences on it: the
245
+ * standings on {@link AgendaRow.order} and {@link AgendaRow.conversion} say
246
+ * which.
247
+ */
248
+ | "none";
249
+ export declare const AGENDA_WORK: readonly AgendaWork[];
250
+ /** One line per member, for a surface saying what a row is asking for. */
251
+ export declare const describeAgendaWork: (work: AgendaWork) => string;
252
+ /**
253
+ * What a deployment's fix-list is about: its pages, or the intake under them.
254
+ *
255
+ * Four members over one question — **can the rows below be acted on, and if
256
+ * there are none, why not.** A fix-list with no rows is three different
257
+ * deployments and the rows cannot say which (0326), so this says it in one word
258
+ * above them.
259
+ *
260
+ * It is not a fifth {@link AgendaWork}: that vocabulary is per page and answers
261
+ * *whose hand*, and a refusal names no page at all.
262
+ */
263
+ export type AgendaSubject =
264
+ /**
265
+ * The rows are the answer.
266
+ *
267
+ * Something was collected about at least one page, so the two orders and the
268
+ * faults below are readings of real counters. `first` being `null` from here
269
+ * is the honest *nothing to do*.
270
+ *
271
+ * **Also where a door was turning some deliveries away** while others
272
+ * arrived. The arrival standing calls that `mixed` and deliberately declines
273
+ * to judge it — a second sender with a stale key, one page of several
274
+ * carrying the wrong snippet, or a misconfiguration since fixed are the same
275
+ * rows (0326) — so this declines too rather than second-guessing the reading
276
+ * it was handed. What the caller holds beside this is the standing itself,
277
+ * which names the refusal and when it last happened.
278
+ */
279
+ "pages"
280
+ /**
281
+ * **Repair the intake.** Nothing was collected and the door turned deliveries
282
+ * away.
283
+ *
284
+ * The state this exists for. A page is posting on every view, the door is
285
+ * refusing it before it reads which tree it was about, and every reading in
286
+ * the subsystem is reporting that nobody read anything. The remedy is
287
+ * usually one line in a settings field (0311, 0326), and no row below is
288
+ * evidence of anything because there are none.
289
+ */
290
+ | "intake"
291
+ /**
292
+ * Nothing was collected and the door turned nothing away.
293
+ *
294
+ * No page is posting to this deployment at all: the snippet is absent, the
295
+ * broadcaster was never called, or the signals never left the browser. Work,
296
+ * and not this reading's to name — but a different instruction from
297
+ * {@link AgendaSubject.intake}, which is why the two are not one word.
298
+ */
299
+ | "silence"
300
+ /**
301
+ * Nothing was collected, and nothing offered a count of what the door turned
302
+ * away.
303
+ *
304
+ * So this cannot say which of the two silences above it is. The refusal
305
+ * rather than the gap, on the rule that an absent store is not an empty map
306
+ * (0240): guessing `silence` here publishes the more comforting of two
307
+ * states, and guessing `intake` sends an operator after a gate nothing says
308
+ * is shut.
309
+ */
310
+ | "unverified";
311
+ export declare const AGENDA_SUBJECTS: readonly AgendaSubject[];
312
+ /** One line per member, for a surface saying what a fix-list is about. */
313
+ export declare const describeAgendaSubject: (subject: AgendaSubject) => string;
314
+ /** One page of a deployment, as both readings have it. */
315
+ export type AgendaRow = {
316
+ readonly treeId: TreeId;
317
+ readonly revision: number;
318
+ /**
319
+ * The audience this row is about, or `null` where the readings named none.
320
+ *
321
+ * Two forms of one page are two rows, which is what both readings under this
322
+ * publish and what `readingKeyOf` joins them on: the two forms' losses are
323
+ * losses from two populations and a join that merged them would be asking one
324
+ * question of two readerships (0300).
325
+ */
326
+ readonly audienceId: AudienceId | null;
327
+ readonly work: AgendaWork;
328
+ /**
329
+ * Whether a fault reaches the loss the order of falls ranked this page by.
330
+ *
331
+ * **False on a page that order did not rank**, and that is a claim rather than
332
+ * a default: there is no loss on such a row to be spoiled, and `true` would
333
+ * read as *the figure is wrong* where the honest sentence is *there is no
334
+ * figure*. The standing on {@link AgendaRow.order} is where that is said.
335
+ *
336
+ * Its name and its meaning are unchanged (0330), and it says nothing about the
337
+ * other order — {@link AgendaRow.spoiledConversion} does, and no surface may
338
+ * read one off the other (0336).
339
+ */
340
+ readonly spoiled: boolean;
341
+ /**
342
+ * Whether a fault reaches the loss the order of conversions ranked this page
343
+ * by.
344
+ *
345
+ * False on a page that order did not rank, on the same terms and for the same
346
+ * reason as {@link AgendaRow.spoiled}: the standing on
347
+ * {@link AgendaRow.conversion} is where *there is no figure* is said.
348
+ *
349
+ * **It is not {@link AgendaRow.spoiled} with the word changed.** The two can
350
+ * disagree on one row, and the fault that makes them disagree is the ordinary
351
+ * one — a rollup window shorter than the visits being measured is divided out
352
+ * of a fall and manufactures a leak (0147, 0336).
353
+ */
354
+ readonly spoiledConversion: boolean;
355
+ /** The page as the order of falls has it, carried whole and unchanged. */
356
+ readonly order: RankedPage;
357
+ /** The page as the order of conversions has it, carried whole and unchanged. */
358
+ readonly conversion: LeakingPage;
359
+ /** The page as the health reading has it, carried whole and unchanged. */
360
+ readonly health: PageHealth;
361
+ /**
362
+ * The page as the order of **places** has it, carried whole and unchanged, or
363
+ * `null` where that order has no reading of this page.
364
+ *
365
+ * *Rewrite this page* arrives with *and here is where*:
366
+ * {@link PageUnread.at} is the one place a fix recovers the most of the page
367
+ * at, {@link PageUnread.costs} is what it accounts for, and the standing says
368
+ * why there is no place where there is none (0377).
369
+ *
370
+ * **It is not {@link AgendaRow.order}'s `at` with a different name, and no
371
+ * surface may print one under the other's heading.** The order of falls'
372
+ * location is *a third of the readers who got this far stopped between these
373
+ * two parts* — a ratio of two reach counts, which needs both ends to have
374
+ * reported. This one is *the reading goes no further than here, and nineteen
375
+ * parts are behind it* — the other end of the same page, where there is no
376
+ * ratio to take. `progress.ts` owns the word *stop* for the first and nothing
377
+ * in `frontier.ts` or `unread.ts` uses it for the second.
378
+ *
379
+ * **`null` is a short fourth reading and never a page with nothing unread** —
380
+ * that is `standing` `whole` on a row that is here. A caller holding a places
381
+ * reading of another window gets `null` on the rows it does not name, counted
382
+ * in {@link DeploymentAgenda.unpaired}, and a fix-list that is otherwise
383
+ * exactly what it was: the place joins onto a row and cannot take one away
384
+ * (0378).
385
+ */
386
+ readonly unread: PageUnread | null;
387
+ };
388
+ /** A deployment's pages, in the two orders that say what to do about them. */
389
+ export type DeploymentAgenda = {
390
+ /**
391
+ * What this fix-list is about, read before any row of it.
392
+ *
393
+ * `pages` wherever the health reading named one, whatever else is true. The
394
+ * other three are the three deployments whose fix-list is empty, and they
395
+ * are three different instructions.
396
+ *
397
+ * **Every member but `pages` has no rows and a `null`
398
+ * {@link DeploymentAgenda.first} by construction** — the rows are joined from
399
+ * the health reading's pages, so no page there is no row here. That is the
400
+ * whole point: `first === null` is now two sentences and this is the one that
401
+ * says which.
402
+ */
403
+ readonly subject: AgendaSubject;
404
+ /**
405
+ * Every page all three readings named, by tree id and newest revision first.
406
+ *
407
+ * The same order `CollectionHealth.pages` and an order's `unranked` are in, so
408
+ * a surface holding all of them can draw them side by side.
409
+ */
410
+ readonly rows: readonly AgendaRow[];
411
+ /**
412
+ * Pages whose **reading** falls, worst first, in the order of falls' own
413
+ * order.
414
+ *
415
+ * Every row here is {@link AgendaWork} `page` or `both`, and the converse does
416
+ * not hold: a page that only leaks is `page` work and stands in
417
+ * {@link DeploymentAgenda.converting} instead. A row's place here is the place
418
+ * the order gave it, unchanged (0250) — nothing is re-ranked, because the
419
+ * ranking rule lives in one place.
420
+ */
421
+ readonly page: readonly AgendaRow[];
422
+ /**
423
+ * Pages whose **asks** leak, worst first, in the order of conversions' own
424
+ * order (0333).
425
+ *
426
+ * The second half of the page writer's work, and a list of its own rather
427
+ * than rows appended to {@link DeploymentAgenda.page}, because the two keys
428
+ * are readers in two units and merging them would publish a rank in neither
429
+ * (0327, 0336). A page may stand in both lists, and is one page in every
430
+ * count here.
431
+ */
432
+ readonly converting: readonly AgendaRow[];
433
+ /**
434
+ * Pages whose collection to repair, worst first, in the health reading's own
435
+ * order: the priced faults by the readers each costs, then the ones the door
436
+ * cannot price.
437
+ *
438
+ * {@link AgendaWork} `collection` and `both`.
439
+ */
440
+ readonly collection: readonly AgendaRow[];
441
+ /**
442
+ * Pages an order ranked and a fault spoiled — a **slice** of
443
+ * {@link DeploymentAgenda.collection} and not a further list, so nothing here
444
+ * is counted twice.
445
+ *
446
+ * The sharpest rows in the deployment: each one is high in a fix-list for a
447
+ * figure its own fault may have produced. Each carries the ranks it was taken
448
+ * out of, and says which of the two was withdrawn —
449
+ * {@link AgendaRow.spoiled}, {@link AgendaRow.spoiledConversion} or both,
450
+ * since a fault need not reach both keys (0336).
451
+ */
452
+ readonly contested: readonly AgendaRow[];
453
+ /**
454
+ * The one thing to do first, or `null` where the three readings ask for
455
+ * nothing.
456
+ *
457
+ * **`null` is not *nothing to do*** — {@link DeploymentAgenda.subject} is
458
+ * where that is said. On any subject but `pages` there are no rows to be
459
+ * first, and the work is the intake rather than a page.
460
+ *
461
+ * A contested page before a ranked one, because while one exists an order is
462
+ * not evidence; then the head of the order of falls, which is that order's own
463
+ * answer (0250), now that it is safe to act on; then the head of the order of
464
+ * conversions; then the worst fault, for a deployment with nothing ranked at
465
+ * all.
466
+ *
467
+ * **Falls before leaks, and the reason is causal rather than a comparison of
468
+ * magnitudes** — there is no comparing them, since the two keys are readers in
469
+ * two units. A reader who never reached an ask stopped *reading*, and the
470
+ * order of falls is deliberately where that reader is left (0333); so a leak
471
+ * is a question about readers who did arrive, and rewriting an ask that
472
+ * readers do not reach is work on a part of the page nobody sees.
473
+ */
474
+ readonly first: AgendaRow | null;
475
+ /** How many pages ask for each kind of work, over every row. */
476
+ readonly work: Readonly<Record<AgendaWork, number>>;
477
+ /**
478
+ * Distinct trees across the rows, which is not the number of pages.
479
+ *
480
+ * Two revisions of one tree are two live versions of one page and both stand,
481
+ * as they do in both readings under this (0250, 0271).
482
+ */
483
+ readonly trees: number;
484
+ /**
485
+ * Rows one reading named and the other did not, which is two windows handed
486
+ * in as one.
487
+ *
488
+ * Nought for a caller that read one window. Anything else is a caller holding
489
+ * an order of one and a health reading of another, and the join below it is
490
+ * then of the intersection — so this is published rather than refused, and it
491
+ * is published as two counts because which side is short says which read is
492
+ * the stale one.
493
+ */
494
+ readonly unpaired: {
495
+ /** Rows the order of falls named that some other reading has no page for. */
496
+ readonly order: number;
497
+ /** Rows the health reading named that some other reading has no page for. */
498
+ readonly health: number;
499
+ /**
500
+ * Rows the order of conversions named that some other reading has no page
501
+ * for.
502
+ *
503
+ * Nought for a caller that read one window, including a deployment that
504
+ * asks nothing of its readers: a page with no question is `unasked` in that
505
+ * order rather than absent from it, so the three page sets match (0333).
506
+ */
507
+ readonly conversion: number;
508
+ /**
509
+ * Pages the order of places named that no row of this fix-list carries.
510
+ *
511
+ * The same claim as the three above it and the **only** direction this
512
+ * number can take: a page the places order named and the three joined
513
+ * readings did not is a page with no row to carry it, so it is countable
514
+ * here and nowhere else. The other direction is on the rows themselves —
515
+ * {@link AgendaRow.unread} is `null` there, and a caller holding the rows
516
+ * can count them — because the place cannot remove a row (0378).
517
+ */
518
+ readonly unread: number;
519
+ };
520
+ /**
521
+ * Readings of a page beyond the first, on any side, which were dropped.
522
+ *
523
+ * A caller that concatenated two reads. Dropped rather than added, because a
524
+ * page twice in an order is the one way an order can lie about how much there
525
+ * is to fix, and a count that has been added cannot be unadded (0158).
526
+ */
527
+ readonly duplicated: number;
528
+ };
529
+ /**
530
+ * Join an order of a deployment's pages to the health of its collection, and
531
+ * publish the two orders that come out.
532
+ *
533
+ * ```ts
534
+ * const assembly = windowAssemblyOf(window, context)
535
+ * const progress = assembly.readings.pages.map(readingProgressOf)
536
+ * const health = collectionHealthOf(assembly.readings.pages, window.pageViews, schedule)
537
+ * const agenda = deploymentAgendaOf(
538
+ * deploymentReadingOf(progress, window.pageViews),
539
+ * deploymentConversionOf(windowFunnelsOf(window, assembly).pages),
540
+ * health,
541
+ * arrivalStandingOf(health, turnedAway, at),
542
+ * deploymentUnreadOf(assembly.readings.pages.map(pageFrontierOf))
543
+ * )
544
+ * ```
545
+ *
546
+ * The three readings are handed in rather than derived from a window here, for
547
+ * the reason every derived reading in this subsystem takes readings: each is
548
+ * separately useful and separately drawn, and deriving any of them a second time
549
+ * is how two screens come to disagree about one deployment.
550
+ *
551
+ * @param arrival Whether anything is arriving at this deployment, as
552
+ * `arrivalStandingOf` answered it, or `null` where the caller read no refusal
553
+ * counter and has no answer to hand in. **Required rather than optional**, on
554
+ * the terms the schedule above it is required
555
+ * ([0322](../../decisions/0322-a-window-is-read-off-one-deployment-context-and-the-region-floor-is-not-optional.md),
556
+ * [0343](../../decisions/0343-a-deployments-fix-list-is-read-off-one-window-and-states-its-collection-schedule-or-says-it-has-none.md)):
557
+ * an argument a caller may omit is a fix-list that type-checks, runs, and
558
+ * cannot tell *nothing to fix* from *nothing to fix it with*, which is the
559
+ * state this subsystem's commonest setup failure puts a deployment in.
560
+ *
561
+ * `null` and a standing of `unasked` are **one answer** and both read
562
+ * `unverified`: a caller with no counter to read and a deployment with no
563
+ * counter to offer are the same absence, and inventing a second word for it
564
+ * would be a sixth member of a closed set of five, said twice.
565
+ *
566
+ * Only {@link ArrivalStanding.standing} is taken. Nothing else on it is needed
567
+ * and a copy of its collected count would be a second answer to a question the
568
+ * rows already answer.
569
+ *
570
+ * @param unread The deployment's pages as the order of **places** has them, as
571
+ * `deploymentUnreadOf` answered it. **Required rather than optional**, on the
572
+ * terms the three readings above it are (0322, 0343): a fix-list that says
573
+ * *rewrite this page* and cannot say where on it is the state this lane filed
574
+ * on 9 November, and an argument a caller may omit is that fix-list
575
+ * type-checking.
576
+ *
577
+ * **It cannot change a row, a list, a count of work or `first`** — it is read
578
+ * onto rows the three readings above made, and a page it does not name keeps
579
+ * its row with `null` on it. A deployment that asks nothing to be rewritten and
580
+ * has a band nobody reads still reads `none` work, because the key here is
581
+ * parts of a page and the three orders are readers, and there is nothing to
582
+ * compare (0327, 0377, 0378).
583
+ */
584
+ export declare const deploymentAgendaOf: (order: DeploymentReading, conversion: DeploymentConversion, health: CollectionHealth, arrival: Pick<ArrivalStanding, "standing"> | null, unread: DeploymentUnread) => DeploymentAgenda;
585
+ //# sourceMappingURL=agenda.d.ts.map