@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.
- package/README.md +3 -1
- package/dist/application/application.d.ts +109 -0
- package/dist/application/application.js +97 -0
- package/dist/application/memory.d.ts +20 -0
- package/dist/application/memory.js +79 -0
- package/dist/application/store.d.ts +101 -0
- package/dist/application/store.js +25 -0
- package/dist/audience/audience.d.ts +36 -0
- package/dist/audience/audience.js +41 -0
- package/dist/audience/compose.d.ts +112 -0
- package/dist/audience/compose.js +134 -0
- package/dist/audience/memory.d.ts +14 -0
- package/dist/audience/memory.js +71 -0
- package/dist/audience/overlay-store.d.ts +343 -0
- package/dist/audience/overlay-store.js +217 -0
- package/dist/audience/rule.d.ts +121 -0
- package/dist/audience/rule.js +78 -0
- package/dist/cli/index.d.ts +3 -4
- package/dist/cli/index.js +3 -4
- package/dist/cli/templates.js +19 -0
- package/dist/data/adapter.d.ts +9 -1
- package/dist/data/adapter.js +2 -0
- package/dist/data/plan.js +0 -0
- package/dist/data/resolution.d.ts +23 -1
- package/dist/data/resolve.d.ts +31 -4
- package/dist/data/resolve.js +11 -3
- package/dist/ids.d.ts +10 -0
- package/dist/ids.js +11 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interpretation/anthropic.d.ts +1 -1
- package/dist/interpretation/anthropic.js +2 -22
- package/dist/interpretation/client.d.ts +1 -1
- package/dist/interpretation/materialize.js +67 -22
- package/dist/interpretation/openai-compatible.d.ts +36 -0
- package/dist/interpretation/openai-compatible.js +79 -0
- package/dist/interpretation/status.d.ts +19 -0
- package/dist/interpretation/status.js +26 -0
- package/dist/live/index.d.ts +73 -0
- package/dist/live/index.js +73 -0
- package/dist/live/pages.d.ts +187 -0
- package/dist/live/pages.js +161 -0
- package/dist/live/pull.d.ts +147 -0
- package/dist/live/pull.js +398 -0
- package/dist/live/pulling.d.ts +79 -0
- package/dist/live/pulling.js +117 -0
- package/dist/live/window.d.ts +129 -0
- package/dist/live/window.js +132 -0
- package/dist/patch.d.ts +54 -0
- package/dist/patch.js +44 -0
- package/dist/project/closing.d.ts +51 -0
- package/dist/project/closing.js +53 -0
- package/dist/project/memory.d.ts +20 -0
- package/dist/project/memory.js +97 -0
- package/dist/project/project.d.ts +90 -0
- package/dist/project/project.js +91 -0
- package/dist/project/store.d.ts +135 -0
- package/dist/project/store.js +41 -0
- package/dist/registered.d.ts +64 -0
- package/dist/registered.js +118 -0
- package/dist/render/addressed.d.ts +35 -0
- package/dist/render/addressed.js +79 -0
- package/dist/render/behaviour-adjust.d.ts +11 -19
- package/dist/render/behaviour-adjust.js +75 -21
- package/dist/render/behaviour-present.d.ts +8 -0
- package/dist/render/behaviour-present.js +57 -6
- package/dist/render/behaviour.d.ts +98 -17
- package/dist/render/behaviour.js +91 -26
- package/dist/render/control-name.d.ts +68 -0
- package/dist/render/control-name.js +37 -0
- package/dist/render/diagnostics.d.ts +72 -0
- package/dist/render/diagnostics.js +7 -0
- package/dist/render/document-theme.d.ts +70 -0
- package/dist/render/document-theme.js +139 -0
- package/dist/render/editable.d.ts +15 -1
- package/dist/render/editable.js +13 -1
- package/dist/render/expected.d.ts +98 -0
- package/dist/render/expected.js +88 -0
- package/dist/render/index.d.ts +4 -0
- package/dist/render/index.js +4 -0
- package/dist/render/reads.d.ts +11 -0
- package/dist/render/reads.js +12 -1
- package/dist/render/render.d.ts +11 -0
- package/dist/render/render.js +294 -53
- package/dist/render/request.d.ts +8 -1
- package/dist/render/request.js +1 -0
- package/dist/render/slots.d.ts +52 -0
- package/dist/render/slots.js +24 -0
- package/dist/render/theme.d.ts +54 -1
- package/dist/render/theme.js +23 -1
- package/dist/render/unshown.d.ts +152 -0
- package/dist/render/unshown.js +80 -0
- package/dist/runtime/analysis.d.ts +94 -9
- package/dist/runtime/analysis.js +54 -9
- package/dist/runtime/assessment.d.ts +36 -2
- package/dist/runtime/assessment.js +27 -2
- package/dist/runtime/auto-apply-ceiling.d.ts +54 -0
- package/dist/runtime/auto-apply-ceiling.js +66 -0
- package/dist/runtime/checks.d.ts +148 -0
- package/dist/runtime/checks.js +112 -0
- package/dist/runtime/disposition.d.ts +96 -0
- package/dist/runtime/disposition.js +46 -0
- package/dist/runtime/gate.js +91 -10
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/irreversibility.d.ts +64 -0
- package/dist/runtime/irreversibility.js +45 -0
- package/dist/runtime/nesting.d.ts +13 -1
- package/dist/runtime/nesting.js +41 -24
- package/dist/runtime/pipeline.d.ts +43 -0
- package/dist/runtime/pipeline.js +10 -2
- package/dist/runtime/policy-change.d.ts +93 -0
- package/dist/runtime/policy-change.js +305 -0
- package/dist/runtime/policy-log.d.ts +406 -0
- package/dist/runtime/policy-log.js +285 -0
- package/dist/runtime/policy.d.ts +8 -6
- package/dist/runtime/policy.js +5 -2
- package/dist/runtime/repointing.js +0 -0
- package/dist/runtime/reversibility.d.ts +11 -9
- package/dist/runtime/stakes.d.ts +129 -1
- package/dist/runtime/stakes.js +240 -26
- package/dist/runtime/vocabulary.d.ts +164 -7
- package/dist/runtime/vocabulary.js +181 -8
- package/dist/sdk/audit.d.ts +174 -3
- package/dist/sdk/audit.js +176 -17
- package/dist/sdk/catalogue.d.ts +9 -1
- package/dist/sdk/conformance.d.ts +37 -3
- package/dist/sdk/conformance.js +25 -4
- package/dist/sdk/definition.d.ts +129 -5
- package/dist/sdk/definition.js +66 -0
- package/dist/sdk/registry.d.ts +45 -2
- package/dist/sdk/registry.js +102 -1
- package/dist/signals/acted.contract.d.ts +21 -0
- package/dist/signals/acted.contract.js +236 -0
- package/dist/signals/acted.d.ts +359 -0
- package/dist/signals/acted.js +135 -0
- package/dist/signals/action-change.d.ts +507 -0
- package/dist/signals/action-change.js +265 -0
- package/dist/signals/action.d.ts +331 -0
- package/dist/signals/action.js +182 -0
- package/dist/signals/agenda.d.ts +585 -0
- package/dist/signals/agenda.js +295 -0
- package/dist/signals/applied-window.contract.d.ts +23 -0
- package/dist/signals/applied-window.contract.js +160 -0
- package/dist/signals/arrivals.contract.d.ts +21 -0
- package/dist/signals/arrivals.contract.js +180 -0
- package/dist/signals/arrivals.d.ts +375 -0
- package/dist/signals/arrivals.js +254 -0
- package/dist/signals/arriving.d.ts +210 -0
- package/dist/signals/arriving.js +133 -0
- package/dist/signals/audiences.d.ts +528 -0
- package/dist/signals/audiences.js +255 -0
- package/dist/signals/broadcast.d.ts +33 -17
- package/dist/signals/broadcast.js +255 -32
- package/dist/signals/change.d.ts +378 -0
- package/dist/signals/change.js +327 -0
- package/dist/signals/collect.d.ts +169 -34
- package/dist/signals/collect.js +186 -38
- package/dist/signals/conversion.d.ts +348 -0
- package/dist/signals/conversion.js +235 -0
- package/dist/signals/copy-change.d.ts +553 -0
- package/dist/signals/copy-change.js +377 -0
- package/dist/signals/copy.d.ts +337 -0
- package/dist/signals/copy.js +211 -0
- package/dist/signals/correlated.contract.d.ts +24 -0
- package/dist/signals/correlated.contract.js +94 -0
- package/dist/signals/counters.d.ts +97 -0
- package/dist/signals/counters.js +160 -0
- package/dist/signals/deliver.d.ts +23 -4
- package/dist/signals/deliver.js +34 -6
- package/dist/signals/deployment-change.d.ts +395 -0
- package/dist/signals/deployment-change.js +309 -0
- package/dist/signals/deployment.d.ts +278 -0
- package/dist/signals/deployment.js +178 -0
- package/dist/signals/door.d.ts +114 -0
- package/dist/signals/door.js +77 -0
- package/dist/signals/expire.d.ts +192 -0
- package/dist/signals/expire.js +213 -0
- package/dist/signals/fold.d.ts +10 -0
- package/dist/signals/fold.js +5 -1
- package/dist/signals/form-action.d.ts +302 -0
- package/dist/signals/form-action.js +169 -0
- package/dist/signals/form-copy.d.ts +523 -0
- package/dist/signals/form-copy.js +346 -0
- package/dist/signals/forms.d.ts +247 -0
- package/dist/signals/forms.js +147 -0
- package/dist/signals/frontier.d.ts +268 -0
- package/dist/signals/frontier.js +145 -0
- package/dist/signals/funnel-change.d.ts +548 -0
- package/dist/signals/funnel-change.js +361 -0
- package/dist/signals/funnel-hours.contract.d.ts +21 -0
- package/dist/signals/funnel-hours.contract.js +221 -0
- package/dist/signals/funnel-hours.d.ts +293 -0
- package/dist/signals/funnel-hours.js +99 -0
- package/dist/signals/funnel.d.ts +592 -0
- package/dist/signals/funnel.js +231 -0
- package/dist/signals/health.d.ts +694 -0
- package/dist/signals/health.js +573 -0
- package/dist/signals/index.d.ts +60 -0
- package/dist/signals/index.js +60 -0
- package/dist/signals/ingest.d.ts +56 -1
- package/dist/signals/ingest.js +91 -1
- package/dist/signals/inside.d.ts +190 -0
- package/dist/signals/inside.js +263 -0
- package/dist/signals/join.d.ts +56 -0
- package/dist/signals/join.js +60 -0
- package/dist/signals/journal.d.ts +123 -9
- package/dist/signals/kept.contract.d.ts +22 -0
- package/dist/signals/kept.contract.js +111 -0
- package/dist/signals/kinds.d.ts +8 -6
- package/dist/signals/kinds.js +14 -6
- package/dist/signals/library-action.d.ts +430 -0
- package/dist/signals/library-action.js +336 -0
- package/dist/signals/library-agenda-change.d.ts +324 -0
- package/dist/signals/library-agenda-change.js +199 -0
- package/dist/signals/library-agenda.d.ts +258 -0
- package/dist/signals/library-agenda.js +167 -0
- package/dist/signals/library-change.d.ts +477 -0
- package/dist/signals/library-change.js +335 -0
- package/dist/signals/library-copy-change.d.ts +498 -0
- package/dist/signals/library-copy-change.js +476 -0
- package/dist/signals/library-pace.d.ts +319 -0
- package/dist/signals/library-pace.js +305 -0
- package/dist/signals/library-reach-change.d.ts +646 -0
- package/dist/signals/library-reach-change.js +542 -0
- package/dist/signals/library-reach.d.ts +377 -0
- package/dist/signals/library-reach.js +227 -0
- package/dist/signals/library-senders-change.d.ts +457 -0
- package/dist/signals/library-senders-change.js +367 -0
- package/dist/signals/library-senders-reach-change.d.ts +486 -0
- package/dist/signals/library-senders-reach-change.js +538 -0
- package/dist/signals/library-senders-reach.d.ts +340 -0
- package/dist/signals/library-senders-reach.js +252 -0
- package/dist/signals/library-senders.d.ts +271 -0
- package/dist/signals/library-senders.js +180 -0
- package/dist/signals/library-word-reach-change.d.ts +567 -0
- package/dist/signals/library-word-reach-change.js +564 -0
- package/dist/signals/library.d.ts +306 -0
- package/dist/signals/library.js +178 -0
- package/dist/signals/memory.d.ts +9 -0
- package/dist/signals/memory.js +246 -14
- package/dist/signals/migrate.d.ts +20 -4
- package/dist/signals/migrate.js +269 -8
- package/dist/signals/notice.d.ts +389 -0
- package/dist/signals/notice.js +250 -0
- package/dist/signals/pace-change.d.ts +501 -0
- package/dist/signals/pace-change.js +310 -0
- package/dist/signals/pace.d.ts +296 -0
- package/dist/signals/pace.js +291 -0
- package/dist/signals/page-views.d.ts +365 -0
- package/dist/signals/page-views.js +218 -0
- package/dist/signals/part-pace.d.ts +378 -0
- package/dist/signals/part-pace.js +333 -0
- package/dist/signals/parts.d.ts +354 -0
- package/dist/signals/parts.js +232 -0
- package/dist/signals/postgres.d.ts +16 -2
- package/dist/signals/postgres.js +753 -76
- package/dist/signals/progress.d.ts +212 -0
- package/dist/signals/progress.js +150 -0
- package/dist/signals/ratios.d.ts +108 -0
- package/dist/signals/ratios.js +40 -0
- package/dist/signals/reach.d.ts +309 -0
- package/dist/signals/reach.js +93 -0
- package/dist/signals/readable.d.ts +34 -0
- package/dist/signals/readable.js +34 -0
- package/dist/signals/readership.d.ts +381 -0
- package/dist/signals/readership.js +308 -0
- package/dist/signals/region-pages.d.ts +173 -0
- package/dist/signals/region-pages.js +62 -0
- package/dist/signals/region.d.ts +287 -0
- package/dist/signals/region.js +198 -0
- package/dist/signals/retention.d.ts +163 -0
- package/dist/signals/retention.js +75 -0
- package/dist/signals/rhythm.d.ts +302 -0
- package/dist/signals/rhythm.js +262 -0
- package/dist/signals/rollup.d.ts +194 -4
- package/dist/signals/rollup.js +0 -0
- package/dist/signals/schema.d.ts +1069 -1
- package/dist/signals/schema.js +393 -3
- package/dist/signals/signal.d.ts +237 -11
- package/dist/signals/signal.js +70 -10
- package/dist/signals/silence-census.d.ts +205 -0
- package/dist/signals/silence-census.js +87 -0
- package/dist/signals/silences.d.ts +1147 -0
- package/dist/signals/silences.js +996 -0
- package/dist/signals/subtrees.d.ts +123 -0
- package/dist/signals/subtrees.js +102 -0
- package/dist/signals/tally.d.ts +262 -12
- package/dist/signals/unread.d.ts +292 -0
- package/dist/signals/unread.js +137 -0
- package/dist/signals/window-agenda.d.ts +276 -0
- package/dist/signals/window-agenda.js +83 -0
- package/dist/signals/window-figures.d.ts +148 -0
- package/dist/signals/window-figures.js +42 -0
- package/dist/signals/window-funnels.d.ts +88 -0
- package/dist/signals/window-funnels.js +47 -0
- package/dist/signals/window.d.ts +866 -0
- package/dist/signals/window.js +693 -0
- package/dist/signals/words.d.ts +24 -0
- package/dist/signals/words.js +24 -0
- package/dist/store/cache.d.ts +101 -0
- package/dist/store/cache.js +149 -0
- package/dist/store/history.d.ts +82 -0
- package/dist/store/history.js +36 -0
- package/dist/store/index.d.ts +30 -0
- package/dist/store/index.js +30 -0
- package/dist/store/memory.d.ts +2 -1
- package/dist/store/memory.js +48 -12
- package/dist/store/migrate.d.ts +106 -0
- package/dist/store/migrate.js +323 -7
- package/dist/store/postgres-applications.d.ts +4 -0
- package/dist/store/postgres-applications.js +197 -0
- package/dist/store/postgres-audience.d.ts +14 -0
- package/dist/store/postgres-audience.js +272 -0
- package/dist/store/postgres-holds.d.ts +10 -1
- package/dist/store/postgres-holds.js +116 -101
- package/dist/store/postgres-policy-log.d.ts +14 -0
- package/dist/store/postgres-policy-log.js +240 -0
- package/dist/store/postgres-projects.d.ts +4 -0
- package/dist/store/postgres-projects.js +217 -0
- package/dist/store/postgres.d.ts +17 -1
- package/dist/store/postgres.js +60 -9
- package/dist/store/replay.d.ts +102 -1
- package/dist/store/replay.js +190 -19
- package/dist/store/reseed.d.ts +238 -0
- package/dist/store/reseed.js +308 -0
- package/dist/store/schema.d.ts +762 -2
- package/dist/store/schema.js +218 -5
- package/dist/store/source.d.ts +57 -1
- package/dist/store/source.js +65 -1
- package/dist/store/store.d.ts +29 -6
- package/dist/submit/resolve.d.ts +1 -1
- package/dist/submit/resolve.js +2 -1
- package/dist/telemetry/calibration.d.ts +25 -0
- package/dist/telemetry/calibration.js +27 -1
- package/dist/telemetry/event.d.ts +391 -33
- package/dist/telemetry/event.js +84 -20
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/journal.d.ts +104 -3
- package/dist/telemetry/journal.js +9 -0
- package/dist/telemetry/lookup.d.ts +27 -0
- package/dist/telemetry/lookup.js +18 -0
- package/dist/telemetry/memory.js +33 -1
- package/dist/telemetry/migrate.js +22 -1
- package/dist/telemetry/postgres.d.ts +10 -1
- package/dist/telemetry/postgres.js +188 -90
- package/dist/telemetry/remeasure.d.ts +78 -0
- package/dist/telemetry/remeasure.js +83 -0
- package/dist/telemetry/retention.d.ts +2 -2
- package/dist/telemetry/schema.d.ts +17 -0
- package/dist/telemetry/schema.js +27 -1
- package/dist/telemetry/sink.d.ts +2 -2
- package/dist/telemetry/window.d.ts +135 -0
- package/dist/telemetry/window.js +101 -0
- package/dist/testing/application-contract.d.ts +14 -0
- package/dist/testing/application-contract.js +270 -0
- package/dist/testing/audience-overlay-contract.d.ts +31 -0
- package/dist/testing/audience-overlay-contract.js +354 -0
- package/dist/testing/contracts.d.ts +13 -7
- package/dist/testing/contracts.js +13 -7
- package/dist/testing/definitions.d.ts +78 -0
- package/dist/testing/definitions.js +134 -9
- package/dist/testing/doubles.d.ts +103 -0
- package/dist/testing/doubles.js +143 -0
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +2 -2
- package/dist/testing/journal-contract.js +297 -6
- package/dist/testing/model-contract.d.ts +110 -0
- package/dist/testing/model-contract.js +150 -0
- package/dist/testing/policy-log-contract.d.ts +26 -0
- package/dist/testing/policy-log-contract.js +344 -0
- package/dist/testing/project-contract.d.ts +14 -0
- package/dist/testing/project-contract.js +266 -0
- package/dist/testing/reader-signal-contract.d.ts +27 -2
- package/dist/testing/reader-signal-contract.js +475 -5
- package/dist/testing/store-contract.d.ts +7 -1
- package/dist/testing/store-contract.js +84 -3
- package/dist/theme/apply.d.ts +20 -1
- package/dist/theme/apply.js +5 -3
- package/dist/theme/contrast.d.ts +19 -14
- package/dist/theme/contrast.js +181 -17
- package/dist/theme/derive.d.ts +22 -0
- package/dist/theme/derive.js +54 -1
- package/dist/theme/library.js +1 -1
- package/dist/theme/measure.d.ts +34 -0
- package/dist/theme/measure.js +30 -1
- package/dist/theme/palettes.js +7 -7
- package/dist/theme/ramp.d.ts +64 -0
- package/dist/theme/ramp.js +114 -0
- package/dist/theme/registry.d.ts +9 -0
- package/dist/theme/registry.js +11 -1
- package/dist/theme/separation.d.ts +97 -3
- package/dist/theme/separation.js +75 -0
- package/dist/tree/apply.js +13 -0
- package/dist/tree/compare.d.ts +9 -0
- package/dist/tree/compare.js +18 -0
- package/dist/tree/mutation.d.ts +18 -0
- package/dist/tree/mutation.js +24 -12
- package/dist/tree/navigation.d.ts +5 -0
- package/dist/tree/navigation.js +32 -10
- package/dist/tree/outline.d.ts +7 -0
- package/dist/tree/outline.js +9 -5
- package/dist/write/computed.d.ts +60 -0
- package/dist/write/computed.js +61 -0
- package/dist/write/held.d.ts +59 -0
- package/dist/write/index.d.ts +5 -2
- package/dist/write/index.js +5 -2
- package/dist/write/reseed.d.ts +151 -0
- package/dist/write/reseed.js +184 -0
- package/dist/write/revert.js +2 -16
- package/package.json +25 -3
- package/dist/runtime/inverse-interpreter.d.ts +0 -90
- package/dist/runtime/inverse-interpreter.js +0 -56
|
@@ -0,0 +1,592 @@
|
|
|
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
|
+
import type { ReachSilence } from "./reach.js";
|
|
6
|
+
import type { FunnelPair } from "./rollup.js";
|
|
7
|
+
import type { StoredFunnel } from "./tally.js";
|
|
8
|
+
/**
|
|
9
|
+
* A funnel, read against the readers who arrived.
|
|
10
|
+
*
|
|
11
|
+
* A `FunnelAnswer` is two counts off one window: the page views that satisfied
|
|
12
|
+
* one end of a pair, and the ones that satisfied both. Divided into each other
|
|
13
|
+
* they give a rate, and that rate is the one figure in this subsystem that
|
|
14
|
+
* never needed a denominator handed to it — it is
|
|
15
|
+
* [0221](../../decisions/0221-where-reading-stops-is-a-fall-between-two-siblings-and-a-ratio-of-two-counts-off-one-row-set.md)'s
|
|
16
|
+
* cancellation again, two counts off the same rows.
|
|
17
|
+
*
|
|
18
|
+
* **It is also not the number anybody quotes.** A deployment asking *what is
|
|
19
|
+
* our conversion rate* means *of the readers who arrived*, and a pair whose
|
|
20
|
+
* `from` almost nobody reaches can post a magnificent rate while converting
|
|
21
|
+
* four people. The exact count of arrivals has been in
|
|
22
|
+
* [`page-views.ts`](page-views.ts) since §8 and nothing joined the two, so the
|
|
23
|
+
* funnel was the last counter here with no honest share of its own.
|
|
24
|
+
*
|
|
25
|
+
* **This is that join**, and it is the sixth thing taken out of the server-side
|
|
26
|
+
* reading rather than off the wire: nothing is added to a payload, a browser, a
|
|
27
|
+
* column, a store or the vocabulary.
|
|
28
|
+
*
|
|
29
|
+
* ## Three shares that add up, which is the point
|
|
30
|
+
*
|
|
31
|
+
* Every arrival is in exactly one of three states, and naming all three is what
|
|
32
|
+
* makes the reading act on something rather than report something:
|
|
33
|
+
*
|
|
34
|
+
* - {@link PairReach.lostBefore} — never reached the first end;
|
|
35
|
+
* - {@link PairReach.lostBetween} — reached it and did not convert;
|
|
36
|
+
* - {@link PairReach.conversion}'s share — did both.
|
|
37
|
+
*
|
|
38
|
+
* They partition the appearances, so they sum to 1 wherever all three can be
|
|
39
|
+
* given. **The two losses have opposite remedies** — a page nobody scrolls to
|
|
40
|
+
* the pricing band is a different problem from a pricing band nobody buys from
|
|
41
|
+
* — and `rate` on its own cannot tell them apart, because the first loss is
|
|
42
|
+
* entirely in its denominator. {@link PairReach.worse} names which stage costs
|
|
43
|
+
* more readers.
|
|
44
|
+
*
|
|
45
|
+
* ## The straddle leans the other way here, and 0147 says it does not
|
|
46
|
+
*
|
|
47
|
+
* [0147](../../decisions/0147-a-rollup-is-added-to-what-is-stored-and-a-distinct-view-count-is-therefore-approximate.md)
|
|
48
|
+
* records that *a conversion rate is honest and a view count is slightly
|
|
49
|
+
* generous*, on the ground that a funnel answer is computed inside one rollup
|
|
50
|
+
* run where distinctness is exact. That is true of one answer and **not of the
|
|
51
|
+
* stored row**, which `addFunnelAnswers` adds across every window the counters
|
|
52
|
+
* have seen. A page view whose reader met the first end in one window and
|
|
53
|
+
* converted in the next contributes `reached 1, converted 0` to the first and
|
|
54
|
+
* nothing to the second: the conversion is not double-counted, it is **lost**.
|
|
55
|
+
*
|
|
56
|
+
* So `rate` is the one figure in this subsystem biased *downward* by the
|
|
57
|
+
* straddle, where `reached`, `views` and every share taken off them are biased
|
|
58
|
+
* up. That is the safe direction for *readers convert* and the unsafe one for
|
|
59
|
+
* *this funnel is broken*, which is the claim somebody acts on — so the bias is
|
|
60
|
+
* bounded rather than mentioned: {@link PairReach.rateAtMost} spends §8's drift
|
|
61
|
+
* on the only error bar this subsystem can compute for a funnel.
|
|
62
|
+
*
|
|
63
|
+
* ## A pair the revision no longer has is an answer, not a nought
|
|
64
|
+
*
|
|
65
|
+
* A pair is two node ids a deployment wrote down in advance, and a revision is
|
|
66
|
+
* a tree a proposal changed. So a pair whose end was moved out, renamed or
|
|
67
|
+
* removed answers `reached 0, converted 0` against every revision after it —
|
|
68
|
+
* and that is byte-identical to a band readers never scroll to, while the two
|
|
69
|
+
* remedies are opposite: one is a page to fix and the other is a question to
|
|
70
|
+
* re-point.
|
|
71
|
+
*
|
|
72
|
+
* Nothing on the wire can tell them apart and nothing needs to. §6's join
|
|
73
|
+
* already holds **every element node of the revision**
|
|
74
|
+
* ([0212](../../decisions/0212-what-a-reader-signal-means-is-joined-to-the-tree-when-it-is-read.md)),
|
|
75
|
+
* so an end is looked up in it and given a {@link EndStanding}. That is why
|
|
76
|
+
* this function takes a {@link PageReading} rather than the tree's id and a
|
|
77
|
+
* revision number: the reading *is* the revision, so the two can no longer
|
|
78
|
+
* disagree, and there is no way to ask a funnel question without holding the
|
|
79
|
+
* page it is about.
|
|
80
|
+
*
|
|
81
|
+
* **What is withheld is per figure rather than per pair**, because the two ends
|
|
82
|
+
* fail differently. An absent `to` leaves `reached` a fact about readers — they
|
|
83
|
+
* did get to the first end — so {@link PairReach.entry} and
|
|
84
|
+
* {@link PairReach.lostBefore} still stand and only the figures that need the
|
|
85
|
+
* second end are withheld. An absent `from` withholds all of them, including
|
|
86
|
+
* `lostBefore`, whose nought would otherwise read as *every reader failed to
|
|
87
|
+
* reach it*. {@link PairReach.reached} and {@link PairReach.converted} are
|
|
88
|
+
* always published: they are what is stored, and a surface saying *this
|
|
89
|
+
* question is stale and here is what it last counted* is the useful one.
|
|
90
|
+
*
|
|
91
|
+
* {@link PairReach.orphaned} is the sharper case and the rarer one: an end the
|
|
92
|
+
* tree does not have, with a non-zero count against it. Readers satisfied a
|
|
93
|
+
* question about a part this revision has no node for, which is the funnel's
|
|
94
|
+
* version of the alarm `PageReading.orphaned` raises — a tree and a window that
|
|
95
|
+
* do not belong together.
|
|
96
|
+
*
|
|
97
|
+
* ## What it refuses to say
|
|
98
|
+
*
|
|
99
|
+
* **There is no ranking across pairs.** §9 ranks siblings of one page because
|
|
100
|
+
* siblings are comparable; two funnel pairs are two questions a deployment
|
|
101
|
+
* wrote down about different nodes and different kinds, and the pair that loses
|
|
102
|
+
* the most readers is reliably the one whose `from` is deepest in the page.
|
|
103
|
+
* Ranking them would put a true number at the top of a screen as an answer to a
|
|
104
|
+
* question nobody asked.
|
|
105
|
+
*
|
|
106
|
+
* **A pair is never reported as out of order.** The tree says where its two
|
|
107
|
+
* ends sit, so the temptation is to name a pair whose `to` now precedes its
|
|
108
|
+
* `from` in reading order. There is no such fate, because a pair has *no path
|
|
109
|
+
* and no ordering beyond the two ends* (0146): it asks which views did both
|
|
110
|
+
* things, not in which order, and a reader who scrolls back up satisfies it
|
|
111
|
+
* honestly. Reporting document order as a fault would invent a rule the counter
|
|
112
|
+
* does not apply.
|
|
113
|
+
*
|
|
114
|
+
* **There is no page-level total of readers converted.** One page view can
|
|
115
|
+
* satisfy several pairs, so adding them counts it several times — the same
|
|
116
|
+
* arithmetic that keeps `engaged` off every per-role total (0147, 0167).
|
|
117
|
+
*
|
|
118
|
+
* **A window of two forms with none asked for is read as neither.** A page
|
|
119
|
+
* served in two forms (0263) answers one question twice, one row per audience
|
|
120
|
+
* (0284), and before this the asking that names no audience took whichever row
|
|
121
|
+
* came first and counted the other in `duplicatedPairs` — a real second
|
|
122
|
+
* population reported as a caller handing one question in twice. The door row
|
|
123
|
+
* was picked out of a **different** array by the same rule, so the numerator
|
|
124
|
+
* and the denominator could come from different forms: with four of a hundred
|
|
125
|
+
* skiers and four hundred of a thousand riders, the published entry share was
|
|
126
|
+
* four over a thousand. Two orders of magnitude, from the order two lists
|
|
127
|
+
* arrived in.
|
|
128
|
+
*
|
|
129
|
+
* So the pairs are refused, every row of the revision is counted in
|
|
130
|
+
* `otherAudiencePairs`, and `audiences` names both populations — the shape
|
|
131
|
+
* `pageReadingOf` already had for its parts (0290), read back off the reading
|
|
132
|
+
* with `audienceScopeRead` rather than subtracted from two fields.
|
|
133
|
+
*
|
|
134
|
+
* **Summing them instead is not available, and that is a fact about the
|
|
135
|
+
* question rather than caution.** Arrivals at the door are counted once per
|
|
136
|
+
* page view and therefore add across forms (0297, 0299), which is why the door's
|
|
137
|
+
* figures here are the deployment's. A funnel pair is two node ids a
|
|
138
|
+
* deployment wrote down, and the deltas an audience earns can leave one of
|
|
139
|
+
* those ends out of one form: a sum would then put the readers who could
|
|
140
|
+
* answer the question over the readers of both forms, understating conversion
|
|
141
|
+
* by an amount nothing in the rows can state. The deployment-wide funnel
|
|
142
|
+
* answer is `byAudience` and one reading per form (0290).
|
|
143
|
+
*
|
|
144
|
+
* ## One vocabulary for why there is no denominator
|
|
145
|
+
*
|
|
146
|
+
* {@link ReachSilence} is reused rather than restated. The three states it
|
|
147
|
+
* names — no row for the revision, a row that says no page view ever began, and
|
|
148
|
+
* arrivals no rollup has folded — are states of the *deployment* rather than of
|
|
149
|
+
* the question being asked, so a funnel reading and a part reading are silent
|
|
150
|
+
* for the same three reasons and a surface handles them once. A window of two
|
|
151
|
+
* forms is deliberately **not** a fourth member of it: it is a state of what
|
|
152
|
+
* the caller handed in rather than of the deployment, it is reported by
|
|
153
|
+
* {@link FunnelReach.audiences} the way `pageReadingOf` reports it, and four
|
|
154
|
+
* other sets map this one member for member. `unopened` is
|
|
155
|
+
* still the one worth catching: senders that are not marking their openings
|
|
156
|
+
* leave every rate here denominator-less while the counters look healthy.
|
|
157
|
+
*
|
|
158
|
+
* Pure. It is handed the counters and the page-view rows and reaches no store,
|
|
159
|
+
* no clock and no DOM; it adds nothing to the broadcaster's import graph.
|
|
160
|
+
*/
|
|
161
|
+
/** Where a funnel loses readers, of the two places it can. */
|
|
162
|
+
export type FunnelStage =
|
|
163
|
+
/** Arrivals that never satisfied the pair's first end. */
|
|
164
|
+
"before"
|
|
165
|
+
/** Arrivals that satisfied the first end and not the second. */
|
|
166
|
+
| "between";
|
|
167
|
+
export declare const FUNNEL_STAGES: readonly FunnelStage[];
|
|
168
|
+
/** One line per stage, for a surface putting the reading in front of a person. */
|
|
169
|
+
export declare const describeFunnelStage: (stage: FunnelStage) => string;
|
|
170
|
+
/** What the revision's tree says about one end of a pair. */
|
|
171
|
+
export type EndStanding =
|
|
172
|
+
/**
|
|
173
|
+
* The revision has an element node with this id, so a count against the end
|
|
174
|
+
* is a fact about readers.
|
|
175
|
+
*
|
|
176
|
+
* It is not a promise that the node *can* satisfy the end's kind. A pair
|
|
177
|
+
* asking for `activated` on a band answers nought because a band is not
|
|
178
|
+
* pressed (0146), and nothing in the tree says which types are pressable —
|
|
179
|
+
* `role` declares one member today (0114) and none of them is *a control*.
|
|
180
|
+
* That gap is a declaration another lane owes, and until it exists this
|
|
181
|
+
* standing means the question still names something and no more.
|
|
182
|
+
*/
|
|
183
|
+
"present"
|
|
184
|
+
/**
|
|
185
|
+
* No element node of the revision has this id.
|
|
186
|
+
*
|
|
187
|
+
* The question was written about a part the page no longer has: removed by a
|
|
188
|
+
* change, renamed, or moved to another tree. Its count cannot move again, and
|
|
189
|
+
* the nought it reports is not a reader fact — which is the whole reason this
|
|
190
|
+
* standing exists, because the figures drawn off it are indistinguishable
|
|
191
|
+
* from a funnel readers abandon.
|
|
192
|
+
*
|
|
193
|
+
* A text node and a slot node carry no identity attributes, so no signal can
|
|
194
|
+
* ever name one (0212) and no end can honestly point at one. Every id a pair
|
|
195
|
+
* could legitimately hold is an element node, which is what makes the element
|
|
196
|
+
* nodes of the revision the right universe to look an end up in.
|
|
197
|
+
*/
|
|
198
|
+
| "absent";
|
|
199
|
+
export declare const END_STANDINGS: readonly EndStanding[];
|
|
200
|
+
/** One line per standing, for a surface putting the reading in front of a person. */
|
|
201
|
+
export declare const describeEndStanding: (standing: EndStanding) => string;
|
|
202
|
+
/** Where each end of a pair stands against the revision it is being asked of. */
|
|
203
|
+
export type PairEnds = {
|
|
204
|
+
readonly from: EndStanding;
|
|
205
|
+
readonly to: EndStanding;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* A count of page views, put as a share of the readers there were.
|
|
209
|
+
*
|
|
210
|
+
* The same quartet
|
|
211
|
+
* [0229](../../decisions/0229-a-share-of-readers-is-estimated-against-the-appearances-and-bounded-against-the-openings.md)
|
|
212
|
+
* settled for a part's reach, because the two denominators fail in opposite
|
|
213
|
+
* directions for a funnel end exactly as they do for a part: the appearances
|
|
214
|
+
* carry the straddle the numerator carries and very nearly cancel it, and the
|
|
215
|
+
* openings are exact and therefore bound it.
|
|
216
|
+
*/
|
|
217
|
+
export type FunnelShare = {
|
|
218
|
+
/**
|
|
219
|
+
* The estimate, against the page views the rollups counted:
|
|
220
|
+
* `count ÷ appearances`.
|
|
221
|
+
*
|
|
222
|
+
* The figure to show. `null` under a silence or where the counters and the
|
|
223
|
+
* row cannot be reconciled.
|
|
224
|
+
*/
|
|
225
|
+
readonly share: number | null;
|
|
226
|
+
/**
|
|
227
|
+
* The ceiling, against the page views that began: `count ÷ opened`, never
|
|
228
|
+
* above 1.
|
|
229
|
+
*
|
|
230
|
+
* For an end nearly every reader satisfies it is 1 and says nothing, which is
|
|
231
|
+
* the ordinary state rather than a fault. `null` under a silence.
|
|
232
|
+
*/
|
|
233
|
+
readonly atMost: number | null;
|
|
234
|
+
/**
|
|
235
|
+
* The share applied to the exact count of arrivals — the number a sentence
|
|
236
|
+
* says out loud.
|
|
237
|
+
*
|
|
238
|
+
* One division of two whole numbers rather than the share multiplied back up
|
|
239
|
+
* (0229): seven in a hundred times a hundred is seven and a quadrillionth in
|
|
240
|
+
* a float, which breaks its own ceiling. Deliberately not rounded; a surface
|
|
241
|
+
* that rounds it is saying how precise it thinks it is.
|
|
242
|
+
*
|
|
243
|
+
* Withheld while any opening is pending, because projecting a folded rate
|
|
244
|
+
* onto page views no rollup has reached answers a question about readers
|
|
245
|
+
* nobody measured.
|
|
246
|
+
*/
|
|
247
|
+
readonly readers: number | null;
|
|
248
|
+
/**
|
|
249
|
+
* The most readers it could be: the smaller of the count and the openings,
|
|
250
|
+
* which is a whole number of real page views either way. `null` under a
|
|
251
|
+
* silence.
|
|
252
|
+
*/
|
|
253
|
+
readonly atMostReaders: number | null;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* The readers one pair loses between its two ends, on the scale its page's door
|
|
257
|
+
* counts in, as the interval the straddle leaves it in.
|
|
258
|
+
*
|
|
259
|
+
* An order of conversions ranks pages on this loss
|
|
260
|
+
* ([0333](../../decisions/0333-a-deployments-conversions-are-a-third-order-ranked-on-the-loss-between-the-two-ends.md)),
|
|
261
|
+
* and the figure it ranks on is {@link PairLeak.atMost} — which is a ceiling and
|
|
262
|
+
* not an estimate. `reached` and `converted` are both generous under a straddle
|
|
263
|
+
* and the straddle very nearly divides out of their ratio, but what does not
|
|
264
|
+
* divide out is the conversion a straddle **splits across two windows and
|
|
265
|
+
* loses** (0147): the pair reports `reached 1, converted 0` for a visit that
|
|
266
|
+
* converted, so the loss between the two ends is overstated by exactly the
|
|
267
|
+
* conversions that went missing. Scaling the subtraction by the door corrects
|
|
268
|
+
* how many page views were counted twice and cannot put back a conversion that
|
|
269
|
+
* was never counted once.
|
|
270
|
+
*
|
|
271
|
+
* So the loss has a floor as well, and both ends come off bounds this reading
|
|
272
|
+
* already publishes. The true rate is between {@link PairReach.rate} and
|
|
273
|
+
* {@link PairReach.rateAtMost}, so the readers who reached the first end — put
|
|
274
|
+
* on the door's scale once, by the one rule `door.ts` holds — are taken at each
|
|
275
|
+
* of those two rates. The ceiling is `reached − converted` on the door's scale,
|
|
276
|
+
* which is the key an order of conversions ranks on, arrived at as the same
|
|
277
|
+
* expression as the floor so that the two cannot fail to meet.
|
|
278
|
+
*
|
|
279
|
+
* The two ends meet wherever {@link FunnelReach.exact} — nobody's visit spanned
|
|
280
|
+
* two windows, so there is nothing to divide out and nothing to have been lost.
|
|
281
|
+
* They open apart as a deployment's rollup window shortens relative to how long
|
|
282
|
+
* its readers stay, which is the same fact `rateAtMost` was built to make
|
|
283
|
+
* readable (0147).
|
|
284
|
+
*
|
|
285
|
+
* **Neither end is a count of people and neither is rounded into one.** A
|
|
286
|
+
* surface that rounds them is saying how precise it thinks they are.
|
|
287
|
+
*/
|
|
288
|
+
export type PairLeak = {
|
|
289
|
+
/**
|
|
290
|
+
* The least it could be: the readers who reached the first end, at the most
|
|
291
|
+
* the true rate could be, on the door's scale.
|
|
292
|
+
*
|
|
293
|
+
* Never above {@link PairLeak.atMost} and never below nought. This is the
|
|
294
|
+
* figure a straddle cannot manufacture — a page carrying it is losing at
|
|
295
|
+
* least this many readers however short the deployment's rollup window is.
|
|
296
|
+
*/
|
|
297
|
+
readonly atLeast: number;
|
|
298
|
+
/**
|
|
299
|
+
* The most it could be: `reached − converted` on the door's scale, which is
|
|
300
|
+
* the key an order of conversions is on (0333).
|
|
301
|
+
*/
|
|
302
|
+
readonly atMost: number;
|
|
303
|
+
};
|
|
304
|
+
/** One pair of a revision, as stored and as a share of the readers there were. */
|
|
305
|
+
export type PairReach = {
|
|
306
|
+
readonly pair: FunnelPair;
|
|
307
|
+
/**
|
|
308
|
+
* Page views that satisfied `from`, exactly as stored: added across rollup
|
|
309
|
+
* windows and therefore generous (0147).
|
|
310
|
+
*/
|
|
311
|
+
readonly reached: number;
|
|
312
|
+
/**
|
|
313
|
+
* Page views that satisfied both ends, exactly as stored.
|
|
314
|
+
*
|
|
315
|
+
* Added across windows like everything else, and **the one counter here that
|
|
316
|
+
* a straddle can lose rather than duplicate** — see the module note. Never
|
|
317
|
+
* above {@link PairReach.reached}, because every window's answer satisfies
|
|
318
|
+
* that and a sum of such answers does too.
|
|
319
|
+
*/
|
|
320
|
+
readonly converted: number;
|
|
321
|
+
/** When the funnel row last moved. */
|
|
322
|
+
readonly updatedAt: string;
|
|
323
|
+
/**
|
|
324
|
+
* Where each end stands against the revision's tree.
|
|
325
|
+
*
|
|
326
|
+
* The pair as a deployment wrote it is on {@link PairReach.pair}; this is
|
|
327
|
+
* what the revision makes of it.
|
|
328
|
+
*/
|
|
329
|
+
readonly ends: PairEnds;
|
|
330
|
+
/**
|
|
331
|
+
* Either end is {@link EndStanding.absent}, so the question is about a part
|
|
332
|
+
* this revision does not have.
|
|
333
|
+
*
|
|
334
|
+
* The counts are still published and every figure that needed the missing end
|
|
335
|
+
* is withheld. A surface draws this pair as a question to re-point rather
|
|
336
|
+
* than as a funnel to fix — see the module note for which figures survive
|
|
337
|
+
* which end.
|
|
338
|
+
*/
|
|
339
|
+
readonly stale: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* An end the tree does not have, with a count against it: `reached` on an
|
|
342
|
+
* absent `from`, or `converted` on an absent `to`.
|
|
343
|
+
*
|
|
344
|
+
* Readers satisfied a question about a part this revision has no node for,
|
|
345
|
+
* which rows written by the same deployment cannot produce. What can is a
|
|
346
|
+
* tree and a window that do not belong together — the alarm
|
|
347
|
+
* `PageReading.orphaned` raises for the node counters, raised here for the
|
|
348
|
+
* pairs. Every figure is withheld on the stale end either way; this says the
|
|
349
|
+
* staleness is not the ordinary one and the reading itself is suspect.
|
|
350
|
+
*
|
|
351
|
+
* It is not {@link PairReach.unreconciled}, which is a count above the page
|
|
352
|
+
* views there were to hold it. The two are independent and both can be set.
|
|
353
|
+
*/
|
|
354
|
+
readonly orphaned: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* `converted ÷ reached` — of the readers who got to the first end, the share
|
|
357
|
+
* that finished.
|
|
358
|
+
*
|
|
359
|
+
* Two counts off one row, so the straddle over-count is in both and very
|
|
360
|
+
* nearly divides out. What does *not* divide out is the conversion a straddle
|
|
361
|
+
* splits across two windows and loses, so this is a **floor** on the true
|
|
362
|
+
* rate wherever {@link FunnelReach.exact} is false.
|
|
363
|
+
*
|
|
364
|
+
* `null` where nothing reached the first end: the question has no answer
|
|
365
|
+
* rather than the answer nought. `null` too where either end is absent, for
|
|
366
|
+
* the same reason one level up — there is no question, rather than a question
|
|
367
|
+
* nobody answered.
|
|
368
|
+
*/
|
|
369
|
+
readonly rate: number | null;
|
|
370
|
+
/**
|
|
371
|
+
* The most the true rate could be, given the straddle §8 measured.
|
|
372
|
+
*
|
|
373
|
+
* A page view that straddled a window could have had its conversion split
|
|
374
|
+
* and lost, so the true `converted` is at most `converted + split` where
|
|
375
|
+
* `split` is the smaller of the drift and the conversions still missing. The
|
|
376
|
+
* same straddle inflates `reached`, so the true `reached` is at least
|
|
377
|
+
* `reached − drift`. Both worst cases together, capped at 1.
|
|
378
|
+
*
|
|
379
|
+
* It closes onto {@link PairReach.rate} where nobody's visit spanned two
|
|
380
|
+
* windows, and it opens wide where a deployment's rollup window is short
|
|
381
|
+
* relative to how long readers stay — which is the first time the rollup
|
|
382
|
+
* window's length can be read off a funnel rather than argued about (0147).
|
|
383
|
+
*
|
|
384
|
+
* `null` under a silence, where there is no measured drift to bound it with,
|
|
385
|
+
* and `null` wherever {@link PairReach.rate} is.
|
|
386
|
+
*/
|
|
387
|
+
readonly rateAtMost: number | null;
|
|
388
|
+
/**
|
|
389
|
+
* The readers this pair loses between its two ends, bounded and on the door's
|
|
390
|
+
* scale, or `null` where there is no such loss to put a scale on.
|
|
391
|
+
*
|
|
392
|
+
* `null` on the same terms as {@link PairReach.rateAtMost} — there is no
|
|
393
|
+
* question, or nobody reached its first end, or the door cannot scale this
|
|
394
|
+
* revision — and `null` too where {@link PairReach.unreconciled}, because a
|
|
395
|
+
* count above the page views there were to hold it has no sound scale even
|
|
396
|
+
* though its rate stands.
|
|
397
|
+
*/
|
|
398
|
+
readonly leak: PairLeak | null;
|
|
399
|
+
/**
|
|
400
|
+
* Of the readers who arrived, the share that got to the first end.
|
|
401
|
+
*
|
|
402
|
+
* Withheld where `from` is absent, and **given where only `to` is** — the
|
|
403
|
+
* readers who reached the first end reached it whatever became of the second.
|
|
404
|
+
*/
|
|
405
|
+
readonly entry: FunnelShare;
|
|
406
|
+
/** Of the readers who arrived, the share that got to both. Withheld where either end is absent. */
|
|
407
|
+
readonly conversion: FunnelShare;
|
|
408
|
+
/**
|
|
409
|
+
* The share of arrivals that never reached the first end.
|
|
410
|
+
*
|
|
411
|
+
* `null` under a silence, where {@link PairReach.unreconciled}, or where
|
|
412
|
+
* `from` is absent — a nought there would read as *every reader failed to
|
|
413
|
+
* reach it*, which is the inversion this standing exists to stop. Where it is
|
|
414
|
+
* given it is one of three shares that sum to 1.
|
|
415
|
+
*/
|
|
416
|
+
readonly lostBefore: number | null;
|
|
417
|
+
/**
|
|
418
|
+
* The share of arrivals that reached the first end and did not convert.
|
|
419
|
+
*
|
|
420
|
+
* `null` on the same terms as {@link PairReach.lostBefore}.
|
|
421
|
+
*/
|
|
422
|
+
readonly lostBetween: number | null;
|
|
423
|
+
/**
|
|
424
|
+
* Which of the two stages cost more readers, by headcount rather than by
|
|
425
|
+
* share, which is the ranking rule for a fall between two siblings at its
|
|
426
|
+
* two-element case (0221).
|
|
427
|
+
*
|
|
428
|
+
* `null` where neither is worse: the two losses are equal, which includes the
|
|
429
|
+
* funnel that loses nobody. It is *neither stage is the one to look at*
|
|
430
|
+
* rather than *there is nothing to look at*, and the two losses are published
|
|
431
|
+
* beside it either way.
|
|
432
|
+
*/
|
|
433
|
+
readonly worse: FunnelStage | null;
|
|
434
|
+
/**
|
|
435
|
+
* More readers reached the first end than there were page views to reach it
|
|
436
|
+
* in, so no share here can be drawn.
|
|
437
|
+
*
|
|
438
|
+
* Rows written by the same rollups cannot produce this: a view that satisfied
|
|
439
|
+
* an end in a window is a view that appeared in it. What can is a funnel row
|
|
440
|
+
* older than the page-view column, which is what an upgraded deployment's
|
|
441
|
+
* first reading looks like, or a caller who concatenated two reads of the
|
|
442
|
+
* counters.
|
|
443
|
+
*
|
|
444
|
+
* It is not the ordinary straddle — `reached` above the *openings* is
|
|
445
|
+
* expected, and is what an {@link FunnelShare.atMost} of 1 means.
|
|
446
|
+
*/
|
|
447
|
+
readonly unreconciled: boolean;
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* A revision's funnels, read against the exact number of readers that revision
|
|
451
|
+
* had.
|
|
452
|
+
*
|
|
453
|
+
* The page-view figures are the ones a reading of that counter alone would
|
|
454
|
+
* give, carried here so that a surface drawing shares has the arithmetic behind
|
|
455
|
+
* them on the same object.
|
|
456
|
+
*/
|
|
457
|
+
export type FunnelReach = {
|
|
458
|
+
readonly treeId: TreeId;
|
|
459
|
+
readonly revision: number;
|
|
460
|
+
/**
|
|
461
|
+
* The audience whose answers this reading is of, or `null` where the reading
|
|
462
|
+
* it was taken from named none.
|
|
463
|
+
*
|
|
464
|
+
* Carried rather than consumed and dropped. The rows are already scoped to it
|
|
465
|
+
* below, so this adds nothing to what is read — what it adds is the ability
|
|
466
|
+
* of a comparison to refuse a pair of two populations, which it cannot do
|
|
467
|
+
* from two readings that have forgotten which population each was of (0284).
|
|
468
|
+
*/
|
|
469
|
+
readonly audienceId: AudienceId | null;
|
|
470
|
+
/**
|
|
471
|
+
* Every population the window named, deduplicated and in a stable order.
|
|
472
|
+
*
|
|
473
|
+
* The reading's own census and the funnel rows' together, because either
|
|
474
|
+
* alone can be the ambiguous one: a caller may hand in a page reading of one
|
|
475
|
+
* form and funnel rows of two, or the reverse. `[]` is a window that never
|
|
476
|
+
* carried the column (0284), which is *nothing here says* and not *one
|
|
477
|
+
* audience*.
|
|
478
|
+
*
|
|
479
|
+
* Two members with {@link FunnelReach.audienceId} `null` is the state in
|
|
480
|
+
* which no pair is read at all — see the module note on what a window of two
|
|
481
|
+
* forms is refused for.
|
|
482
|
+
*/
|
|
483
|
+
readonly audiences: readonly AudienceId[];
|
|
484
|
+
/** Page views that began on this revision. Exact, and addable (0219). */
|
|
485
|
+
readonly opened: number;
|
|
486
|
+
/** The same page views as the rollups counted them: once per window each appeared in. */
|
|
487
|
+
readonly appearances: number;
|
|
488
|
+
/** Appearances in excess of openings — the straddle, measured. Never negative. */
|
|
489
|
+
readonly drift: number;
|
|
490
|
+
/** Openings whose reading no rollup has folded yet. The other sign of the same subtraction. */
|
|
491
|
+
readonly pending: number;
|
|
492
|
+
/** `drift ÷ opened`: how generous every distinct count here is. `null` when nothing opened. */
|
|
493
|
+
readonly inflation: number | null;
|
|
494
|
+
/** When the page-view row last moved, or `null` where there is no row. */
|
|
495
|
+
readonly updatedAt: string | null;
|
|
496
|
+
/** Set where no share can be given, and the reason. `null` where they can. */
|
|
497
|
+
readonly silence: ReachSilence | null;
|
|
498
|
+
/**
|
|
499
|
+
* Nobody's visit spanned two windows, so there is nothing to divide out: the
|
|
500
|
+
* rates are exact and each `rateAtMost` equals its `rate`.
|
|
501
|
+
*
|
|
502
|
+
* False under a silence, and false while any opening is pending.
|
|
503
|
+
*/
|
|
504
|
+
readonly exact: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* The revision's pairs, ordered by their two ends so a screen does not
|
|
507
|
+
* reorder on a refresh. Deliberately not ranked — see the module note.
|
|
508
|
+
*/
|
|
509
|
+
readonly pairs: readonly PairReach[];
|
|
510
|
+
/** Page-view rows for another tree or revision, and ignored. */
|
|
511
|
+
readonly foreign: number;
|
|
512
|
+
/** Page-view rows for this revision beyond the first, where the first stands. */
|
|
513
|
+
readonly duplicated: number;
|
|
514
|
+
/**
|
|
515
|
+
* Funnel rows for another tree or revision, and ignored.
|
|
516
|
+
*
|
|
517
|
+
* Filtered rather than trusted for the same reason the page-view rows are:
|
|
518
|
+
* answering one revision's question with another revision's counters is a
|
|
519
|
+
* figure nothing downstream could catch.
|
|
520
|
+
*/
|
|
521
|
+
readonly foreignPairs: number;
|
|
522
|
+
/**
|
|
523
|
+
* Funnel rows for this revision in another audience, and ignored.
|
|
524
|
+
*
|
|
525
|
+
* The same question, answered for the other form of the page. Not foreign —
|
|
526
|
+
* it is this page's — and not a duplicate: two populations answering one
|
|
527
|
+
* question is two answers, and the one this reading wants is its own.
|
|
528
|
+
*/
|
|
529
|
+
readonly otherAudiencePairs: number;
|
|
530
|
+
/**
|
|
531
|
+
* Funnel rows naming a pair already seen, where every one after the first was
|
|
532
|
+
* ignored.
|
|
533
|
+
*
|
|
534
|
+
* A store keeps one row per pair per revision per audience, so a second row
|
|
535
|
+
* for one pair **within one population** is a caller who concatenated two
|
|
536
|
+
* reads, and adding them would double a total that is already one.
|
|
537
|
+
*
|
|
538
|
+
* It says *within one population* rather than asserting the audience was
|
|
539
|
+
* picked first, which is what it used to say and what made the fault below
|
|
540
|
+
* invisible: where the asking named no audience, two forms' answers to one
|
|
541
|
+
* question were two rows sharing this key, and the second was counted here —
|
|
542
|
+
* a real second population reported as the one number in this reading nobody
|
|
543
|
+
* reads as an undercount. A window of two forms is now read as neither, so
|
|
544
|
+
* this counts only what it always claimed to.
|
|
545
|
+
*/
|
|
546
|
+
readonly duplicatedPairs: number;
|
|
547
|
+
/**
|
|
548
|
+
* Pairs with an end this revision does not have, counted off
|
|
549
|
+
* {@link FunnelReach.pairs} and therefore once each.
|
|
550
|
+
*
|
|
551
|
+
* The figure a screen leads with when it is not nought: *three of your five
|
|
552
|
+
* funnel questions are about parts this version of the page no longer has.*
|
|
553
|
+
*/
|
|
554
|
+
readonly stalePairs: number;
|
|
555
|
+
/** Of those, the ones with a count against the missing end. Counted off the same list. */
|
|
556
|
+
readonly orphanedPairs: number;
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* What makes two funnel rows the same question: the two nodes a deployment
|
|
560
|
+
* named, in the two kinds it named them with.
|
|
561
|
+
*
|
|
562
|
+
* Published rather than private because a second reading needs the same rule —
|
|
563
|
+
* a comparison of two windows pairs its rows by it — and two spellings of one
|
|
564
|
+
* identity is what the counter keys were before `counters.ts` wrote them once,
|
|
565
|
+
* and what the door's scale was before `door.ts` did. It is also the rule that
|
|
566
|
+
* decides what a **duplicate** row is, which 0158 makes permanent if it is got
|
|
567
|
+
* wrong in either place.
|
|
568
|
+
*
|
|
569
|
+
* Deliberately not the node ids alone: a pair asking `viewed → completed` and
|
|
570
|
+
* one asking `viewed → activated` over the same two nodes are two questions,
|
|
571
|
+
* and a reading that collapsed them would hold one window's conversions
|
|
572
|
+
* against another window's presses.
|
|
573
|
+
*/
|
|
574
|
+
export declare const funnelPairKey: (pair: FunnelPair) => string;
|
|
575
|
+
/**
|
|
576
|
+
* Read a revision's funnels against the readers that revision had, and against
|
|
577
|
+
* the tree that revision is.
|
|
578
|
+
*
|
|
579
|
+
* **The reading is the revision.** Handing in a `PageReading` rather than a
|
|
580
|
+
* tree id and a number keeps the property 0231 recorded — the revision is
|
|
581
|
+
* handed in rather than inferred, and both sets of rows are filtered to it here
|
|
582
|
+
* rather than trusted — and closes the gap it left: a caller can no longer name
|
|
583
|
+
* one revision and hold another revision's tree, because there is only the one
|
|
584
|
+
* object. The two mistakes that would make every figure quietly wrong are a row
|
|
585
|
+
* from the wrong revision and a row counted twice, and the third is a question
|
|
586
|
+
* asked of a page that has not had those nodes since March.
|
|
587
|
+
*
|
|
588
|
+
* Linear in the pairs, the page-view rows and the reading's parts, with one
|
|
589
|
+
* pass over each.
|
|
590
|
+
*/
|
|
591
|
+
export declare const funnelReachOf: (reading: PageReading, funnels: readonly StoredFunnel[], rows: readonly StoredPageViews[]) => FunnelReach;
|
|
592
|
+
//# sourceMappingURL=funnel.d.ts.map
|