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