@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
package/dist/sdk/registry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BINDING_NAME_EXPECTATION, bindingNameSchema, } from "../data/source.js";
|
|
2
2
|
import { primitiveTypeSchema, slotNameSchema, textKeySchema, } from "../primitive-type.js";
|
|
3
3
|
import { err, ok } from "../result.js";
|
|
4
|
-
import { BEHAVIOURS, isBehaviourName, } from "../render/behaviour.js";
|
|
4
|
+
import { BEHAVIOURS, isBehaviourName, NO_CONTROL_NAME_PROPS, } from "../render/behaviour.js";
|
|
5
5
|
import { NO_TEXT } from "../render/text.js";
|
|
6
6
|
import { isPrimitiveRole, PRIMITIVE_ROLES } from "../role.js";
|
|
7
7
|
const NO_BEHAVIOUR_NAMES = Object.freeze([]);
|
|
@@ -35,6 +35,10 @@ export const describeRegistryError = (error) => {
|
|
|
35
35
|
return `"${error.type}" takes the "${error.behaviour}" behaviour and not "${error.requires}", which it does nothing without; it would render a control that asks a region nothing opens to close`;
|
|
36
36
|
case "undeclared-reads-prop":
|
|
37
37
|
return `"${error.type}" says it reads a binding under whichever name its "${error.prop}" prop gives, which its props schema does not declare; that prop can never arrive, so the primitive would read its default for ever and go on doing so after the prop it names was renamed`;
|
|
38
|
+
case "undeclared-named-behaviour":
|
|
39
|
+
return `"${error.type}" says its "${error.behaviour}" control is named by "${error.prop}" and does not take that behaviour; there is no control for the prop to name, so the declaration would sit there reading as something this primitive does`;
|
|
40
|
+
case "undeclared-control-name-prop":
|
|
41
|
+
return `"${error.type}" says its "${error.behaviour}" control is named by "${error.prop}", which its props schema does not declare; that prop can never arrive, so every one of these controls would quietly fall back to the declared string and go on doing so after the prop it names was renamed`;
|
|
38
42
|
case "unknown-role":
|
|
39
43
|
return `"${error.type}" declares the role "${error.role}", which the runtime has none of; the vocabulary is closed and its members are ${PRIMITIVE_ROLES.map((role) => `"${role}"`).join(", ")} — and a misspelling accepted here would read to every consumer as a primitive that declares no role at all`;
|
|
40
44
|
case "duplicate-primitive-type":
|
|
@@ -139,6 +143,41 @@ const registeredBehaviours = (entry) => {
|
|
|
139
143
|
}
|
|
140
144
|
return ok(names);
|
|
141
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* Which prop names which control, checked against the two lists it refers to.
|
|
148
|
+
*
|
|
149
|
+
* Both halves fail the way `undeclaredFrameProp` fails and in the quieter
|
|
150
|
+
* direction. A behaviour this primitive does not take is a declaration about a
|
|
151
|
+
* control that is never built, which reads to anyone auditing the registry as
|
|
152
|
+
* something this primitive does. A prop its schema does not declare can never
|
|
153
|
+
* arrive, so every one of those controls falls back to the declared string — a
|
|
154
|
+
* page that is correct, announced by a word its author stopped intending, with
|
|
155
|
+
* nothing anywhere saying so.
|
|
156
|
+
*
|
|
157
|
+
* A schema whose fields cannot be enumerated answers nothing about its props and
|
|
158
|
+
* is left alone on that half, for the reason the other two prop checks give:
|
|
159
|
+
* "I cannot tell you" is not "there are none". The behaviour half is still
|
|
160
|
+
* checked, because the entry's own list is in hand either way.
|
|
161
|
+
*/
|
|
162
|
+
const registeredNames = (entry) => {
|
|
163
|
+
const pairs = Object.entries(entry.names);
|
|
164
|
+
if (pairs.length === 0)
|
|
165
|
+
return ok(NO_CONTROL_NAME_PROPS);
|
|
166
|
+
const declaredProps = entry.declaredProps
|
|
167
|
+
? new Set(entry.declaredProps.map((prop) => prop.name))
|
|
168
|
+
: undefined;
|
|
169
|
+
const names = Object.create(null);
|
|
170
|
+
for (const [behaviour, prop] of pairs) {
|
|
171
|
+
if (!entry.behaviours.includes(behaviour)) {
|
|
172
|
+
return err({ code: "undeclared-named-behaviour", type: entry.type, behaviour, prop });
|
|
173
|
+
}
|
|
174
|
+
if (declaredProps && !declaredProps.has(prop)) {
|
|
175
|
+
return err({ code: "undeclared-control-name-prop", type: entry.type, behaviour, prop });
|
|
176
|
+
}
|
|
177
|
+
names[behaviour] = prop;
|
|
178
|
+
}
|
|
179
|
+
return ok(Object.freeze(names));
|
|
180
|
+
};
|
|
142
181
|
/**
|
|
143
182
|
* The declared role, checked — `undefined` for the primitive that declared none,
|
|
144
183
|
* which is most of them.
|
|
@@ -237,6 +276,10 @@ const registerEntry = (entry) => {
|
|
|
237
276
|
const behaviours = registeredBehaviours(entry);
|
|
238
277
|
if (!behaviours.ok)
|
|
239
278
|
return behaviours;
|
|
279
|
+
/** After the behaviours, so an unknown name is refused as one rather than as a pair. */
|
|
280
|
+
const names = registeredNames(entry);
|
|
281
|
+
if (!names.ok)
|
|
282
|
+
return names;
|
|
240
283
|
const role = registeredRole(entry);
|
|
241
284
|
if (!role.ok)
|
|
242
285
|
return role;
|
|
@@ -255,9 +298,11 @@ const registerEntry = (entry) => {
|
|
|
255
298
|
submits: entry.submits,
|
|
256
299
|
frames: entry.frames,
|
|
257
300
|
behaviours: behaviours.value,
|
|
301
|
+
names: names.value,
|
|
258
302
|
role: role.value,
|
|
259
303
|
copy: entry.copy ? Object.freeze([...entry.copy]) : undefined,
|
|
260
304
|
reads: reads.value,
|
|
305
|
+
unshown: entry.unshown,
|
|
261
306
|
validate: entry.validate,
|
|
262
307
|
});
|
|
263
308
|
};
|
|
@@ -307,6 +352,7 @@ export const createPrimitiveRegistry = (entries) => {
|
|
|
307
352
|
validateProps: (type, props) => byType.get(type)?.validate(props) ?? { outcome: "undeclared" },
|
|
308
353
|
textFor: (type) => byType.get(type)?.text ?? NO_TEXT,
|
|
309
354
|
behavioursFor: (type) => byType.get(type)?.behaviours ?? NO_BEHAVIOUR_NAMES,
|
|
355
|
+
controlNamePropsFor: (type) => byType.get(type)?.names ?? NO_CONTROL_NAME_PROPS,
|
|
310
356
|
framePropsFor: (type) => byType.get(type)?.frames ?? NO_FRAME_PROPS,
|
|
311
357
|
/**
|
|
312
358
|
* `undefined` both for a primitive that declared nothing and for a type
|
|
@@ -323,6 +369,22 @@ export const createPrimitiveRegistry = (entries) => {
|
|
|
323
369
|
* words would under-report the same way this exists to stop.
|
|
324
370
|
*/
|
|
325
371
|
copyFor: (type) => byType.get(type)?.copy,
|
|
372
|
+
/**
|
|
373
|
+
* `undefined` for a type nobody registered as well as for one that declared
|
|
374
|
+
* nothing, and here the two mean the same thing: a walk that could not find
|
|
375
|
+
* the primitive has said so as `unknown-primitive` and rendered nothing, so
|
|
376
|
+
* there is no node whose answers anybody could have a reading of.
|
|
377
|
+
*/
|
|
378
|
+
/**
|
|
379
|
+
* `undefined` only for a type nobody registered, and here that is the whole
|
|
380
|
+
* of the absence: `slots` is the declaration where leaving it out and
|
|
381
|
+
* declaring it empty are the same claim, so a registered primitive that
|
|
382
|
+
* said nothing answers `[]` — it places no regions, which is what a
|
|
383
|
+
* declared slot was given to mean (0051). A walk that could not find the
|
|
384
|
+
* primitive has already said so as `unknown-primitive`.
|
|
385
|
+
*/
|
|
386
|
+
slotsPlacedBy: (type) => byType.get(type)?.slots,
|
|
387
|
+
unshownBy: (type) => byType.get(type)?.unshown,
|
|
326
388
|
typesWithRole: (role) => byRole.get(role) ?? NO_TYPES,
|
|
327
389
|
});
|
|
328
390
|
};
|
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
import type { NodeId, TreeId } from "../ids.js";
|
|
2
|
+
import type { PrimitiveRole } from "../role.js";
|
|
3
|
+
import type { PrimitiveType } from "../primitive-type.js";
|
|
4
|
+
import { type PageAction, type PartAction } from "./action.js";
|
|
5
|
+
import { type ComparedAudiences } from "./audiences.js";
|
|
6
|
+
import type { PageReading } from "./parts.js";
|
|
7
|
+
import { type Ratio } from "./ratios.js";
|
|
8
|
+
/**
|
|
9
|
+
* What a change made readers *do*, rather than what it made them see.
|
|
10
|
+
*
|
|
11
|
+
* Four comparisons of two windows exist in this subsystem and every one of them
|
|
12
|
+
* is about attention: [`change.ts`](change.ts) asks what a change did to where
|
|
13
|
+
* reading stops, [`copy-change.ts`](copy-change.ts) to how many of the page's
|
|
14
|
+
* words get reached, [`pace-change.ts`](pace-change.ts) to whether readers had
|
|
15
|
+
* time for them, [`readership.ts`](readership.ts) to who the readers were.
|
|
16
|
+
* [`action.ts`](action.ts) answers *four in ten readers who got to the pricing
|
|
17
|
+
* band did something in it* — of **one window of one revision**, and nothing
|
|
18
|
+
* held two of those against each other.
|
|
19
|
+
*
|
|
20
|
+
* So the sentence a change to a band nobody uses is made for — *the band readers
|
|
21
|
+
* reached and touched nothing is used now* — had no answer, and it is the
|
|
22
|
+
* sentence closest to the commercial half of the premise: a deployment that can
|
|
23
|
+
* see which of its asks a change got answered has a reason to open the portal
|
|
24
|
+
* the morning after it ships one.
|
|
25
|
+
*
|
|
26
|
+
* It is taken out of what this subsystem already knows rather than collected:
|
|
27
|
+
* **nothing is added to a payload, a browser, a column, a store or the
|
|
28
|
+
* vocabulary**, and the broadcaster is not touched, so its weight is unchanged.
|
|
29
|
+
*
|
|
30
|
+
* ## The attribution `pace-change.ts` publishes is not available here
|
|
31
|
+
*
|
|
32
|
+
* A pace is `spentMs ÷ needMs`, and 0244 separates the readers from the change
|
|
33
|
+
* with a counterfactual: the later window's time against the **earlier**
|
|
34
|
+
* revision's words isolates the readers, and the other diagonal isolates the
|
|
35
|
+
* change. That works because one side of the division is **exact and
|
|
36
|
+
* reader-free** — the words a revision says are a property of the tree, costed
|
|
37
|
+
* identically in any window — so one term can be held still while the other
|
|
38
|
+
* moves.
|
|
39
|
+
*
|
|
40
|
+
* **A share of readers who acted has readers on both sides of the division.**
|
|
41
|
+
* `within ÷ reached` is two distinct page view counts off one row, so there is
|
|
42
|
+
* no reader-free term to hold still and no counterfactual to run. A share can
|
|
43
|
+
* rise because more readers acted or because fewer readers reached it, and those
|
|
44
|
+
* are opposite findings — the second is a page that got worse at carrying
|
|
45
|
+
* readers to a band, with the keener ones left behind — and nothing available
|
|
46
|
+
* here tells them apart.
|
|
47
|
+
*
|
|
48
|
+
* The figure anybody would reach for instead is the obvious one and it is worse
|
|
49
|
+
* than nothing: `now.within ÷ was.within` beside `now.reached ÷ was.reached`.
|
|
50
|
+
* Both counts are generous by their own window's straddle (0147), and the
|
|
51
|
+
* inflation does not divide out of a ratio whose two terms are in **different**
|
|
52
|
+
* windows — a rollup window a deployment shortened moves both of those ratios
|
|
53
|
+
* and moves no reader. That is the fact a deployment-wide order had to be
|
|
54
|
+
* scaled at the door for (0250), one level across, and it is why the only ratio
|
|
55
|
+
* published here is one whose two terms each have their window's straddle
|
|
56
|
+
* already divided out of them.
|
|
57
|
+
*
|
|
58
|
+
* So `shareRatio` is published and **no ratio of two windows' counts is**. The
|
|
59
|
+
* counts travel as the weight behind the share and never as a movement, which is
|
|
60
|
+
* how a readership comparison carries its two arrival totals and refuses the
|
|
61
|
+
* growth between them (0247).
|
|
62
|
+
*
|
|
63
|
+
* ## A share that appears where there was none can be a filing rule
|
|
64
|
+
*
|
|
65
|
+
* `engaged` counts the views whose reader did something *strictly inside* a node
|
|
66
|
+
* (0167), so it is structurally nought on a part with no element children and
|
|
67
|
+
* 0242 withholds the share rather than printing a nought. That is a fact about
|
|
68
|
+
* the **tree**, and a change is free to move it: wrap a button in a band and the
|
|
69
|
+
* band has an inside, so a share exists where one was withheld; unwrap it and
|
|
70
|
+
* the share disappears.
|
|
71
|
+
*
|
|
72
|
+
* Neither is readers doing anything differently, and the first reads exactly
|
|
73
|
+
* like the thing this module is for. {@link ComparedAction.inside} says so on
|
|
74
|
+
* every compared part, and `gained` is the member to look at hardest.
|
|
75
|
+
*
|
|
76
|
+
* **The movement vocabulary turns out to be immune to it and the share is not**,
|
|
77
|
+
* which is worth knowing because it says where to put the warning. `taken-up`
|
|
78
|
+
* requires the earlier side to be `untouched`, which requires it to have borne
|
|
79
|
+
* parts then — so a part that gained an inside **cannot** be reported as taken
|
|
80
|
+
* up, by construction rather than by a guard. What it can do is carry a share
|
|
81
|
+
* where the earlier side withheld one, and that is why `shareRatio` holds no
|
|
82
|
+
* quotient across every `gained` and every `lost`, and says `unmeasured` where
|
|
83
|
+
* it does not: the quotient exists only where both sides measured the same
|
|
84
|
+
* thing, which is `kept`. Both are properties of the code rather than claims
|
|
85
|
+
* about it, and both are pinned by tests.
|
|
86
|
+
*
|
|
87
|
+
* ## What survives a sender that does not walk, and what does not
|
|
88
|
+
*
|
|
89
|
+
* {@link ActionChangeSilence} `unwalked` names the state, and the division it
|
|
90
|
+
* makes is worth having rather than treating as a blanket:
|
|
91
|
+
*
|
|
92
|
+
* - **The shares are poisoned.** A window whose delegated signals carry no
|
|
93
|
+
* `within` credits nobody with acting inside anything, so every share in it
|
|
94
|
+
* is a nought that is a filing artefact — and a comparison between a walked
|
|
95
|
+
* window and an unwalked one would report the whole page as abandoned, which
|
|
96
|
+
* is the most alarming sentence this module could print and is about a
|
|
97
|
+
* configuration change.
|
|
98
|
+
* - **The occurrences are not.** `activations`, `opens`, `closes` and
|
|
99
|
+
* `completions` are filed against the part they happened to and need no walk
|
|
100
|
+
* at all, so {@link ComparedAction.usesRatio} and the four counts on either
|
|
101
|
+
* side stand in full — as does a {@link ComparedAction.movement} of `held`
|
|
102
|
+
* between two controls their own presses account for.
|
|
103
|
+
*
|
|
104
|
+
* **Nothing here enforces that division.** `pageActionOf` withholds every share
|
|
105
|
+
* and calls nothing `untouched` in such a window (0304), so every movement
|
|
106
|
+
* across it falls to `unknown` through `movementOf`'s existing collapse and
|
|
107
|
+
* every `shareRatio` to `unmeasured` through the shared helper's first clause,
|
|
108
|
+
* which is why there is no `walked` clause anywhere below. The fault is a
|
|
109
|
+
* property of the window rather than of any part, and a rule spelled here as
|
|
110
|
+
* well would be a second rule for a standing `pageActionOf` has already
|
|
111
|
+
* published — the fault this subsystem has been bitten by twice (0218, 0235).
|
|
112
|
+
*
|
|
113
|
+
* Pure, linear in the parts of the two readings, and reaches no store, clock or
|
|
114
|
+
* DOM, so it adds nothing to the broadcaster's import graph.
|
|
115
|
+
*/
|
|
116
|
+
/** Why a comparison of what readers did answered nothing. */
|
|
117
|
+
export type ActionChangeSilence =
|
|
118
|
+
/**
|
|
119
|
+
* The two readings are of different trees.
|
|
120
|
+
*
|
|
121
|
+
* Spelled as `ChangeSilence`, `CopyChangeSilence` and `PaceChangeSilence`
|
|
122
|
+
* spell it, because a surface drawing four comparisons of one change should
|
|
123
|
+
* not meet four names for one state (0240).
|
|
124
|
+
*/
|
|
125
|
+
"different-trees"
|
|
126
|
+
/**
|
|
127
|
+
* The two readings are of two audiences, and so of two populations.
|
|
128
|
+
*
|
|
129
|
+
* Spelled and refused as the other comparisons spell and refuse it (0240). A
|
|
130
|
+
* page is one base tree plus the deltas an audience earns (0263), so a
|
|
131
|
+
* control only the other form carries would be read as a control this change
|
|
132
|
+
* added, and the two sides' takings-up are two populations'.
|
|
133
|
+
*
|
|
134
|
+
* Refused only where both sides name an audience and the two differ; a pair
|
|
135
|
+
* spanning the migration that added the column (0284) is in
|
|
136
|
+
* {@link ActionChange.audiences} instead.
|
|
137
|
+
*/
|
|
138
|
+
| "different-audiences"
|
|
139
|
+
/**
|
|
140
|
+
* One of the two windows holds two forms of the page and named neither.
|
|
141
|
+
*
|
|
142
|
+
* The state the before-and-after reading and the two deployment orders took
|
|
143
|
+
* the morning before (0301), in one of the three readings that record did not
|
|
144
|
+
* reach. Without it this comparison published `nothing-measured` — *one of the two windows
|
|
145
|
+
* held no page views* — of a window that held plenty: it held two forms of
|
|
146
|
+
* them. A page reading read as neither has a view floor of nought with full
|
|
147
|
+
* counters behind it (`parts.ts`), so the floor alone cannot tell a window
|
|
148
|
+
* nobody read from a window nobody split, and the two sentences send a
|
|
149
|
+
* deployment to opposite places: one to look for a broken sender, the other
|
|
150
|
+
* to split the window and read twice, which is a call away.
|
|
151
|
+
*
|
|
152
|
+
* **The tree half still answers**, which is the half `nothing-measured`
|
|
153
|
+
* leaves standing and for its reason: which parts the change added and
|
|
154
|
+
* removed, and which of them gained or lost an inside, are facts about the
|
|
155
|
+
* two revisions. Every share is withheld, and the two readings on the
|
|
156
|
+
* comparison stay honest about the windows they were each handed.
|
|
157
|
+
*
|
|
158
|
+
* **It cannot co-occur with `different-audiences`**, so the order between the
|
|
159
|
+
* two is not observable: `crossesAudiences` needs an audience on both sides
|
|
160
|
+
* and a mixed side has none, while a side that names one and holds two in its
|
|
161
|
+
* census reads as `one`, because an audience asked for always wins (0300).
|
|
162
|
+
* The order that does matter is **before `unwalked`**, and it is the one
|
|
163
|
+
* ordering in this set taken on a rule rather than on a cause. Both are
|
|
164
|
+
* reachable at once — one side read as neither form, the other a window whose
|
|
165
|
+
* delegated signals carry no `within` — and **the state whose remedy is a
|
|
166
|
+
* call wins, because taking it reveals the other and taking the other does
|
|
167
|
+
* not reveal it.** A deployment told `unwalked` first goes and fixes a
|
|
168
|
+
* sender, asks again, and is handed the same unsplit window with nothing
|
|
169
|
+
* saying so.
|
|
170
|
+
*/
|
|
171
|
+
| "audiences-mixed"
|
|
172
|
+
/**
|
|
173
|
+
* One of the two windows holds uses and credits no reader with acting inside
|
|
174
|
+
* anything.
|
|
175
|
+
*
|
|
176
|
+
* `PageAction.unwalked` on either side: a sender whose delegated signals carry
|
|
177
|
+
* no `within` (0167), a server synthesising batches, a fixture replayed. Every
|
|
178
|
+
* share on that side would be a nought that is a filing artefact, so every
|
|
179
|
+
* movement across it would be spurious and the page would read as abandoned.
|
|
180
|
+
*
|
|
181
|
+
* **So the figures are withheld as well as the state named** (0304), and by
|
|
182
|
+
* the reading rather than here: that side's standings are `unknown` and its
|
|
183
|
+
* shares absent, so every {@link ComparedAction.movement} falls to `unknown`
|
|
184
|
+
* and every {@link ComparedAction.shareRatio} to `null`.
|
|
185
|
+
*
|
|
186
|
+
* **The occurrence figures still stand**, because a press is filed against the
|
|
187
|
+
* part it happened to and needs no ancestry — including a `held` between two
|
|
188
|
+
* controls their own presses account for. Which side it is, is on that side's
|
|
189
|
+
* own reading, as `nothing-measured` leaves which window was empty to the pair
|
|
190
|
+
* of readings rather than naming it here.
|
|
191
|
+
*
|
|
192
|
+
* Checked before `nothing-measured`, which it cannot ordinarily coincide with:
|
|
193
|
+
* a window with no page views holds no uses either. A row carrying occurrences
|
|
194
|
+
* with no views is a sender that is not one, and this is the sharper of the two
|
|
195
|
+
* things to say about it.
|
|
196
|
+
*/
|
|
197
|
+
| "unwalked"
|
|
198
|
+
/**
|
|
199
|
+
* One of the two windows held no page views.
|
|
200
|
+
*
|
|
201
|
+
* Every standing on that side is `unknown` (0242), so there is no share to
|
|
202
|
+
* compare. **The tree half still answers**: which parts the change added and
|
|
203
|
+
* removed, and which of them gained or lost an inside, are facts about the two
|
|
204
|
+
* revisions — and *the change added a band and nothing has been measured
|
|
205
|
+
* since* is true and worth saying.
|
|
206
|
+
*/
|
|
207
|
+
| "nothing-measured"
|
|
208
|
+
/**
|
|
209
|
+
* No part the two revisions share says anything on either side.
|
|
210
|
+
*
|
|
211
|
+
* The state `CopyChangeSilence.dissolved` reports of words and
|
|
212
|
+
* `PaceChangeSilence.dissolved` of parts: a page that carries no part carries
|
|
213
|
+
* no action either (0240). The census of what was added and removed answers in
|
|
214
|
+
* full and is the whole of what can be said.
|
|
215
|
+
*/
|
|
216
|
+
| "dissolved";
|
|
217
|
+
/** The closed set, for a surface that has to account for every absent figure. */
|
|
218
|
+
export declare const ACTION_CHANGE_SILENCES: readonly ActionChangeSilence[];
|
|
219
|
+
/** One line per silence, for a surface saying why a figure is not there. */
|
|
220
|
+
export declare const describeActionChangeSilence: (silence: ActionChangeSilence) => string;
|
|
221
|
+
/**
|
|
222
|
+
* What happened to the verdict on one part between two windows.
|
|
223
|
+
*
|
|
224
|
+
* Five states out of three standings either side, and not nine, because
|
|
225
|
+
* `unknown` is *nothing can be said* rather than a third verdict (0242): a part
|
|
226
|
+
* it is true of on either side has not moved, it has gone unmeasured, and
|
|
227
|
+
* collapsing the five combinations it appears in into one member is what keeps
|
|
228
|
+
* the other four claims.
|
|
229
|
+
*
|
|
230
|
+
* Named for a movement rather than for an improvement. A standing is about the
|
|
231
|
+
* readers of its own window, so a part can be taken up because a change made
|
|
232
|
+
* its ask worth answering, because it acquired an inside for actions to be
|
|
233
|
+
* filed against ({@link ComparedAction.inside}), or because a quieter window
|
|
234
|
+
* held a different set of readers — and nothing here separates the third.
|
|
235
|
+
*/
|
|
236
|
+
export type ActionMovement =
|
|
237
|
+
/**
|
|
238
|
+
* Readers reached it and did nothing in it, and now they do something — the
|
|
239
|
+
* sentence a change to a band nobody uses is made for.
|
|
240
|
+
*
|
|
241
|
+
* **It cannot be the shape change in disguise.** `untouched` on the earlier
|
|
242
|
+
* side requires that side to have borne element parts, so a part the change
|
|
243
|
+
* gave an inside to is never reported here — the one combination to read
|
|
244
|
+
* {@link ComparedAction.inside} for is `lost`, which is a band whose children
|
|
245
|
+
* the change removed and which now reports presses of its own.
|
|
246
|
+
*/
|
|
247
|
+
"taken-up"
|
|
248
|
+
/** Readers did something in it and now they reach it and do nothing. */
|
|
249
|
+
| "abandoned"
|
|
250
|
+
/**
|
|
251
|
+
* Reached and untouched before, reached and untouched now — the asks a change
|
|
252
|
+
* did not fix.
|
|
253
|
+
*
|
|
254
|
+
* Kept apart from `held` because both are *the standing did not move* and they
|
|
255
|
+
* are opposite findings about a page, which is how a pace comparison keeps
|
|
256
|
+
* `still-skimmed` from `held` (0244).
|
|
257
|
+
*/
|
|
258
|
+
| "still-untouched"
|
|
259
|
+
/** Readers did something in it before and after. */
|
|
260
|
+
| "held"
|
|
261
|
+
/**
|
|
262
|
+
* One of the two windows cannot say whether readers acted on it.
|
|
263
|
+
*
|
|
264
|
+
* No row named it, its `reached` is nought while the window held views — the
|
|
265
|
+
* unanchorable case (0221) — or it is a leaf on that side, whose nought is a
|
|
266
|
+
* filing rule and not a measurement (0242). Which it is, is on that side's own
|
|
267
|
+
* standing, and {@link ComparedAction.inside} answers the last of the three
|
|
268
|
+
* outright.
|
|
269
|
+
*
|
|
270
|
+
* **A control whose presses began is in here**, and that is the §6 thinness in
|
|
271
|
+
* a third place rather than a choice made here: a leaf with no uses is
|
|
272
|
+
* `unknown` because nothing in the tree says whether it could be pressed —
|
|
273
|
+
* `role` declares one member and it is not *a control* (0238) — so the earlier
|
|
274
|
+
* side has no verdict to move from. The two sides' `uses` travel on the rows,
|
|
275
|
+
* and the day a primitive can declare what it can report, every counter
|
|
276
|
+
* already stored reinterprets (0212).
|
|
277
|
+
*/
|
|
278
|
+
| "unknown";
|
|
279
|
+
/** The closed set, for a surface accounting for every part it was handed. */
|
|
280
|
+
export declare const ACTION_MOVEMENTS: readonly ActionMovement[];
|
|
281
|
+
/** One line per movement, for a surface putting a part in front of a person. */
|
|
282
|
+
export declare const describeActionMovement: (movement: ActionMovement) => string;
|
|
283
|
+
/**
|
|
284
|
+
* What the change did to whether a part has an inside for actions to be filed
|
|
285
|
+
* against.
|
|
286
|
+
*
|
|
287
|
+
* A fact about the two **trees** and not about any window, and the one movement
|
|
288
|
+
* here that can be stated on a page nobody has read. It exists because
|
|
289
|
+
* `PartAction.share` is withheld on a part with no element children — `engaged`
|
|
290
|
+
* counts readers who acted *strictly inside* a node, so a leaf's nought is a
|
|
291
|
+
* filing rule (0167, 0242) — and whether a part is a leaf is something a change
|
|
292
|
+
* may alter.
|
|
293
|
+
*/
|
|
294
|
+
export type InsideMovement =
|
|
295
|
+
/** It bore element parts in both revisions, so its share means the same thing on both sides. */
|
|
296
|
+
"kept"
|
|
297
|
+
/**
|
|
298
|
+
* It was a leaf and now bears element parts, so it has a share where its share
|
|
299
|
+
* was withheld.
|
|
300
|
+
*
|
|
301
|
+
* **The one that reads like success and is not.** A button a change wrapped in
|
|
302
|
+
* a band reports a share from the moment it has an inside, and the share it
|
|
303
|
+
* had before was not a nought — it was not a measurement at all.
|
|
304
|
+
*
|
|
305
|
+
* The movement cannot be fooled by it: `taken-up` needs the earlier side to
|
|
306
|
+
* have borne parts, so it is unreachable here. The **share** can be, which is
|
|
307
|
+
* why {@link ComparedAction.shareRatio} holds no quotient on any part whose
|
|
308
|
+
* inside moved, and why a surface drawing a bare `now.share` beside an absent
|
|
309
|
+
* `was.share` needs this member to say what the absence was: the ratio says
|
|
310
|
+
* only that one side did not measure it.
|
|
311
|
+
*/
|
|
312
|
+
| "gained"
|
|
313
|
+
/** It bore element parts and is now a leaf, so a share that was a measurement is withheld. */
|
|
314
|
+
| "lost"
|
|
315
|
+
/** A leaf in both revisions: its share is withheld on both sides and its standing is `unknown` on both. */
|
|
316
|
+
| "none";
|
|
317
|
+
/** The closed set, for a surface accounting for every compared part. */
|
|
318
|
+
export declare const INSIDE_MOVEMENTS: readonly InsideMovement[];
|
|
319
|
+
/** One line per movement, for a surface saying what the change did to a part's shape. */
|
|
320
|
+
export declare const describeInsideMovement: (movement: InsideMovement) => string;
|
|
321
|
+
/**
|
|
322
|
+
* One part both revisions have, as two windows read what readers did with it.
|
|
323
|
+
*
|
|
324
|
+
* Matched by node, which is what makes the comparison about the part rather than
|
|
325
|
+
* about its position: a part a change moved is compared like any other, as
|
|
326
|
+
* 0239 compares a passage the change moved and unlike the pair a change
|
|
327
|
+
* dissolves (0224), because a pair is a position by construction and a part is
|
|
328
|
+
* not.
|
|
329
|
+
*/
|
|
330
|
+
export type ComparedAction = {
|
|
331
|
+
readonly nodeId: NodeId;
|
|
332
|
+
/** The later revision's type, which is the page somebody is looking at. */
|
|
333
|
+
readonly type: PrimitiveType;
|
|
334
|
+
/** The later revision's role (0114), or `null` where its type declared none. */
|
|
335
|
+
readonly role: PrimitiveRole | null;
|
|
336
|
+
/** The whole of what the earlier window said about it. */
|
|
337
|
+
readonly was: PartAction;
|
|
338
|
+
/** The whole of what the later window said about it. */
|
|
339
|
+
readonly now: PartAction;
|
|
340
|
+
readonly movement: ActionMovement;
|
|
341
|
+
/** What the change did to whether a share of this part is measurable at all. */
|
|
342
|
+
readonly inside: InsideMovement;
|
|
343
|
+
/**
|
|
344
|
+
* `now.share ÷ was.share`, with the reason named where there is no quotient
|
|
345
|
+
* (0306).
|
|
346
|
+
*
|
|
347
|
+
* **The one ratio here that is sound across two windows.** Each side's share
|
|
348
|
+
* is two distinct view counts off one row, so each window's straddle (0147)
|
|
349
|
+
* has very nearly divided out before the two sides meet — the cancellation a
|
|
350
|
+
* fall between two siblings rests on (0221), and the reason a ratio of the
|
|
351
|
+
* counts themselves is refused by this module and not published anywhere on
|
|
352
|
+
* this type.
|
|
353
|
+
*
|
|
354
|
+
* Nought on the earlier side is `from-nothing` rather than infinity: *nobody
|
|
355
|
+
* acted here and now somebody does* is {@link movement}'s answer and the two
|
|
356
|
+
* sides', and a quotient is a figure a surface divides and ranks by.
|
|
357
|
+
*
|
|
358
|
+
* It holds a number **only where {@link inside} is `kept`**, which falls out
|
|
359
|
+
* of the two sides' shares being withheld on a leaf and is not a separate
|
|
360
|
+
* rule: a ratio across a part whose shape changed would be a ratio of two
|
|
361
|
+
* different measurements. Those are `unmeasured`, and {@link inside} says
|
|
362
|
+
* which direction the shape moved in.
|
|
363
|
+
*
|
|
364
|
+
* `unmeasured` across an {@link ActionChangeSilence} of `unwalked` by the
|
|
365
|
+
* same route: that window has no share to give (0304).
|
|
366
|
+
*/
|
|
367
|
+
readonly shareRatio: Ratio;
|
|
368
|
+
/**
|
|
369
|
+
* `now.usesPerReader ÷ was.usesPerReader`, with a nought a side withheld
|
|
370
|
+
* restored first (0306).
|
|
371
|
+
*
|
|
372
|
+
* Occurrences per reader on each side, so each term has its own window's
|
|
373
|
+
* straddle divided out of it and the ratio stands. **An intensity and not a
|
|
374
|
+
* rate** on both sides (0242), so this is how much more each reader used a
|
|
375
|
+
* part and never how many more readers did.
|
|
376
|
+
*
|
|
377
|
+
* A side that reached readers and was used by none of them counts as a nought
|
|
378
|
+
* here, where the reading itself withholds the figure: a part nobody touched
|
|
379
|
+
* and four presses a reader now is `from-nothing`, and a part readers used
|
|
380
|
+
* and have stopped using is a quotient of nought. `unmeasured` is a side with
|
|
381
|
+
* no readers to divide by, which is the one state neither window measured.
|
|
382
|
+
*
|
|
383
|
+
* The figure here that survives `unwalked`, because the four occurrence
|
|
384
|
+
* counters are filed against the part a reader used and need no ancestry.
|
|
385
|
+
*/
|
|
386
|
+
readonly usesRatio: Ratio;
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* What a change did to what readers do on a page.
|
|
390
|
+
*
|
|
391
|
+
* The two {@link PageAction}s it is made of are returned, so nothing downstream
|
|
392
|
+
* derives them twice and every whole-page figure either side — the root's
|
|
393
|
+
* headcount, `leaves`, `unwalked` — is one field away without a second join.
|
|
394
|
+
*/
|
|
395
|
+
export type ActionChange = {
|
|
396
|
+
/** The earlier reading's tree. The two agree unless `silence` is `different-trees`. */
|
|
397
|
+
readonly treeId: TreeId;
|
|
398
|
+
readonly revisions: {
|
|
399
|
+
readonly was: number;
|
|
400
|
+
readonly now: number;
|
|
401
|
+
};
|
|
402
|
+
/**
|
|
403
|
+
* The audience each side was of, where its reading named one.
|
|
404
|
+
*
|
|
405
|
+
* As `ReadingChange.audiences` carries it, and for the same reason: a `null`
|
|
406
|
+
* on either side is why an unprovable pair of populations is compared rather
|
|
407
|
+
* than refused.
|
|
408
|
+
*/
|
|
409
|
+
readonly audiences: ComparedAudiences;
|
|
410
|
+
/** The two readings of what readers did that this comparison is made of. */
|
|
411
|
+
readonly readings: {
|
|
412
|
+
readonly was: PageAction;
|
|
413
|
+
readonly now: PageAction;
|
|
414
|
+
};
|
|
415
|
+
/**
|
|
416
|
+
* Every part both revisions have that a row named on either side, in the
|
|
417
|
+
* **later** reading order.
|
|
418
|
+
*
|
|
419
|
+
* The later order because that is the page somebody is looking at. A part no
|
|
420
|
+
* row named on either side is left out: nothing in either window reported it,
|
|
421
|
+
* so a row for it could only ever read `unknown` and would make
|
|
422
|
+
* {@link movements} a count of parts nobody measured. {@link insides} is
|
|
423
|
+
* therefore a census of the compared parts and not of the tree.
|
|
424
|
+
*/
|
|
425
|
+
readonly compared: readonly ComparedAction[];
|
|
426
|
+
/**
|
|
427
|
+
* Parts only the later revision has, as the later window read them, in its
|
|
428
|
+
* reading order.
|
|
429
|
+
*
|
|
430
|
+
* A census with readers in it rather than an exact one, unlike the census of
|
|
431
|
+
* the words a change wrote (0239): a part that did not exist before has to be
|
|
432
|
+
* reached now for anything to be said about it. *The change added an ask and
|
|
433
|
+
* nobody has opened it* is the row worth looking at.
|
|
434
|
+
*/
|
|
435
|
+
readonly added: readonly PartAction[];
|
|
436
|
+
/** Parts only the earlier revision had, as the earlier window read them, in its reading order. */
|
|
437
|
+
readonly removed: readonly PartAction[];
|
|
438
|
+
/** Compared parts by what happened to the standing. The five add to {@link compared}'s length. */
|
|
439
|
+
readonly movements: Readonly<Record<ActionMovement, number>>;
|
|
440
|
+
/** Compared parts by what the change did to their shape. The four add to {@link compared}'s length. */
|
|
441
|
+
readonly insides: Readonly<Record<InsideMovement, number>>;
|
|
442
|
+
/**
|
|
443
|
+
* The root, compared against itself across the two revisions.
|
|
444
|
+
*
|
|
445
|
+
* *Three in ten readers did something on this page and now four in ten do* —
|
|
446
|
+
* the page's one headcount figure, and a row rather than an addition: every
|
|
447
|
+
* action is strictly inside the root, so summing `within` across parts would
|
|
448
|
+
* charge one reader once per level they acted inside (0147, 0167). That is why
|
|
449
|
+
* there is **no page-level total of readers who acted** here or anywhere, and
|
|
450
|
+
* this stands in for one.
|
|
451
|
+
*
|
|
452
|
+
* Kept out of the rankings below, because its subtree is every part it would
|
|
453
|
+
* outrank — the rule a pace comparison and a fall between two siblings both
|
|
454
|
+
* follow (0221, 0230).
|
|
455
|
+
*
|
|
456
|
+
* `null` where either revision's root is not an element, or where no row named
|
|
457
|
+
* it on either side.
|
|
458
|
+
*/
|
|
459
|
+
readonly whole: ComparedAction | null;
|
|
460
|
+
/**
|
|
461
|
+
* The ask the change got answered: `taken-up`, most readers reached it in the
|
|
462
|
+
* later window, then first in the later reading order.
|
|
463
|
+
*
|
|
464
|
+
* **By headcount at the volume the page has now**, rather than by the share or
|
|
465
|
+
* by its movement, which is the ranking rule this subsystem spells once (0221,
|
|
466
|
+
* 0224): a caption two readers out of three now use is a better ratio and a
|
|
467
|
+
* smaller gain than a band four hundred of them do. The headcount is the later
|
|
468
|
+
* window's own `reached`, which is a count inside one window and so is not the
|
|
469
|
+
* cross-window ratio this module refuses.
|
|
470
|
+
*
|
|
471
|
+
* `null` where nothing was taken up.
|
|
472
|
+
*/
|
|
473
|
+
readonly mostTakenUp: ComparedAction | null;
|
|
474
|
+
/** The ask the change lost, on the same terms. */
|
|
475
|
+
readonly mostAbandoned: ComparedAction | null;
|
|
476
|
+
/**
|
|
477
|
+
* The parts readers reached and did nothing in, before and after — most
|
|
478
|
+
* reached now first, then in the later reading order.
|
|
479
|
+
*
|
|
480
|
+
* The list a person can act on without reading anything else, and the one
|
|
481
|
+
* ranking here about where a change did **not** land. The root is left out as
|
|
482
|
+
* it is left out of every ranking here; {@link whole} carries it.
|
|
483
|
+
* `still-untouched` only: a part whose standing is `unknown` on either side is
|
|
484
|
+
* in {@link movements} where it can be seen and not acted on, because putting
|
|
485
|
+
* it here would turn *nothing can be said* into *readers are ignoring this*.
|
|
486
|
+
*/
|
|
487
|
+
readonly stillUntouched: readonly ComparedAction[];
|
|
488
|
+
/** Why there is no comparison of the reading, or `null` where there is one. */
|
|
489
|
+
readonly silence: ActionChangeSilence | null;
|
|
490
|
+
};
|
|
491
|
+
/**
|
|
492
|
+
* What a change did to what readers do on a page, off two `PageReading`s and
|
|
493
|
+
* nothing else.
|
|
494
|
+
*
|
|
495
|
+
* Handed two readings rather than two finished `PageAction`s, for the reason
|
|
496
|
+
* `copyChangeOf` and `paceChangeOf` are: one input per side cannot be a
|
|
497
|
+
* mismatched pair, and the two readings it derives are returned so nothing
|
|
498
|
+
* downstream pays for them twice.
|
|
499
|
+
*
|
|
500
|
+
* The labels `was` and `now` are the caller's. Nothing here checks which reading
|
|
501
|
+
* is older, so a caller holding them backwards gets a comparison with every
|
|
502
|
+
* movement reversed rather than a refusal — the bargain 0224 struck, for its
|
|
503
|
+
* reason: *this week against last week* is the same question with the tree held
|
|
504
|
+
* still, and refusing one order would refuse that too.
|
|
505
|
+
*/
|
|
506
|
+
export declare const actionChangeOf: (was: PageReading, now: PageReading) => ActionChange;
|
|
507
|
+
//# sourceMappingURL=action-change.d.ts.map
|