@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,378 @@
|
|
|
1
|
+
import type { NodeId, TreeId } from "../ids.js";
|
|
2
|
+
import { type ComparedAudiences } from "./audiences.js";
|
|
3
|
+
import type { PageReading } from "./parts.js";
|
|
4
|
+
import { type ReadingProgress } from "./progress.js";
|
|
5
|
+
/**
|
|
6
|
+
* What a change did to the reading of a page.
|
|
7
|
+
*
|
|
8
|
+
* *Before versus after a change* is the measurement Loom exists for: a page
|
|
9
|
+
* changed, and the question is whether readers got further. Every other reading
|
|
10
|
+
* in this subsystem describes one window of one revision and leaves the
|
|
11
|
+
* comparison to whoever is looking at two screens.
|
|
12
|
+
*
|
|
13
|
+
* It is the fourth thing taken out of the server-side join rather than collected
|
|
14
|
+
* ([`parts.ts`](parts.ts), [`page-views.ts`](page-views.ts) and
|
|
15
|
+
* [`progress.ts`](progress.ts) being the others): **nothing was added to a
|
|
16
|
+
* payload, a browser, a column or the vocabulary.** Two readings go in and a
|
|
17
|
+
* comparison comes out.
|
|
18
|
+
*
|
|
19
|
+
* ## The one figure that is comparable across two revisions
|
|
20
|
+
*
|
|
21
|
+
* A `reached` count is not. Two revisions are two windows of two trees with two
|
|
22
|
+
* sets of readers: the counts differ because the page changed, because more
|
|
23
|
+
* people came, and because a rollup window straddled differently
|
|
24
|
+
* ([0147](../../decisions/0147-a-rollup-is-added-to-what-is-stored-and-a-distinct-view-count-is-therefore-approximate.md)).
|
|
25
|
+
* Nothing divides out.
|
|
26
|
+
*
|
|
27
|
+
* A **share** is, and for the reason
|
|
28
|
+
* [0221](../../decisions/0221-where-reading-stops-is-a-fall-between-two-siblings-and-a-ratio-of-two-counts-off-one-row-set.md)
|
|
29
|
+
* gives: a stop's share is `lost ÷ reached` off two rows of one revision, so
|
|
30
|
+
* each side's inflation has already divided out before the two sides meet. The
|
|
31
|
+
* difference between two shares is therefore a difference between two figures
|
|
32
|
+
* that were each honest on their own, which is the whole of why this module
|
|
33
|
+
* compares shares and never counts.
|
|
34
|
+
*
|
|
35
|
+
* So the unit of comparison is **the stop**, not the part. *Six in ten readers
|
|
36
|
+
* left at the pricing band and now four in ten do* is a sentence; *three hundred
|
|
37
|
+
* readers reached it and now four hundred do* is three sentences about traffic
|
|
38
|
+
* wearing one about reading.
|
|
39
|
+
*
|
|
40
|
+
* ## A pair the change dissolved is an answer, not a gap
|
|
41
|
+
*
|
|
42
|
+
* A stop is a pair of adjacent siblings. A change can take that pair apart —
|
|
43
|
+
* remove an end, move one away, insert a band between them — and the obvious
|
|
44
|
+
* handling is to drop it from the comparison. That throws away the most
|
|
45
|
+
* interesting thing on the screen: **a band inserted into the gap where readers
|
|
46
|
+
* were leaving is the commonest change anybody will make**, and the pair it
|
|
47
|
+
* separated is how you find it. So every pair that cannot be compared is
|
|
48
|
+
* reported with the reason it cannot ({@link PairFate}), carrying what its own
|
|
49
|
+
* side measured, which is still true of that side.
|
|
50
|
+
*
|
|
51
|
+
* ## Two readings, not two revisions
|
|
52
|
+
*
|
|
53
|
+
* The two readings may name the same revision. Then no part was added, removed,
|
|
54
|
+
* moved or reworded, every pair matches, and what comes back is the difference
|
|
55
|
+
* between two windows of one page — *this week against last week* — out of the
|
|
56
|
+
* same function. That is not a special case to be allowed for; it is the same
|
|
57
|
+
* question with the tree held still.
|
|
58
|
+
*
|
|
59
|
+
* Which also means this does not check which reading is older. The labels `was`
|
|
60
|
+
* and `now` are the caller's, and a caller who holds them backwards gets a
|
|
61
|
+
* comparison with every sign reversed rather than a refusal.
|
|
62
|
+
*
|
|
63
|
+
* ## It does check that the two readings are of one readership
|
|
64
|
+
*
|
|
65
|
+
* Holding the tree still is the whole design above. A pair whose two sides name
|
|
66
|
+
* two audiences holds nothing still: a page is one base tree and the deltas an
|
|
67
|
+
* audience earns (0263), so the two sides are two trees wearing one tree id and
|
|
68
|
+
* two populations wearing one page. Every figure here would be produced and the
|
|
69
|
+
* sentence on top of them would be wrong, which is why that pair is refused
|
|
70
|
+
* rather than silenced in the reader half alone — see {@link ChangeSilence}.
|
|
71
|
+
*
|
|
72
|
+
* ## What it refuses to add up
|
|
73
|
+
*
|
|
74
|
+
* There is no page-level total of readers kept, and the absence is deliberate.
|
|
75
|
+
* A reader who got past the second band and then past the third is in both
|
|
76
|
+
* stops' figures, so adding them counts one reader twice — the distinctness trap
|
|
77
|
+
* 0147 wrote down for views and
|
|
78
|
+
* [0167](../../decisions/0167-a-delegated-signal-names-the-regions-it-happened-inside.md)
|
|
79
|
+
* wrote down for presses, in the one place where the sum would look most like a
|
|
80
|
+
* headline.
|
|
81
|
+
*
|
|
82
|
+
* Pure, linear in the parts, and reaches no store, clock or DOM. A caller checks
|
|
83
|
+
* {@link PageReading.orphaned} on both readings before trusting either, exactly
|
|
84
|
+
* as it must before trusting either progress.
|
|
85
|
+
*/
|
|
86
|
+
/** Why a comparison answered nothing. */
|
|
87
|
+
export type ChangeSilence =
|
|
88
|
+
/**
|
|
89
|
+
* The two readings are of different trees.
|
|
90
|
+
*
|
|
91
|
+
* Nothing is comparable: not a pair, not a part, not a word. Two pages are
|
|
92
|
+
* two pages, and the plausible-false-number failure here would be a screen
|
|
93
|
+
* reporting that a change removed every part of a page it was never about.
|
|
94
|
+
*/
|
|
95
|
+
"different-trees"
|
|
96
|
+
/**
|
|
97
|
+
* The two readings are of two audiences, and so of two populations.
|
|
98
|
+
*
|
|
99
|
+
* A page is one base tree plus the deltas an audience earns (0263), so two
|
|
100
|
+
* forms of it share a tree id and are not the same page: the parts census
|
|
101
|
+
* would report the other form's deltas as what the change did, and the stops
|
|
102
|
+
* would report one population's reading against another's. Nothing here is
|
|
103
|
+
* comparable, which is why the census is withheld as it is for two trees and
|
|
104
|
+
* not published as it is for a window with no views.
|
|
105
|
+
*
|
|
106
|
+
* Refused only where both sides name an audience and the two differ. A
|
|
107
|
+
* window whose rows never carried the column (0284) names none, and a pair
|
|
108
|
+
* spanning that migration is not provably two populations — it is in
|
|
109
|
+
* {@link ReadingChange.audiences} instead, where a surface can see what it is
|
|
110
|
+
* reading across.
|
|
111
|
+
*
|
|
112
|
+
* Checked after `different-trees`, which is the broader fault: two unrelated
|
|
113
|
+
* pages are not made comparable by one audience, and a caller holding two
|
|
114
|
+
* pages wants to be told that first.
|
|
115
|
+
*/
|
|
116
|
+
| "different-audiences"
|
|
117
|
+
/**
|
|
118
|
+
* One of the two windows holds two forms of the page and nothing said which
|
|
119
|
+
* was wanted, so that side was read as neither population.
|
|
120
|
+
*
|
|
121
|
+
* The sibling of `different-audiences` and the one it cannot catch: that
|
|
122
|
+
* refuses a pair whose two sides name **two** audiences, and this refuses a
|
|
123
|
+
* side that names **none while holding two**. `crossesAudiences` is false
|
|
124
|
+
* wherever either side's audience is `null` and is right to be — a window
|
|
125
|
+
* written before the column existed names none too (0284) — so the ambiguity
|
|
126
|
+
* had no reader here at all.
|
|
127
|
+
*
|
|
128
|
+
* **What it was reported as instead is why it is worth a member.** A refused
|
|
129
|
+
* page reading has every part `unknown` and a view floor of nought (0290), so
|
|
130
|
+
* the pair fell into `nothing-measured` and the sentence printed was *one of
|
|
131
|
+
* the two windows held no page views*. The window held plenty: it held two
|
|
132
|
+
* forms of them. One sentence sends a deployment to look for a broken sender
|
|
133
|
+
* and the other tells it to split the window and read twice, which is a call
|
|
134
|
+
* away.
|
|
135
|
+
*
|
|
136
|
+
* The parts census still answers, for `nothing-measured`'s reason — what the
|
|
137
|
+
* change did to the tree is read off the two trees and not off any counter —
|
|
138
|
+
* and the funnel comparison refuses a mixed side in the same place for the
|
|
139
|
+
* same cause (0300).
|
|
140
|
+
*
|
|
141
|
+
* **It cannot co-occur with `different-audiences`, so the order between the
|
|
142
|
+
* two is not observable.** `crossesAudiences` needs an audience on both
|
|
143
|
+
* sides; a mixed side has none. A side that names an audience *and* holds two
|
|
144
|
+
* in its census is `one` and not mixed, because an audience asked for always
|
|
145
|
+
* wins (0300). The order that does matter is before the view floor, because
|
|
146
|
+
* the refusal is that floor's cause and a cause names itself better than its
|
|
147
|
+
* symptom does.
|
|
148
|
+
*/
|
|
149
|
+
| "audiences-mixed"
|
|
150
|
+
/**
|
|
151
|
+
* One of the two windows held no views.
|
|
152
|
+
*
|
|
153
|
+
* Every standing on that side is `unknown` (`parts.ts`), so there is no share
|
|
154
|
+
* to compare against — and *every fall was fixed* is what a naive subtraction
|
|
155
|
+
* would say about a page nobody has opened yet. The parts census still
|
|
156
|
+
* answers, because what the change did to the tree is a fact about the tree:
|
|
157
|
+
* a reading may say *three bands moved and one was reworded, and nothing has
|
|
158
|
+
* been measured since.*
|
|
159
|
+
*/
|
|
160
|
+
| "nothing-measured";
|
|
161
|
+
export declare const CHANGE_SILENCES: readonly ChangeSilence[];
|
|
162
|
+
/** One line per silence, for a surface putting the comparison in front of a person. */
|
|
163
|
+
export declare const describeChangeSilence: (silence: ChangeSilence) => string;
|
|
164
|
+
/** Why a pair of siblings has no counterpart in the other reading. */
|
|
165
|
+
export type PairFate =
|
|
166
|
+
/** One of its two parts is not in the other revision at all: removed by the change, or added by it. */
|
|
167
|
+
"absent"
|
|
168
|
+
/** Both parts are there and no longer children of the same node, so they are not siblings to compare. */
|
|
169
|
+
| "moved"
|
|
170
|
+
/**
|
|
171
|
+
* Both parts are still children of one node and no longer next to each other.
|
|
172
|
+
*
|
|
173
|
+
* Something was inserted between them, or a part between them that could not
|
|
174
|
+
* anchor a stop now can. This is the fate worth looking at hardest: a change
|
|
175
|
+
* made where readers were leaving shows up here and nowhere else.
|
|
176
|
+
*/
|
|
177
|
+
| "separated"
|
|
178
|
+
/**
|
|
179
|
+
* They are still adjacent and the other way round, so the fall between them
|
|
180
|
+
* is a fall in the other direction.
|
|
181
|
+
*
|
|
182
|
+
* A reader meets them in the opposite order, which makes the two shares
|
|
183
|
+
* answers to two different questions rather than two answers to one. Reported
|
|
184
|
+
* once per side, because each orientation is an adjacency somebody really
|
|
185
|
+
* read.
|
|
186
|
+
*/
|
|
187
|
+
| "reordered"
|
|
188
|
+
/**
|
|
189
|
+
* They are still adjacent, and one of them reported something other than
|
|
190
|
+
* coming into view there.
|
|
191
|
+
*
|
|
192
|
+
* Its `reached` of 0 is an absence of evidence rather than an absence of
|
|
193
|
+
* readers (0221), so no fall can be measured between them on that side — and
|
|
194
|
+
* a side-by-side that quietly read it as zero would report a cliff appearing
|
|
195
|
+
* or vanishing that no reader walked off.
|
|
196
|
+
*/
|
|
197
|
+
| "unanchorable"
|
|
198
|
+
/**
|
|
199
|
+
* They are adjacent and anchorable on both sides, and on one side nobody
|
|
200
|
+
* reached the first of them.
|
|
201
|
+
*
|
|
202
|
+
* `lost ÷ reached` has no value there, and the tempting reading is the
|
|
203
|
+
* dangerous one: a share of 0.6 beside a share nobody can compute looks like a
|
|
204
|
+
* fall that was fixed, when what happened is that readers stopped arriving.
|
|
205
|
+
*/
|
|
206
|
+
| "unreached";
|
|
207
|
+
export declare const PAIR_FATES: readonly PairFate[];
|
|
208
|
+
/** One line per fate, for a surface putting the comparison in front of a person. */
|
|
209
|
+
export declare const describePairFate: (fate: PairFate) => string;
|
|
210
|
+
/** What one reading said about one pair of siblings. */
|
|
211
|
+
export type StopSide = {
|
|
212
|
+
/** Views that reached the first of the pair, which is the denominator of `share`. */
|
|
213
|
+
readonly reached: number;
|
|
214
|
+
/** Views that reached the first and not the second. Zero where none did. */
|
|
215
|
+
readonly lost: number;
|
|
216
|
+
/** `lost ÷ reached`, in `[0, 1]`. Zero is a pair nobody stopped at. */
|
|
217
|
+
readonly share: number;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* One pair of siblings, as two readings measured it.
|
|
221
|
+
*
|
|
222
|
+
* Both sides are falls off their own rows, so the two shares are comparable and
|
|
223
|
+
* the two `reached` counts are not. Nothing here divides one side's count by the
|
|
224
|
+
* other's.
|
|
225
|
+
*/
|
|
226
|
+
export type ComparedStop = {
|
|
227
|
+
/** The part they reached. */
|
|
228
|
+
readonly after: NodeId;
|
|
229
|
+
/** The next part in the run, which fewer reached. */
|
|
230
|
+
readonly before: NodeId;
|
|
231
|
+
/** The parent whose run they are both steps of, which is the same node in both readings. */
|
|
232
|
+
readonly parentId: NodeId;
|
|
233
|
+
readonly was: StopSide;
|
|
234
|
+
readonly now: StopSide;
|
|
235
|
+
/**
|
|
236
|
+
* `was.share − now.share`: the share of readers that no longer stop here.
|
|
237
|
+
*
|
|
238
|
+
* **Positive is better**, because a stop is a loss, and
|
|
239
|
+
* {@link ComparedStop.readersKept} carries the same sign for the same reason.
|
|
240
|
+
* A screen that subtracted the other way round would have one of its two
|
|
241
|
+
* figures pointing the wrong way, which is the defect a reviewer cannot see.
|
|
242
|
+
*/
|
|
243
|
+
readonly improvement: number;
|
|
244
|
+
/**
|
|
245
|
+
* The smallest share one reader could move, on whichever side counted fewer.
|
|
246
|
+
*
|
|
247
|
+
* `1 ÷ min(was.reached, now.reached)`. It is the resolution of the comparison
|
|
248
|
+
* and not a confidence interval: two readers out of three against one out of
|
|
249
|
+
* two is a third of a share point apart and is two readers, and no amount of
|
|
250
|
+
* arithmetic makes it more than that.
|
|
251
|
+
*/
|
|
252
|
+
readonly resolution: number;
|
|
253
|
+
/**
|
|
254
|
+
* Whether `improvement` is at least one reader's worth on the coarser side.
|
|
255
|
+
*
|
|
256
|
+
* False is *nothing happened here that a reader did*, and it is the field that
|
|
257
|
+
* keeps a sparsely-read page off the top of a screen. Evaluated in integers
|
|
258
|
+
* rather than by comparing two divisions, so a rounding error never decides
|
|
259
|
+
* whether a reader exists.
|
|
260
|
+
*/
|
|
261
|
+
readonly beyondOneReader: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* `improvement × now.reached`: the readers the change no longer loses here, at
|
|
264
|
+
* the volume the page has now.
|
|
265
|
+
*
|
|
266
|
+
* The ranking key, and it ranks by readers rather than by share for the same
|
|
267
|
+
* reason a fall does (0221) — a stop two readers out of three abandoned is a
|
|
268
|
+
* worse rate and a smaller problem than one four hundred out of a thousand
|
|
269
|
+
* did. Not rounded, because it is a rate times a count and a magnitude rather
|
|
270
|
+
* than a census, and **never added across stops**: one reader is in every stop
|
|
271
|
+
* they walked past.
|
|
272
|
+
*/
|
|
273
|
+
readonly readersKept: number;
|
|
274
|
+
};
|
|
275
|
+
/** A pair one reading measured and the other cannot be asked about. */
|
|
276
|
+
export type IncomparablePair = {
|
|
277
|
+
readonly after: NodeId;
|
|
278
|
+
readonly before: NodeId;
|
|
279
|
+
readonly parentId: NodeId;
|
|
280
|
+
/** Which reading this pair is from, and therefore which reading `reached` and `share` are off. */
|
|
281
|
+
readonly side: "was" | "now";
|
|
282
|
+
readonly fate: PairFate;
|
|
283
|
+
readonly reached: number;
|
|
284
|
+
readonly share: number;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* What the change did to the page itself, as the two trees say it.
|
|
288
|
+
*
|
|
289
|
+
* Counters are not in it. This is the half of a comparison that answers with no
|
|
290
|
+
* readers at all, and it is what makes a silent window still worth reading.
|
|
291
|
+
*/
|
|
292
|
+
export type PartsChanged = {
|
|
293
|
+
/** Element nodes in both revisions, {@link PartsChanged.moved} among them. */
|
|
294
|
+
readonly shared: number;
|
|
295
|
+
/** In the later revision and not the earlier one, in reading order. */
|
|
296
|
+
readonly added: readonly NodeId[];
|
|
297
|
+
/** In the earlier revision and not the later one, in reading order. */
|
|
298
|
+
readonly removed: readonly NodeId[];
|
|
299
|
+
/** Shared parts whose parent is a different node, in reading order. */
|
|
300
|
+
readonly moved: readonly NodeId[];
|
|
301
|
+
/**
|
|
302
|
+
* Shared parts whose own words are not the words they were, in reading order.
|
|
303
|
+
*
|
|
304
|
+
* **A floor and not a count.** A part's words are the props its type declared
|
|
305
|
+
* as copy (0122) and its direct text children, so a part whose type declares
|
|
306
|
+
* nothing has no words to compare and a rewording of it is invisible here.
|
|
307
|
+
* {@link PartsChanged.unreadable} is how many parts that is, which is what
|
|
308
|
+
* stops the floor from reading as a total.
|
|
309
|
+
*/
|
|
310
|
+
readonly reworded: readonly NodeId[];
|
|
311
|
+
/**
|
|
312
|
+
* Shared parts whose words were the same as far as this reading could see, and
|
|
313
|
+
* where something about them went unread on one side or the other.
|
|
314
|
+
*
|
|
315
|
+
* *Nobody has said whether these props are words* is a different answer from
|
|
316
|
+
* *these words did not change*, and keeping them apart is the bargain `copy`
|
|
317
|
+
* was declared under (0122) and the join carried into a reading (0212).
|
|
318
|
+
*/
|
|
319
|
+
readonly unreadable: number;
|
|
320
|
+
};
|
|
321
|
+
export type ReadingChange = {
|
|
322
|
+
/** The earlier reading's tree. The two agree unless `silence` is `different-trees`. */
|
|
323
|
+
readonly treeId: TreeId;
|
|
324
|
+
readonly revisions: {
|
|
325
|
+
readonly was: number;
|
|
326
|
+
readonly now: number;
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* The audience each side was of, where its reading named one.
|
|
330
|
+
*
|
|
331
|
+
* Carried under every silence and under none. A `null` on either side is why
|
|
332
|
+
* a pair of two populations can still be compared here: it is unprovable
|
|
333
|
+
* rather than proven alike, and a surface saying *compared across a window
|
|
334
|
+
* that named no audience* needs the field to say it.
|
|
335
|
+
*/
|
|
336
|
+
readonly audiences: ComparedAudiences;
|
|
337
|
+
/**
|
|
338
|
+
* The two progress readings this comparison is made of.
|
|
339
|
+
*
|
|
340
|
+
* Carried rather than left to the caller, because deriving them twice is how
|
|
341
|
+
* two screens come to disagree — and because the headline of each side is
|
|
342
|
+
* already on them: a consumer that wants *the steepest fall before, and what
|
|
343
|
+
* happened to it* takes `progress.was.steepest` and finds that pair in
|
|
344
|
+
* {@link ReadingChange.stops} or {@link ReadingChange.incomparable} by its two
|
|
345
|
+
* node ids.
|
|
346
|
+
*/
|
|
347
|
+
readonly progress: {
|
|
348
|
+
readonly was: ReadingProgress;
|
|
349
|
+
readonly now: ReadingProgress;
|
|
350
|
+
};
|
|
351
|
+
readonly parts: PartsChanged;
|
|
352
|
+
/** Every pair both readings could measure, in the earlier reading's reading order. */
|
|
353
|
+
readonly stops: readonly ComparedStop[];
|
|
354
|
+
/** Every pair only one of them could, each once, with the reason. */
|
|
355
|
+
readonly incomparable: readonly IncomparablePair[];
|
|
356
|
+
/**
|
|
357
|
+
* The pair the change keeps most readers at, among those beyond one reader.
|
|
358
|
+
*
|
|
359
|
+
* Null where no pair improved by more than a reader, which includes every page
|
|
360
|
+
* the change did not help.
|
|
361
|
+
*/
|
|
362
|
+
readonly mostKept: ComparedStop | null;
|
|
363
|
+
/** The pair it loses most readers at, on the same terms. Null where none worsened. */
|
|
364
|
+
readonly mostLost: ComparedStop | null;
|
|
365
|
+
/** Why nothing was compared, or `null` where something was. */
|
|
366
|
+
readonly silence: ChangeSilence | null;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* What a change did to the reading of a page, from a reading of each side.
|
|
370
|
+
*
|
|
371
|
+
* Handed two `PageReading`s rather than two `ReadingProgress`es, for the reason
|
|
372
|
+
* `readingProgressOf` is handed a reading: one input per side cannot be a
|
|
373
|
+
* mismatched pair, and the parts census needs the parts a progress leaves out —
|
|
374
|
+
* a root, and a part whose parent has no other child. The two progresses it
|
|
375
|
+
* derives are returned, so nothing downstream computes them twice.
|
|
376
|
+
*/
|
|
377
|
+
export declare const readingChangeOf: (was: PageReading, now: PageReading) => ReadingChange;
|
|
378
|
+
//# sourceMappingURL=change.d.ts.map
|